From 4c910d2fc62654b5545c261e165413f76e1489d0 Mon Sep 17 00:00:00 2001 From: Tom French Date: Thu, 27 Feb 2025 00:54:08 +0000 Subject: [PATCH 1/3] chore: complete updates to build-images from msrv bump --- bootstrap.sh | 7 ++++--- build-images/src/Dockerfile | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index 294b4db3ea89..c398d99fb23d 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -48,11 +48,12 @@ function check_toolchains { exit 1 fi # Check rust version. - if ! rustup show | grep "1.75" > /dev/null; then + local rust_version="1.85.0" + if ! rustup show | grep $rust_version > /dev/null; then encourage_dev_container - echo "Rust version 1.75 not installed." + echo "Rust version $rust_version 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 # Check wasi-sdk version. 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. From 77fdb4af361b5c4d9b2e12b4219e539e8360d569 Mon Sep 17 00:00:00 2001 From: Tom French Date: Thu, 27 Feb 2025 10:37:26 +0000 Subject: [PATCH 2/3] chore: read rust version from toolchain file --- bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index c398d99fb23d..a94cc478525d 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -48,7 +48,7 @@ function check_toolchains { exit 1 fi # Check rust version. - local rust_version="1.85.0" + local rust_version=$(yq '.toolchain.channel' ./noir/noir-repo/rust-toolchain.toml) if ! rustup show | grep $rust_version > /dev/null; then encourage_dev_container echo "Rust version $rust_version not installed." From 8262e8d7b5f35c6b19f0caf436a9ebc99c098079 Mon Sep 17 00:00:00 2001 From: Tom French Date: Fri, 28 Feb 2025 13:35:13 +0000 Subject: [PATCH 3/3] chore: warn on missing rust version --- bootstrap.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index a94cc478525d..08acb508e2da 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -47,15 +47,20 @@ function check_toolchains { echo "Installation: sudo apt install clang-16" exit 1 fi - # Check rust version. + # Check rustup installed. local rust_version=$(yq '.toolchain.channel' ./noir/noir-repo/rust-toolchain.toml) - if ! rustup show | grep $rust_version > /dev/null; then + if ! command -v rustup > /dev/null; then encourage_dev_container - echo "Rust version $rust_version not installed." + echo "Rustup not installed." echo "Installation:" 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