Skip to content

Cargo-miri failed to build with Rust WASM tool chain #2416

Closed as not planned
Closed as not planned
@yanliu18

Description

@yanliu18

Problem Description

I've encountered an error as follow when trying to run cargo miri test on a rust project.

error: failed to run custom build command for `node-template-runtime v4.0.0-dev (.../substrate-node-template/runtime)`

Caused by:
  process didn't exit successfully: `.../substrate-node-template/target/miri/debug/build/node-template-runtime-c93ff80443873606/build-script-build` (exit status: 1)
  --- stderr
  Rust WASM toolchain not installed, please install it!
Further error information:
  ------------------------------------------------------------
     Compiling wasm-test v1.0.0 (/tmp/.tmpZgt5DN)
  error[E0463]: can't find crate for `std`
    |
    = note: the `wasm32-unknown-unknown` target may not be installed
    = help: consider downloading the target with `rustup target add wasm32-unknown-unknown`
    = help: consider building the standard library from source with `cargo build -Zbuild-std`

  error: requires `sized` lang_item

  For more information about this error, try `rustc --explain E0463`.
  error: could not compile `wasm-test` due to 2 previous errors

However, the wasm tool chain is installed, following instructions from The Rust Toolchain, and the normal cargo build or cargo run/test can be finished successfully.

Steps to reproduce

git clone https://github.com/substrate-developer-hub/substrate-node-template.git
cargo clean
cargo miri test

Tool versions:
cargo 1.64.0-nightly (8827baaa7 2022-07-14)
rustc 1.64.0-nightly (f8588549c 2022-07-18)
miri 0.1.0 (416cddb 2022-07-17)
rustup 1.25.1 (bb60b1e89 2022-07-12)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-targetArea: concerns targets outside of what we currently supportC-enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions