Substrate: build error: Rust WASM toolchain not installed, please install it!

Created on 19 Sep 2020  路  22Comments  路  Source: paritytech/substrate

Hi,

I build substrate by following this document https://substrate.dev/docs/en/tutorials/create-your-first-substrate-chain/setup
but I always encounter below error, running cargo +nightly build --release did not help, neither!

My Environment:

  • OS: MacOSX
  • cargo 1.46.0 (149022b1d 2020-07-17)
  • cargo 1.48.0-nightly (8777a6b1e 2020-09-15)
  • rustc 1.46.0 (04488afe3 2020-08-24)
  • rustc 1.48.0-nightly (bbc677480 2020-09-18)

What can I do to build the substrate? Thank you!

error: failed to run custom build command for `node-template-runtime v2.0.0-rc6 (/Users/hadv/substrate-node-template/runtime)`

Caused by:
  process didn't exit successfully: `/Users/hadv/substrate-node-template/target/release/build/node-template-runtime-2d8c1667f205182e/build-script-build` (exit code: 1)
  --- stderr
     Compiling wasm-build-runner-impl v1.0.0 (/Users/hadv/substrate-node-template/target/release/wbuild-runner/node-template-runtime11470990835901387623)
      Finished release [optimized] target(s) in 0.30s
       Running `/Users/hadv/substrate-node-template/target/release/wbuild-runner/node-template-runtime11470990835901387623/target/x86_64-apple-darwin/release/wasm-build-runner-impl`
  Rust WASM toolchain not installed, please install it!
warning: build failed, waiting for other jobs to finish...
error: build failed
Z0-unconfirmed

Most helpful comment

Sorry, it took them 3 prs to fix it: https://github.com/rust-lang/rust/issues/76698

I assume it should be fixed with the nightly from tomorrow.

All 22 comments

what os are you using? we are running macos and had the same, only solution was downgrading like this:

test

support bug fixing by keeping the current version info at hand before downgrading:

cargo --version
cargo +nightly --version
rustc --version
rustc +nightly --version

downgrade

install known working versions:

rustup install 1.45.1
rustup toolchain default 1.45.1-x86_64-apple-darwin
rustup toolchain install nightly-2020-08-19-x86_64-apple-darwin
rustup target add wasm32-unknown-unknown --toolchain nightly-2020-08-19-x86_64-apple-darwin
rustup toolchain list

Same issue. Confirmed.

Thank you @2075; I updated comment to add more information about environment.

downgrade

install known working versions:

rustup install 1.45.1
rustup toolchain default 1.45.1-x86_64-apple-darwin
rustup toolchain install nightly-2020-08-19-x86_64-apple-darwin
rustup target add wasm32-unknown-unknown --toolchain nightly-2020-08-19-x86_64-apple-darwin
rustup toolchain list

Yes, if I downgrade to rustc 1.45.1 then it can be built successfully without any error 馃憤

@hadv I have downgraded to 1.45.1 but I get the same error.

rustup show
Default host: x86_64-apple-darwin
rustup home:  /Users/pt/.rustup

installed toolchains
--------------------

stable-x86_64-apple-darwin
nightly-2018-08-27-x86_64-apple-darwin
nightly-2020-06-01-x86_64-apple-darwin
nightly-2020-07-27-x86_64-apple-darwin
nightly-2020-08-19-x86_64-apple-darwin
nightly-x86_64-apple-darwin
1.41.0-x86_64-apple-darwin
1.45.1-x86_64-apple-darwin (default)

active toolchain
----------------

1.45.1-x86_64-apple-darwin (directory override for '/Users/pt/Projects/substrate-node-template')
rustc 1.45.1 (c367798cf 2020-07-26)

@hadv I have downgraded to 1.45.1 but I get the same error.

it might not related but I run rustup self uninstall and then install rust again. Don't know why your tool chain have this (directory override for '/Users/pt/Projects/substrate-node-template')

Default host: x86_64-apple-darwin
rustup home:  /Users/hadv/.rustup

installed toolchains
--------------------

stable-x86_64-apple-darwin
nightly-2020-08-19-x86_64-apple-darwin
1.45.1-x86_64-apple-darwin (default)

active toolchain
----------------

1.45.1-x86_64-apple-darwin (default)
rustc 1.45.1 (c367798cf 2020-07-26)

My colleague also ran into this error spontaneously today (on his machine). Things were building fine just a few commands ago and suddenly this error showed up and wouldn't go away. He even tried completely re-installing rust. We are scratching our heads pretty hard on this one haha.

if you leave some more info here, like your currently installed versions it will help to identify possible issues. it seems like there are upstream issues when updating your env to latest/nightly. the above mentioned downgrade works for some, give it a shot!

I ran into the same problem, and my workaround is:

rustup default nightly-2020-08-20-x86_64-apple-darwin

I ran into the same problem, and my workaround is:

rustup default nightly-2020-08-20-x86_64-apple-darwin

I am working on wsl2 of windows, it worked for me to downgrade to 1.45.1 with the command:

rustup default 1.45.1-x86_64-unknown-linux-gnu

I ran into the same problem, and my workaround is:

rustup default nightly-2020-08-20-x86_64-apple-darwin

I am working on wsl2 of windows, it worked for me to downgrade to 1.45.1 with the command:

rustup default 1.45.1-x86_64-unknown-linux-gnu

LGTM

I assume we can close this? Sadly this was an upstream bug in Rust.

I assume we can close this? Sadly this was an upstream bug in Rust.

@bkchr Has it been fixed on Rust side? I tried downgrading and using the latest nightly build, without success.

I assume we can close this? Sadly this was an upstream bug in Rust.

@bkchr Do we have any work-around solution? It's very strange that I can build when downgrade to 1.45.1 but all my colleges cannot :(

Sorry, it took them 3 prs to fix it: https://github.com/rust-lang/rust/issues/76698

I assume it should be fixed with the nightly from tomorrow.

Sorry, it took them 3 prs to fix it: rust-lang/rust#76698

I assume it should be fixed with the nightly from tomorrow.

thanks @bkchr I confirm that I can build with version rustc 1.48.0-nightly (8b4085359 2020-09-23)

I'm on Windows @2075 , not sure if I should use the apple-darwin commands, also not sure the dates for Windows toolchain releases are the same. (i.e. 2020-08-19 didn't work for pc-windows-msvc)

Which commands should Windows users do?

for installation you can leave away the cpu / os part. could you try the following:

rustup install 1.45.1
rustup default 1.45.1
rustup toolchain install nightly-2020-08-19
rustup target add wasm32-unknown-unknown --toolchain nightly-2020-08-19
rustup toolchain list

hth

@2075 Still got the error, "WASM toolchain not installed, please install it!"

rustup toolchain list

gives me

stable-x86_64-pc-windows-msvc
nightly-2020-08-19-x86_64-apple-darwin
nightly-2020-08-19-x86_64-pc-windows-msvc
nightly-2020-08-23-x86_64-pc-windows-msvc
nightly-x86_64-pc-windows-msvc
1.45.1-x86_64-pc-windows-msvc (default)

I did a lot of downloads trying to fix the errors I get from cargo build. How can I manage my rust toolchains?

I try to build kitchen node using:

twaszczyk@ktwtomwasnb:~/workspaces/recipes/nodes/kitchen-node$ rustup --version
rustup 1.23.1 (3df2264a9 2020-11-30)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.45.1 (c367798cf 2020-07-26)`

but got:

image

I have set toolchain like:

twaszczyk@ktwtomwasnb:~/workspaces/recipes/nodes/kitchen-node$ rustup toolchain list
stable-x86_64-unknown-linux-gnu
nightly-2020-08-19-x86_64-unknown-linux-gnu
nightly-2020-08-23-x86_64-unknown-linux-gnu
nightly-2020-10-05-x86_64-unknown-linux-gnu
nightly-2020-10-06-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu
1.45.1-x86_64-unknown-linux-gnu (default)

There is any place where is written what exactly versions I need to build the node(including WASM toolchain which IFAIK is also needed)? Additional info:

twaszczyk@ktwtomwasnb:~/workspaces/recipes/nodes/kitchen-node$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/twaszczyk/.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu
nightly-2020-08-19-x86_64-unknown-linux-gnu
nightly-2020-08-23-x86_64-unknown-linux-gnu
nightly-2020-10-05-x86_64-unknown-linux-gnu
nightly-2020-10-06-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu
1.45.1-x86_64-unknown-linux-gnu (default)

active toolchain
----------------

1.45.1-x86_64-unknown-linux-gnu (default)
rustc 1.45.1 (c367798cf 2020-07-26)

Maybe @danforbes will help? ;-)

@TomaszWaszczyk can you try running these commands for good measure and let me know if it helps?

rustup update nightly-2020-08-23
rustup target add wasm32-unknown-unknown --toolchain nightly-2020-08-23

In particular, I think it may be the second command you need to run. However, I am a bit confused...shouldn't you be using nightly-2020-10-05 since Recipes is on Substrate v2.0.0 now? Where did you see that you're supposed to use nightly-2020-08-23?

#SOLVED

After juggling of versions of toolchain I decided to ask and changed like @danforbes suggests:

twaszczyk@ktwtomwasnb:~$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/twaszczyk/.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu
nightly-2020-08-19-x86_64-unknown-linux-gnu
nightly-2020-08-23-x86_64-unknown-linux-gnu (default)
nightly-2020-10-05-x86_64-unknown-linux-gnu
nightly-2020-10-06-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu
1.45.1-x86_64-unknown-linux-gnu

installed targets for active toolchain
--------------------------------------

wasm32-unknown-unknown
x86_64-unknown-linux-gnu

active toolchain
----------------

**nightly-2020-08-23-x86_64-unknown-linux-gnu (default)
rustc 1.47.0-nightly (663d2f5cd 2020-08-22)**

Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tomaka picture tomaka  路  4Comments

gavofyork picture gavofyork  路  4Comments

pepyakin picture pepyakin  路  5Comments

tomaka picture tomaka  路  5Comments

jiangfuyao picture jiangfuyao  路  3Comments