diff --git a/bootstrap.sh b/bootstrap.sh index 294b4db3ea89..08acb508e2da 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -47,14 +47,20 @@ function check_toolchains { echo "Installation: sudo apt install clang-16" exit 1 fi - # Check rust version. - if ! rustup show | grep "1.75" > /dev/null; then + # Check rustup installed. + local rust_version=$(yq '.toolchain.channel' ./noir/noir-repo/rust-toolchain.toml) + if ! command -v rustup > /dev/null; then encourage_dev_container - echo "Rust version 1.75 not installed." + echo "Rustup not installed." echo "Installation:" - echo " curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.85.0" + echo " curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain $rust_version" exit 1 fi + if ! rustup show | grep $rust_version > /dev/null; then + # Cargo will download necessary version of rust at runtime but warn to alert that an update to the build-image + # is desirable. + echo -e "${bold}${yellow}WARN: Rust ${rust_version} is not installed. Performance will be degraded.${reset}" + fi # Check wasi-sdk version. if ! cat /opt/wasi-sdk/VERSION 2> /dev/null | grep 22.0 > /dev/null; then encourage_dev_container diff --git a/build-images/src/Dockerfile b/build-images/src/Dockerfile index 51be3294b848..33ed71f032c1 100644 --- a/build-images/src/Dockerfile +++ b/build-images/src/Dockerfile @@ -150,7 +150,7 @@ ENV RUSTUP_HOME=/opt/rust/rustup ENV CARGO_HOME=/opt/rust/cargo ENV PATH="/opt/rust/cargo/bin:$PATH" RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.85.0 && \ - rustup target add wasm32-unknown-unknown wasm32-wasi aarch64-apple-darwin && \ + rustup target add wasm32-unknown-unknown wasm32-wasip1 aarch64-apple-darwin && \ chmod -R a+w /opt/rust # Install corepack and yarn.