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
Open
alexcrichton
wants to merge
10
commits into
bytecodealliance:main
Choose a base branch
from
alexcrichton:since-and-unstable
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
WIT: Implement @since and @unstable annotations #1508
alexcrichton
wants to merge
10
commits into
bytecodealliance:main
from
alexcrichton:since-and-unstable
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Would this PR update the JSON fixtures in the wit-parser crate? |
It does, yes. You can see examples in the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.