ci: use MSRV for build-for-tests jobs and recent version in build-only jobs and CI components

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37414>
This commit is contained in:
Eric Engestrom 2025-09-16 16:39:09 +02:00 committed by Marge Bot
parent a8f49aa5f2
commit be825ee11f
10 changed files with 33 additions and 12 deletions

View file

@ -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/install-meson.sh
. .gitlab-ci/container/build-rust.sh . .gitlab-ci/container/build-rust.sh build
EXTRA_MESON_ARGS='--prefix=/usr' \ EXTRA_MESON_ARGS='--prefix=/usr' \
. .gitlab-ci/container/build-wayland.sh . .gitlab-ci/container/build-wayland.sh

View file

@ -14,15 +14,21 @@ section_start rust "Building Rust toolchain"
# This version number should match what we require in meson.build so we catch # 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. # 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. # Keep this is sync with the `rustc.version()` check in meson.build, and with
RUST_VERSION=1.82.0 # 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 # 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 # version of the compiler, rather than whatever the container's Debian comes
# with. # with.
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \ curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
--proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \
--default-toolchain $RUST_VERSION \ --default-toolchain $LATEST_RUST_VERSION \
--profile minimal \ --profile minimal \
--component clippy,rustfmt \ --component clippy,rustfmt \
-y -y
@ -31,6 +37,11 @@ curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
# shellcheck disable=SC1091 # shellcheck disable=SC1091
. "$HOME/.cargo/env" . "$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 # 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. # linking in cross builds, but doesn't know what you want to use for system cc.
cat > "$HOME/.cargo/config" <<EOF cat > "$HOME/.cargo/config" <<EOF

View file

@ -115,7 +115,7 @@ arch=armhf
. .gitlab-ci/container/build-libclc.sh . .gitlab-ci/container/build-libclc.sh
. .gitlab-ci/container/build-rust.sh . .gitlab-ci/container/build-rust.sh build
. .gitlab-ci/container/build-bindgen.sh . .gitlab-ci/container/build-bindgen.sh

View file

@ -223,7 +223,7 @@ section_end debian_setup
############### Install Rust toolchain ############### Install Rust toolchain
. .gitlab-ci/container/build-rust.sh . .gitlab-ci/container/build-rust.sh test
############### Build Crosvm ############### Build Crosvm

View file

@ -103,7 +103,7 @@ pip3 install --break-system-packages "ci-fairy[s3] @ git+https://gitlab.freedesk
. .gitlab-ci/container/install-meson.sh . .gitlab-ci/container/install-meson.sh
. .gitlab-ci/container/build-rust.sh . .gitlab-ci/container/build-rust.sh build
############### Uninstall ephemeral packages ############### Uninstall ephemeral packages

View file

@ -84,7 +84,7 @@ DEBIAN_ARCH=amd64 \
export ANDROID_NDK_HOME=/$ndk export ANDROID_NDK_HOME=/$ndk
export RUST_TARGET=x86_64-linux-android export RUST_TARGET=x86_64-linux-android
. .gitlab-ci/container/build-rust.sh . .gitlab-ci/container/build-rust.sh test
. .gitlab-ci/container/build-deqp-runner.sh . .gitlab-ci/container/build-deqp-runner.sh
# Properly uninstall rustup including cargo and init scripts on shells # Properly uninstall rustup including cargo and init scripts on shells

View file

@ -103,7 +103,7 @@ rm -rf $XORGMACROS_VERSION
. .gitlab-ci/container/install-meson.sh . .gitlab-ci/container/install-meson.sh
. .gitlab-ci/container/build-rust.sh . .gitlab-ci/container/build-rust.sh build
. .gitlab-ci/container/build-bindgen.sh . .gitlab-ci/container/build-bindgen.sh

View file

@ -19,11 +19,11 @@ include:
- .gitlab-ci/conditional-build-image-tags.yml - .gitlab-ci/conditional-build-image-tags.yml
variables: variables:
DEBIAN_BUILD_BASE_TAG: "20250901-trixie" DEBIAN_BUILD_BASE_TAG: "20250917-two-rust"
DEBIAN_BUILD_TAG: "20250825-finds3" DEBIAN_BUILD_TAG: "20250917-two-rust"
DEBIAN_TEST_BASE_TAG: "20250901-trixie2" DEBIAN_TEST_BASE_TAG: "20250901-trixie2"
DEBIAN_TEST_ANDROID_TAG: "20250911-angle" DEBIAN_TEST_ANDROID_TAG: "20250917-two-rust"
DEBIAN_TEST_GL_TAG: "20250911-piglit" DEBIAN_TEST_GL_TAG: "20250911-piglit"
DEBIAN_TEST_VIDEO_TAG: "20250813-vector" DEBIAN_TEST_VIDEO_TAG: "20250813-vector"
DEBIAN_TEST_VK_TAG: "20250911-piglit" DEBIAN_TEST_VK_TAG: "20250911-piglit"

View file

@ -41,6 +41,13 @@ if test -n "$LLVM_VERSION"; then
$LLVM_CONFIG --version $LLVM_CONFIG --version
fi 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
rustup default 1.82.0
fi
# cross-xfail-$CROSS, if it exists, contains a list of tests that are expected # cross-xfail-$CROSS, if it exists, contains a list of tests that are expected
# to fail for the $CROSS configuration, one per line. you can then mark those # to fail for the $CROSS configuration, one per line. you can then mark those
# tests in their meson.build with: # tests in their meson.build with:

View file

@ -760,6 +760,9 @@ if with_gallium_rusticl or with_nouveau_vk or with_tools.contains('etnaviv') or
rustc = meson.get_compiler('rust') rustc = meson.get_compiler('rust')
rust = import('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
if rustc.version().version_compare('< 1.82') if rustc.version().version_compare('< 1.82')
error('Mesa requires Rust 1.82.0 or newer') error('Mesa requires Rust 1.82.0 or newer')
endif endif