-
Notifications
You must be signed in to change notification settings - Fork 232
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
fix(wit-parser): improve checking for stable feature gates #1689
fix(wit-parser): improve checking for stable feature gates #1689
Conversation
7f9c1b4
to
c267ab5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Could you be sure to add a test for this too? Something in tests/cli/*
should suffice with a // FAIL: ...
header
cf7d65b
to
cbf9bbd
Compare
b92523d
to
8425d91
Compare
Hey @alexcrichton so looking back at the WIT design doc (while I was trying to change it):
It looks like there is an expectation for Maybe this PR should reflect that, rather than changing it and then updating the docs upstream? |
e099e8b
to
8a0eaf8
Compare
Ah I had missed that as well, good catch! That seems reasonable to me to implement yeah, want to do so as part of this PR? |
7d76c66
to
fe67930
Compare
Done! I needed to add some changes (and update some tests), would appreciate some extra close eyes on this change set (and of course the rest of the PR). Requiring the feature be specified is making a bunch of interfaces be missing, along with the deprecated flag (which wasn't being taken into account before), just want to make sure I'm reading the test output right and it passes a human spot check that isn't mine. |
Actually, some more thinking here @alexcrichton ... The way that the note is phrased, we actually must allow
Given this sentence it assumes it is possible for I think to match this expected functionality we have to allow I'm updating the code now to match |
f1e8d12
to
99bbd65
Compare
Hm I think you're right on your interpretation of the text, but now I'm having second thoughts about supporting it exactly as-is. How about reverting back to:
That to me feels like a more straightforward way to interpret these attributes and if you agree I can work on sending a PR upstream as well. |
Hey so after some discussion at the JS meeting with @guybedford we actually realized another issue -- the AND vs OR combination of There's also the benefit (possibly anti-benefit?) of being able to span a feature over multiple versions (changing how a certain item works over two different versions). An example of this that might make sense is something like:
I'm I think there might be a bunch of surprise at the ORing of those, does it make sense to actually hammer this out/give everyone a chance to chat about it in an issue on |
I'm not sure I quite follow what you mean by AND vs OR? But regardless it seems fine to discuss some more of the finer details on the component-model repository as well. |
Ah so before I make the other issue -- basically the idea of whether The logic right now in the WIT design describes an OR (valid version or feature enabled), but it might make sense/be unsurprising to have an AND -- i.e. valid version and feature enabled to see the import at all. So there are 3 options:
|
Ah ok I see. Personally I don't think an AND is viable given how features/since/unstable are planned to be used in WASI. I also don't think that the OR requirement as stated in WIT.md necessarily makes sense because it doesn't really make sense for In any case I agree with your 3 options, and probably good to discuss upstream! |
417399c
to
d7982b3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! One last comment here and I think this is good to go
d7982b3
to
6cbb4a1
Compare
6cbb4a1
to
c50260a
Compare
Seems like actions/upload-artifact is having a bit of an outage, hopefully this that step can just be re-run and pass soon! [EDIT] Rebasing one more time just to try and re-trigger CI |
This commit introduces some extra checking for stabilized feature gates (i.e. `@since` & in-code `Stability::Stable`) with a version and/or feature specified. There are two primary changes: - Ensure that packages containing a `@since` annotation must have a version specified - Referring to a future unreleased package version in a `@since` annotation is an error In the past `Stability::Stable` feature gates were simply treated as `Unknown`, which hides the information necessary for downstream crates/consumers to use (and created the question around whether referring to future package versions is valid). Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
c50260a
to
7ee44d9
Compare
This commit introduces some extra checking (and panicking) for feature gates that are stable (i.e.
Stability::Stable
) AKA@since
with a version and/or features specified.There are two primary changes:
In the past
Stability::Stable
feature gates were simply treated asUnknown
, which hides the information necessary for downstream crates/consumers to use (and created the question around whether referring to future package versions is valid).See also the relevant Zulip discussion