Skip to content

Can rustc-dev be made available for the wasm32-unknown-unknown target? #86122

Open
@thomaseizinger

Description

@thomaseizinger

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-wasmTarget: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions