Skip to content

srtool is failing

The build is failing, here is the output from the CI (https://git.duniter.org/nodes/rust/duniter-v2s/-/jobs/140387):

   Compiling sp-timestamp v34.0.0 (https://github.com/duniter/duniter-polkadot-sdk?branch=duniter-substrate-v1.16.2#21d1f7a8)
   Compiling sp-block-builder v34.0.0 (https://github.com/duniter/duniter-polkadot-sdk?branch=duniter-substrate-v1.16.2#21d1f7a8)
   Compiling frame-support v38.0.0 (https://github.com/duniter/duniter-polkadot-sdk?branch=duniter-substrate-v1.16.2#21d1f7a8)
   Compiling sp-consensus-slots v0.40.1 (https://github.com/duniter/duniter-polkadot-sdk?branch=duniter-substrate-v1.16.2#21d1f7a8)
   Compiling wasm-opt v0.116.1
   Compiling substrate-wasm-builder v24.0.1 (https://github.com/duniter/duniter-polkadot-sdk?branch=duniter-substrate-v1.16.2#21d1f7a8)
   Compiling sp-consensus-babe v0.40.0 (https://github.com/duniter/duniter-polkadot-sdk?branch=duniter-substrate-v1.16.2#21d1f7a8)
   Compiling gdev-runtime v1.0.0 (/build/runtime/gdev)
error: failed to run custom build command for `gdev-runtime v1.0.0 (/build/runtime/gdev)`

Caused by:
  process didn't exit successfully: `/build/runtime/gdev/target/srtool/release/build/gdev-runtime-2aec44bb9da40861/build-script-build` (exit status: 1)
  --- stderr
  Cannot compile the WASM runtime: the `wasm32-unknown-unknown` target is not installed!
  You can install it with `rustup target add wasm32-unknown-unknown --toolchain 1.81.0-x86_64-unknown-linux-gnu` if you're using `rustup`.
warning: build failed, waiting for other jobs to finish...
section_end:1734731505:step_script
[0Ksection_start:1734731505:cleanup_file_variables
[0K[0K[36;1mCleaning up project directory and file based variables[0;m[0;m
section_end:1734731505:cleanup_file_variables
[0K[31;1mERROR: Job failed: exit code 1
[0;m

Reproduce

Create the following file Dockerfile.srtool in the root directory of duniter-v2s sources:

FROM paritytech/srtool:1.77.0-0.15.0

ENV CI_PROJECT_DIR=/build
ENV RUNTIME_DIR=runtime/gdev
ENV PACKAGE=gdev-runtime

COPY . .

RUN cp -R * /build/

RUN mkdir -p $CI_PROJECT_DIR/release
RUN echo "[toolchain]\nchannel = \"`curl -s https://raw.githubusercontent.com/paritytech/srtool/master/RUSTC_VERSION`\"\ncomponents = [ \"rust-std\", \"rust-src\" ]" > $CI_PROJECT_DIR/$RUNTIME_DIR/rust-toolchain.toml
RUN /srtool/build --app --json -cM

And then try to build it:

docker build -f Dockerfile.srtool .

The output:

130.2    Compiling frame-executive v28.0.0 (https://github.com/duniter/duniter-polkadot-sdk?branch=duniter-substrate-v1.14.0#bcc60f3e)
131.4    Compiling common-runtime v1.0.0 (/build/runtime/common)
166.8    Compiling wasm-opt v0.116.1
167.1    Compiling substrate-wasm-builder v17.0.0 (https://github.com/duniter/duniter-polkadot-sdk?branch=duniter-substrate-v1.14.0#bcc60f3e)
167.5    Compiling gdev-runtime v1.0.0 (/build/runtime/gdev)
174.2 error: failed to run custom build command for `gdev-runtime v1.0.0 (/build/runtime/gdev)`
174.2 
174.2 Caused by:
174.2   process didn't exit successfully: `/build/runtime/gdev/target/srtool/release/build/gdev-runtime-9a147ec59e4d0ff3/build-script-build` (exit status: 1)
174.2   --- stderr
174.2   Cannot compile the WASM runtime: the `wasm32-unknown-unknown` target is not installed!
174.2   You can install it with `rustup target add wasm32-unknown-unknown --toolchain 1.81.0-x86_64-unknown-linux-gnu` if you're using `rustup`.
------
Dockerfile.srtool:13
--------------------
  11 |     RUN mkdir -p $CI_PROJECT_DIR/release
  12 |     RUN echo "[toolchain]\nchannel = \"`curl -s https://raw.githubusercontent.com/paritytech/srtool/master/RUSTC_VERSION`\"\ncomponents = [ \"rust-std\", \"rust-src\" ]" > $CI_PROJECT_DIR/$RUNTIME_DIR/rust-toolchain.toml
  13 | >>> RUN /srtool/build --app --json -cM
--------------------
ERROR: failed to solve: process "/bin/sh -c /srtool/build --app --json -cM" did not complete successfully: exit code: 1
Edited by Cédric Moreau
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information