2

I know that similar questions have been asked before but I am not able to resolve this issue with my setup. I am trying to run a basilisk node but keep running into the errors below.

The error log:

error: failed to run custom build command for `basilisk-runtime v75.0.0 (/Users/james/Documents/projects/Basilisk-node/runtime/basilisk)`

Caused by:
  process didn't exit successfully: `/Users/james/Documents/projects/Basilisk-node/target/release/build/basilisk-runtime-70afc7cb3e70cae3/build-script-build` (exit status: 1)
  --- stderr
  Rust WASM toolchain not installed, please install it!

  Further error information:
  ------------------------------------------------------------
     Compiling wasm-test v1.0.0 (/var/folders/0s/45y2fdk967b8qxthgx6038k00000gn/T/.tmpJBpfH5)
  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`

  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
  warning: build failed, waiting for other jobs to finish...
  error: cannot find macro `println` in this scope
   --> src/main.rs:3:5
    |
  3 |                 println!("{}", env!("RUSTC_VERSION"));
    |                 ^^^^^^^

  error: could not compile `wasm-test` due to 3 previous errors
  ------------------------------------------------------------

make: *** [build] Error 101

Current setup:

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


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

stable-x86_64-apple-darwin (default) nightly-2022-02-19-x86_64-apple-darwin nightly-2022-06-19-x86_64-apple-darwin nightly-x86_64-apple-darwin
1.51.0-x86_64-apple-darwin

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

wasm32-unknown-unknown x86_64-apple-darwin

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

nightly-2022-06-19-x86_64-apple-darwin (overridden by '/Users/james/Documents/projects/Basilisk-node/rust-toolchain') rustc 1.63.0-nightly (21e9336fe 2022-06-18)

What I did step by step:

  1. To ensure my installation of rust is clean, I uninstall it with $ rustup self uninstall

  2. I install substrate and the rust tools via $ curl https://getsubstrate.io -sSf | bash -s -- --fast as per the instructions in https://github.com/galacticcouncil/Basilisk-node

  3. I run make build on the Basilisk node and it complains with the error above. I note that it says wasm32-unknown-unknown is not installed so I install it with rustup target add wasm32-unknown-unknown

  4. make build still errors with the above error

New rustup configuration:

$ rustup show

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

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

stable-x86_64-apple-darwin (default)
nightly-2022-06-19-x86_64-apple-darwin
nightly-x86_64-apple-darwin

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

wasm32-unknown-unknown
x86_64-apple-darwin

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

nightly-2022-06-19-x86_64-apple-darwin (overridden by '/Users/jamessangalli/Documents/projects/Basilisk-node/rust-toolchain')
rustc 1.63.0-nightly (21e9336fe 2022-06-18)
2
  • 1
    Is it possible you have installed rust twice? In any case, the solution is likely to clean up your machine, and re-install rust. Otherwise, please provide more information about how you have set up your computer, and what steps you are following.
    – Shawn Tabrizi
    Sep 25, 2022 at 23:29
  • I have reinstalled it but the issue persists. I am able to build substrate on Ubuntu and an m1 mac but not the x86 edition.
    – James
    Oct 11, 2022 at 2:16

3 Answers 3

3

The init script specifically mentions to install wasm for the nightly toolchain. So you could try:

rustup target add wasm32-unknown-unknown --toolchain nightly
1
  • Hi Oliver, I re-followed the steps above and then tried your command, I get back the following and the original error remains: info: component 'rust-std' for target 'wasm32-unknown-unknown' is up to date
    – James
    Sep 28, 2022 at 3:47
1

rustup target add wasm32-unknown-unknown

try and enter this command worked for me

-1

When I have issues with building Substrate project, my first take is: rustup update.

In most cases, the command helps.

2
  • 1
    Well this updates your toolchains, it does not add new toolchains or components within them, so in the case you don't yet have the target wasm-unknown-unknown toolchain stuff yet, it won't add it. But one its there it will be included in updates.
    – Nuke
    Sep 26, 2022 at 23:25
  • 1
    This simply isn't the correct answer to the question asked, no need to feel good or bad for anyone. Sep 27, 2022 at 14:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.