Description
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 the ap-*
crates from crates.io, this is no longer possible because the rustc-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 through rustc-dev
:
extern crate rustc_ast;
extern crate rustc_ast_pretty;
extern crate rustc_data_structures;
extern crate rustc_errors;
extern crate rustc_expand;
extern crate rustc_parse;
extern crate rustc_session;
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.