ci: read the MSRV from clippy.toml to avoid having too many copies to keep in sync
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
This commit is contained in:
@@ -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 {} \;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user