-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIT: Implement @since and @unstable annotations #1508
WIT: Implement @since and @unstable annotations #1508
Conversation
Would this PR update the JSON fixtures in the wit-parser crate? |
It does, yes. You can see examples in the |
I spoke with Alex last week - in order to move this forward we want to at a minimum have a reference of what this would look like when applied to the existing WASI WIT definitions. So I'll be doing that next, and share a link to that back here. |
Okay, I ported all of WASI to use edit (2024-05-28): I also went ahead and filed PRs against the individual specifiations:
|
Previously the entire error message was replaced, losing any attached context. This commit updates error highlighting to only augment the single error found in the chain that's being highlighted (in the most common case). This required a small refactoring of the `Error` type and changes all existing users to a method-based constructor rather than explicit struct-based construction.
Nothing uses the results of parsing yet, that's going to come in a future commit.
Will be used for errors in a future commit.
This commit pushes stability attributes through the resolution process to the next stage of AST. The top-level user-facing types in `wit-parser` now have `Stability` annotations were they can be added. This commit notably changes the `WorldItem::Interface` enum variant to contain a stability attribute in addition to the id listed.
This finishes support for `@unstable` and `@since` in `Resolve` by handling all items there and specifically filtering out any disabled items.
This involved a number of refactorings and "tricks" to get this to work out. Namely when possible the old format of the custom section is still emitted to ensure older/newer tools can interoperate when possible.
b8200df
to
6bd6982
Compare
This commit updates the wasm-tools crates to their 209 versions which include support for WIT features from bytecodealliance/wasm-tools#1508. This adds a `--features` CLI flag in addition to a `features` configuration of the Rust bindings macro.
This commit updates the wasm-tools crates to their 209 versions which include support for WIT features from bytecodealliance/wasm-tools#1508. This adds a `--features` CLI flag in addition to a `features` configuration of the Rust bindings macro.
I finally got to updating wasm-tools-go to support the new JSON schema. Q: why was the schema for the WorldItem Interface case changed? But not the others? Should the gating attributes be present on the Interface? |
For types/functions the attributes were already present on the type/function itself, but for interfaces it was intended to help disambiguate: @unstable(feature = "a")
interface foo {}
world bar {
@unstable(feature = "b")
import foo;
} Here there's two different features that need to be modeled, but in the case of functions/types there's never two features to model. |
Enable --features active to follow wasm-tools tests. See alexcrichton/wasm-tools@8ebbf90 and bytecodealliance/wasm-tools#1508.
Enable --features active to follow wasm-tools tests. See alexcrichton/wasm-tools@8ebbf90 and bytecodealliance/wasm-tools#1508.
Enable --features active to follow wasm-tools tests. See alexcrichton/wasm-tools@8ebbf90 and bytecodealliance/wasm-tools#1508.
This PR is an implementation of WebAssembly/component-model#332 for wasm-tools. This is a pretty big feature for WIT so it's a pretty large PR as well. I've tried to split out separate commits where each commit passes test to more easily digest the changes that are happening here.
At a high level:
@since
and@unstable
.@unstable
items do not appear inResolve
by defaultResolve::features
to control whether unstable items appearResolve
The intention is that this will be a building block for WASI's release processes. Namely all APIs will start as
@unstable
and only become ungated with@since
once they're voted to be at such a phase.@unstable
APIs will be available to all consumers but only on an opt-in basis which will enable everyone to have proper gates and processes around ensuring that unstable APIs aren't relied on without knowing that things may change.