diff --git a/.gitlab-ci/container/alpine/x86_64_build.sh b/.gitlab-ci/container/alpine/x86_64_build.sh index 4b252c374a1..6558602fe7a 100644 --- a/.gitlab-ci/container/alpine/x86_64_build.sh +++ b/.gitlab-ci/container/alpine/x86_64_build.sh @@ -66,7 +66,7 @@ pip3 install --break-system-packages sphinx===8.2.3 hawkmoth===0.19.0 . .gitlab-ci/container/install-meson.sh -. .gitlab-ci/container/build-rust.sh +. .gitlab-ci/container/build-rust.sh build EXTRA_MESON_ARGS='--prefix=/usr' \ . .gitlab-ci/container/build-wayland.sh diff --git a/.gitlab-ci/container/build-rust.sh b/.gitlab-ci/container/build-rust.sh index 137e7f48d7b..6ca41ca1c90 100644 --- a/.gitlab-ci/container/build-rust.sh +++ b/.gitlab-ci/container/build-rust.sh @@ -14,15 +14,21 @@ section_start rust "Building Rust toolchain" # This version number should match what we require in meson.build so we catch # build issues from patches relying on new features in newer Rust versions. -# If we need to bump this, we should also bump the version in meson.build. -RUST_VERSION=1.82.0 +# Keep this is sync with the `rustc.version()` check in meson.build, and with +# the `rustup default` line in .gitlab-ci/meson/build.sh +MINIMUM_SUPPORTED_RUST_VERSION=1.82.0 + +# This version number can be bumped freely, to benefit from the latest +# diagnostics in CI `build-only` jobs, and for building external CI +# components. +LATEST_RUST_VERSION=1.90.0 # For rust in Mesa, we use rustup to install. This lets us pick an arbitrary # version of the compiler, rather than whatever the container's Debian comes # with. curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \ --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ - --default-toolchain $RUST_VERSION \ + --default-toolchain $LATEST_RUST_VERSION \ --profile minimal \ --component clippy,rustfmt \ -y @@ -31,6 +37,11 @@ curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \ # shellcheck disable=SC1091 . "$HOME/.cargo/env" +if [ "$1" = "build" ] +then + rustup toolchain install --profile minimal --component clippy,rustfmt $MINIMUM_SUPPORTED_RUST_VERSION +fi + # Set up a config script for cross compiling -- cargo needs your system cc for # linking in cross builds, but doesn't know what you want to use for system cc. cat > "$HOME/.cargo/config" <