Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

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

Closed
hadv opened this issue Sep 19, 2020 · 31 comments
Closed

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

hadv opened this issue Sep 19, 2020 · 31 comments
Labels
J2-unconfirmed Issue might be valid, but it’s not yet known.

Comments

@hadv
Copy link

hadv commented Sep 19, 2020

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
@github-actions github-actions bot added the J2-unconfirmed Issue might be valid, but it’s not yet known. label Sep 19, 2020
@2075
Copy link
Contributor

2075 commented Sep 19, 2020

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

@tengpeng
Copy link

Same issue. Confirmed.

@hadv
Copy link
Author

hadv commented Sep 20, 2020

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

@hadv
Copy link
Author

hadv commented Sep 20, 2020

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 👍

@tengpeng
Copy link

@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
Copy link
Author

hadv commented Sep 20, 2020

@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)

@dt665m
Copy link
Contributor

dt665m commented Sep 21, 2020

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.

@2075
Copy link
Contributor

2075 commented Sep 21, 2020

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!

@kragle502
Copy link

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

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

@Alexader
Copy link

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

@jzhe886
Copy link

jzhe886 commented Sep 22, 2020

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

@bkchr
Copy link
Member

bkchr commented Sep 22, 2020

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

@bkchr bkchr closed this as completed Sep 22, 2020
@sebastiendan
Copy link

sebastiendan commented Sep 22, 2020

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.

@hadv
Copy link
Author

hadv commented Sep 23, 2020

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 :(

@bkchr
Copy link
Member

bkchr commented Sep 23, 2020

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

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

@hadv
Copy link
Author

hadv commented Sep 24, 2020

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)

@SarahKay99
Copy link

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?

@2075
Copy link
Contributor

2075 commented Oct 15, 2020

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

@SarahKay99
Copy link

SarahKay99 commented Oct 15, 2020

@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?

@TomaszWaszczyk
Copy link

TomaszWaszczyk commented Dec 21, 2020

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? ;-)

@danforbes
Copy link
Contributor

@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?

@TomaszWaszczyk
Copy link

#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!

@tkimmm
Copy link

tkimmm commented Jan 1, 2021

Just some more feedback but seems to have already been identified.

Following the instructions at https://substrate.dev/docs/en/tutorials/create-your-first-substrate-chain/setup

Compilation build error as reported on compile step

Compiling sp-externalities v0.8.0

Circumvented make build by running cargo +nightly-2020-10-05-x86_64-apple-darwin build --release

EDIT - Just saw the vscode dev container and realised this method won't work for the postStartCommand hook but will run for Mac locally

% rustup show 130 ↵
Default host: x86_64-apple-darwin
rustup home: /Users/tkim/.rustup

installed toolchains

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

installed targets for active toolchain

arm-unknown-linux-gnueabihf
arm-unknown-linux-musleabihf
armv7-unknown-linux-gnueabihf
armv7-unknown-linux-musleabihf
thumbv6m-none-eabi
thumbv7em-none-eabi
thumbv7em-none-eabihf
thumbv7m-none-eabi
wasm32-unknown-unknown
x86_64-apple-darwin

active toolchain

stable-x86_64-apple-darwin (default)
rustc 1.49.0 (e1884a8e3 2020-12-29)

@TomaszWaszczyk
Copy link

It is worth to try to build the node via Makefile like:

make build

@infrachris
Copy link

infrachris commented Jun 20, 2021

#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!

Could you please post more detail on your solution? I'm having this same issue on v0.9.5. It appears this issue may re-occur from time to time depending present polkadot release and rust and clarity on resolution when it occurs would help the community. Your post mentions "I decided to ask and changed like @danforbes suggests", however you don't share the actual solution you used, or what @danforbes actually recommended, to make matters worse there are no posts in this thread by @danforbes that I can see.

@TomaszWaszczyk
Copy link

Maybe try to execute the script before trying to build.

@infrachris
Copy link

Below is what ended up working for me, potentially all that may be required is the last command of the four, I had however done the first three by the time I tried the fourth.

rustup default nightly-x86_64-unknown-linux-gnu
rustup update
rustup update nightly
rustup target add wasm32-unknown-unknown --toolchain nightly

@a-nickol
Copy link

a-nickol commented Sep 3, 2021

For me
rustup target add wasm32-unknown-unknown --toolchain nightly
instead of
rustup target add wasm32-unknown-unknown
did it.

Nightly build is not working at the moment for the tutorial.

@FazeelUsmani
Copy link

Thanks a lot! @a-nickol it's working for me now.

@TomaszWaszczyk
Copy link

Also rustup update can be helpful when after some days, you will have issues with compiling once more time.

@kevin-valerio
Copy link

For me rustup target add wasm32-unknown-unknown --toolchain nightly instead of rustup target add wasm32-unknown-unknown did it.

Nightly build is not working at the moment for the tutorial.

The opposite worked for me ... rustup target add wasm32-unknown-unknown instead of rustup target add wasm32-unknown-unknown --toolchain nightly

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
J2-unconfirmed Issue might be valid, but it’s not yet known.
Projects
None yet
Development

No branches or pull requests