Skip to content

WASI compilation? #6518

Closed as not planned
Closed as not planned
@Timmmm

Description

@Timmmm

I'm trying to compile this for wasm32-wasip2 and not getting very far. Do you guys know if this is possible? I got as far as:

rustup toolchain install nightly
rustup +nightly target add wasm32-wasip2
rustup component add rust-src rustc-dev llvm-tools-preview

git clone https://github.com/rust-lang/rustfmt.git
cd rustfmt

rustup override set nightly

cargo build --release --target wasm32-wasip2

However the first error is:

   Compiling rustfmt-nightly v1.8.0 (C:\workspace\rustfmt)
error[E0463]: can't find crate for `rustc_ast`
 --> src\lib.rs:8:1
  |
8 | extern crate rustc_ast;
  | ^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
  |
  = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

(I have already tried the suggestion.)

Seems like @alexcrichton got this to work a long time ago - see #4358.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions