-
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
Can rustc-dev
be made available for the wasm32-unknown-unknown
target?
#86122
Comments
@rustbot label +O-wasm +T-compiler |
wasm32 is not a target we build the compiler toolchain currently. I am not sure it makes sense to do so, but if you would like to make a proposal to do so, the place to start is https://doc.rust-lang.org/nightly/rustc/target-tier-policy.html (tier 2 with host tools). It is already a tier 2 target, but as it was previously existent at that tier, we should document the tier 3 and tier 2 requirements as well. |
Thanks, that is a good starting point! I will dig into that. |
rustc, rustfmt and clippy are useful in playgrounds and educational tools that are browser-based. It also can be useful to run rustc and tools in wasm based sandboxes such as cloudflare workers or fastly serverless for CI proposes. So I think it would meet the tier 2 with host tools criteria. @thomaseizinger Are you still interested in this? |
I am yes. My usecase is to allow https://github.com/dprint/dprint-plugin-rustfmt to be compiled to WASM again. At the moment, the plugin works by executing the native That being said, it is not a blocker per se which is why I couldn't invest any resources so far. |
This is a follow-up issue of rust-lang/rustfmt#4845.
In summary: It was previously possible to compile rustfmt on wasm32-unknown-unknown. With the switch to rustfmt depending on
rustc-dev
instead of theap-*
crates from crates.io, this is no longer possible because therustc-dev
component is not available for wasm32-unknown-unknown.Is it feasible to make
rustc-dev
available for wasm32-unknown-unknown? Rustfmt only consumes some of the crates available throughrustc-dev
:Unless a component needs to be fully supported on a platform in order to be shipped with rustup, we could conditionally expose only those crates that actually compile on
wasm32-unknown-unknown
.I don't know what the best path forward is here. The overall motivation for compiling rustfmt to wasm32-unknown-unknown is to move the
dprint
plugin back from a process plugin to a wasm plugin that is properly sandboxed.The text was updated successfully, but these errors were encountered: