mesa/.gitlab-ci/container/build-rust.sh
Karol Herbst 65c7192287 Revert "ci: Update CrosVM and Virglrenderer"
This reverts commit ab5605aab3.

We require 1.78 on 25.2 and we should CI against 1.78 on 25.2.

If something in CI requires a newer version, this should be handled
differently. If we require a newer rustc version because of a dependency
we should properly bump the rustc version requirement.

But please no random bumps like this because we don't want to cause random
build failures due to changes in rustc.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37198>
2025-10-01 11:30:49 +02:00

38 lines
1.2 KiB
Bash

#!/bin/bash
# Note that this script is not actually "building" rust, but build- is the
# convention for the shared helpers for putting stuff in our containers.
set -ex
section_start rust "Building Rust toolchain"
# Pick a specific snapshot from rustup so the compiler doesn't drift on us.
RUST_VERSION=1.78.0-2024-05-02
# 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 \
--profile minimal \
-y
# Make rustup tools available in the PATH environment variable
# shellcheck disable=SC1091
. "$HOME/.cargo/env"
rustup component add clippy rustfmt
# 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" <<EOF
[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"
[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
EOF
section_end rust