paritytech / srtool

A fork of chevdor's srtool
MIT License
64 stars 18 forks source link

Cannot compile the WASM runtime: no standard library sources found! #82

Open brenzi opened 4 months ago

brenzi commented 4 months ago

I'm trying to build system chains (using srtool-cli):

git clone https://github.com/encointer/runtimes.git
cd runtimes
git checkout bkontur/bko-bump-to-1.7
srtool build -p encointer-kusama-runtime --runtime-dir system-parachains/encointer/ --root

this results in the following error (here for asset-hub-kusama`)

Found 1.75.0, we will be using docker.io/paritytech/srtool:1.75.0 for the build
🧰 Substrate Runtime Toolbox - srtool v0.14.0 🧰
              - by Chevdor -
info: using existing install for '1.75.0-x86_64-unknown-linux-gnu'
info: override toolchain for '/build' set to '1.75.0-x86_64-unknown-linux-gnu'

  1.75.0-x86_64-unknown-linux-gnu unchanged - rustc 1.75.0 (82e1608df 2023-12-21)

🏗  Building asset-hub-kusama-runtime as release using rustc 1.75.0 (82e1608df 2023-12-21)
⏳ That can take a little while, be patient... subsequent builds may be faster.
   Since you have to wait a little, you may want to learn more about Substrate runtimes:
   https://docs.substrate.io/learn/architecture/

...

error: failed to run custom build command for `asset-hub-kusama-runtime v1.0.0 (/build/system-parachains/asset-hubs/asset-hub-kusama)`

Caused by:
  process didn't exit successfully: `/build/system-parachains/asset-hubs/asset-hub-kusama/target/srtool/release/build/asset-hub-kusama-runtime-6266e5ba4baf865f/build-script-build` (exit status: 1)
  --- stderr
  Cannot compile the WASM runtime: no standard library sources found!
  You can install them with `rustup component add rust-src` if you're using `rustup`.
warning: build failed, waiting for other jobs to finish...
brenzi commented 3 months ago

same issue on main now on https://github.com/polkadot-fellows/runtimes

seadanda commented 3 months ago

This is an issue with srtool-cli, I have made a workaround for it here: https://github.com/chevdor/srtool-cli/pull/34

I've also just seen that there is also a proper fix upstream in srtool.

brenzi commented 3 months ago

Thanks @seadanda, this worked for me:

srtool build -p encointer-kusama-runtime --runtime-dir system-parachains/encointer/ --root --no-wasm-std