diff --git a/.gitlab-ci/container/build-rust.sh b/.gitlab-ci/container/build-rust.sh index 7d7856011fa..ca7818cfdaa 100644 --- a/.gitlab-ci/container/build-rust.sh +++ b/.gitlab-ci/container/build-rust.sh @@ -12,12 +12,7 @@ section_start rust "Building Rust toolchain" # DEBIAN_BUILD_BASE_TAG # DEBIAN_TEST_BASE_TAG -# 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. -# Keep this is sync with the `rustc.version()` check in meson.build, and with -# the `rustup default` line in .gitlab-ci/meson/build.sh and the `msrv` in -# clippy.toml -MINIMUM_SUPPORTED_RUST_VERSION=1.82.0 +MINIMUM_SUPPORTED_RUST_VERSION=$(python3 -c 'import tomllib; print(tomllib.load(open("'"$CI_PROJECT_DIR"'/clippy.toml", "rb"))["msrv"])') # This version number can be bumped freely, to benefit from the latest # diagnostics in CI `build-only` jobs, and for building external CI @@ -40,7 +35,7 @@ curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \ if [ "$1" = "build" ] then - rustup toolchain install --profile minimal --component clippy,rustfmt $MINIMUM_SUPPORTED_RUST_VERSION + rustup toolchain install --profile minimal --component clippy,rustfmt "$MINIMUM_SUPPORTED_RUST_VERSION" fi find "$HOME"/.rustup/toolchains/*/lib -type f -name "*.so" -exec strip {} \; diff --git a/.gitlab-ci/meson/build.sh b/.gitlab-ci/meson/build.sh index 0746d0e72b9..9abfa5c013c 100755 --- a/.gitlab-ci/meson/build.sh +++ b/.gitlab-ci/meson/build.sh @@ -43,10 +43,7 @@ fi # Android manages the rust toolchain differently, ignore that case if [ "$CI_JOB_STAGE" = "build-for-tests" ] && [[ "$CI_JOB_NAME" != *android* ]]; then - # Keep this in sync with the `rustc.version()` check in meson.build, and - # MINIMUM_SUPPORTED_RUST_VERSION in .gitlab-ci/container/build-rust.sh and the - # `msrv` in clippy.toml - rustup default 1.82.0 + rustup default "$(python3 -c 'import tomllib; print(tomllib.load(open("'"$CI_PROJECT_DIR"'/clippy.toml", "rb"))["msrv"])')" fi # cross-xfail-$CROSS, if it exists, contains a list of tests that are expected diff --git a/clippy.toml b/clippy.toml index 949a41a450d..66e012058f5 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1,4 +1,2 @@ -# Keep this in sync with the `rustc.version()` check in meson.build, the -# MINIMUM_SUPPORTED_RUST_VERSION in .gitlab-ci/container/build-rust.sh, the -# `rustup default` line in .gitlab-ci/meson/build.sh +# Keep this in sync with the `rustc.version()` check in meson.build msrv = "1.82.0" diff --git a/meson.build b/meson.build index 63370e97d8c..9b5d53c3adb 100644 --- a/meson.build +++ b/meson.build @@ -788,9 +788,7 @@ if with_gallium_rusticl or with_nouveau_vk or with_tools.contains('etnaviv') or rustc = meson.get_compiler('rust') rust = import('rust') - # Keep this in sync with the MINIMUM_SUPPORTED_RUST_VERSION in - # .gitlab-ci/container/build-rust.sh and the `rustup default` line in - # .gitlab-ci/meson/build.sh and the `msrv` in clippy.toml + # Keep this in sync with the `msrv` in clippy.toml if rustc.version().version_compare('< 1.82') error('Mesa requires Rust 1.82.0 or newer') endif