-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
wasip2 target should not conditionally feature gate stdlib APIs #130323
Comments
Thanks for the cc here, and thanks for the issue! This is an intentional de-stabilization because the bindings in It's worth noting though that this is a very coarse de-stabilization. It looks like rust-url is using I'll try to work on a PR to flag some bits that make sense as stable. @Manishearth do you know of other crates that are adding this feature? If so could you point me to them so I can review what bits are being used? |
@alexcrichton I believe @brooksmtownsend has been going around makiing this work across reqwest deps. I appreciate the work to stabilize some of those bits! Honestly, I suspect a cleaner path forward would be to make |
Yeah I'm thinking similarly. For rust-url in the meantime I might recommend using |
Thanks @alexcrichton , that's the path I took in the above mentioned PR and that worked pretty well. |
- wasip2 will require +nightly until rust-lang/rust#130323 is resolved and/or std::os::wasip2 is available in stable. - Support was added to rustix for version 0.38.39 bytecodealliance/rustix#1205 Signed-off-by: Colin Murphy <[email protected]> Co-authored-by: Steven Allen <[email protected]>
- wasip2 will require +nightly until rust-lang/rust#130323 is resolved and/or std::os::wasip2 is available in stable. - Support was added to rustix for version 0.38.39 bytecodealliance/rustix#1205 - Support was added to tempfile for version 3.14 Stebalien/tempfile#305
- wasip2 will require +nightly until rust-lang/rust#130323 is resolved and/or std::os::wasip2 is available in stable. - Support was added to rustix for version 0.38.39 bytecodealliance/rustix#1205 - Support was added to tempfile for version 3.14 Stebalien/tempfile#305
This was introduced in #119616 (cc @rylev)
Currently, any crate using
std::os::wasi
stuff needs to add a#![feature(wasip2)]
if it is to be compiled with--target=wasm32-wasip2
. This is due to this line:rust/library/std/src/os/wasi/mod.rs
Line 32 in 0307e40
This puts library authors targeting stable wasm stuff in an annoying situation of needing to add a feature gate to support downstream users who wish to use unstable wasm stuff (see servo/rust-url#960). This isn't really how feature gates should work: the entity using the feature should be the one opting in. I don't think any of the benefits of feature gates apply if every wasi-using dep in the ecosystem just slaps on a
#![cfg_attr(all(target_os = "wasi", target_env = "p2"), feature(wasip2))]
, which seems likely here.A somewhat legitimate reason I could see for having such a feature is if the wasip2 target is stable, but certain stdlib things are unstable under that target. It still has the same problems, and I'd argue a target with specially unstable stdlib APIs should not be considered stable, but at least there appears to be a meaningful thing that the stdlib feature gate is gating.
However, it appears to me that wasip2 is just unstable: what's the purpose of gating the stdlib API? If the goal is to gate the target, why not require
-Zunstable-options
as we do for other CLI-level unstable things?The text was updated successfully, but these errors were encountered: