bytecodealliance/wac

Targets check not validating implicit imports

fibonacci1729 opened this issue · 1 comments

Consider this wac document:

package test:test targets wasi:http/proxy;

export new spin:kv{...}...;

Where spin:kv is a component that targets the world:

world {
     import fermyon:spin/kv@2.0.0;
     export wasi:http/incoming-handler@0.2.0;
}

Currently, handling implicit instantiation arguments (e.g. the fill via {...} in new spin:kv{...} above) is deferred until encoding. This is a problem because during resolve when the targets predicate is validated we end up ignoring imports that otherwise effect the shape of the composition's world. The above document should fail to validate because the resulting composition contains a superset of the wasi:http/proxy world's imports.

I'm going to take a look into this, and see how we might address the issue.