From d6ab0717d518ef42f2bbd206f3f6c69f8ebed13b Mon Sep 17 00:00:00 2001 From: "Mukesh Kumar Chaurasiya (IBM)" Date: Fri, 23 Oct 2026 15:19:13 +0530 Subject: [PATCH] rust: Use pinned stable toolchain instead of nightly The image was installing the floating nightly toolchain, which makes builds non-reproducible and can break whenever nightly changes. Install the stable 1.99.1 release instead, pinned via RUST_VERSION so it is a one line change to bump. Pass --default-toolchain none to the rustup installer so it does not also install a floating stable toolchain next to the pinned one. Signed-off-by: Mukesh Kumar Chaurasiya (IBM) --- build/ubuntu/rust-install.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/build/ubuntu/rust-install.sh b/build/ubuntu/rust-install.sh index 76a9ed5..ab6369a 100755 --- a/build/ubuntu/rust-install.sh +++ b/build/ubuntu/rust-install.sh @@ -8,6 +8,9 @@ set -e # Extract major version major="${VERSION_ID%%.*}" +# Latest stable Rust release +RUST_VERSION=1.99.1 + # Only install Rust for Ubuntu 24.04 and later if [[ "$major" -ge 24 ]]; then echo "Installing Rust toolchain for Ubuntu $VERSION_ID..." @@ -19,15 +22,15 @@ if [[ "$major" -ge 24 ]]; then # Install rustup curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \ - sh -s -- -y --no-modify-path + sh -s -- -y --no-modify-path --default-toolchain none # Source cargo environment . "$CARGO_HOME/env" - # Install nightly toolchain with rust-src component - rustup toolchain install nightly \ - && rustup default nightly \ - && rustup component add rust-src --toolchain nightly \ + # Install stable toolchain with rust-src component + rustup toolchain install "$RUST_VERSION" \ + && rustup default "$RUST_VERSION" \ + && rustup component add rust-src --toolchain "$RUST_VERSION" \ && cargo install --locked bindgen-cli # Verify installation