Skip to content

@since gates should not transitively apply across package boundaries when worlds are included #325

@ydnar

Description

@ydnar

Extending from #306, WIT version gates cannot be correctly represented in the fully-resolved representation of a component, e.g. in JSON.

The problem arises when a world in package A includes a world from package B, which imports or exports an interface with a version gate, e.g. @since(version = 0.2.0). The fully-resolved version of the component as emitted from wasm-tools will include the package B version gate in the world inside package A.

Testdata

wit-bindgen-go uses wasm-tools@v1.227.1 internally to parse the WIT, produce a Resolve, and serialize to JSON, which is then loaded and then re-serialized into WIT.

The existing test corpus in this repo performs a WIT → JSON → WIT round trip verification for every JSON file in testdata. This is currently breaking for 2 files (issues/issue325.wit and wit-parser/gated-include-use-with-stable.wit). See #326 for more information.

Links:

  1. https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md#feature-gates
  2. fix mismatch in stability attributes error in wit-parser wasm-tools#2076

cc @alexcrichton @Mossaka

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions