|
| 1 | +#!/usr/bin/env bash |
| 2 | +# SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | +# |
| 4 | +# Copyright (C) 2025 Collabora, Vignesh Raman <[email protected]> |
| 5 | +# |
| 6 | +# Based on the build-deqp-runner.sh script from the mesa project: |
| 7 | +# https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/.gitlab-ci/container/build-deqp-runner.sh |
| 8 | +# |
| 9 | +# shellcheck disable=SC2086 # we want word splitting |
| 10 | + |
| 11 | +set -uex |
| 12 | + |
| 13 | +# Build-depends needed to build the test suites, they'll be removed later |
| 14 | +BUILD_DEPS="\ |
| 15 | + build-essential \ |
| 16 | + ca-certificates \ |
| 17 | + curl \ |
| 18 | + git |
| 19 | +" |
| 20 | + |
| 21 | +export DEBIAN_FRONTEND=noninteractive |
| 22 | + |
| 23 | +apt-get update |
| 24 | +apt-get install --no-install-recommends -y ${BUILD_DEPS} |
| 25 | + |
| 26 | +# Install rust |
| 27 | +curl https://sh.rustup.rs -sSf | sh -s -- -y |
| 28 | +. "$HOME/.cargo/env" || true |
| 29 | + |
| 30 | +rustup component add clippy rustfmt |
| 31 | + |
| 32 | +DEQP_RUNNER_GIT_URL="${DEQP_RUNNER_GIT_URL:-https://github.com/vigneshraman/deqp-runner.git}" |
| 33 | +DEQP_RUNNER_GIT_TAG="${DEQP_RUNNER_GIT_TAG:-v0.20.0}" |
| 34 | + |
| 35 | +git clone $DEQP_RUNNER_GIT_URL --single-branch --no-checkout |
| 36 | +pushd deqp-runner |
| 37 | +git checkout $DEQP_RUNNER_GIT_TAG |
| 38 | + |
| 39 | +cargo install --locked \ |
| 40 | + -j ${FDO_CI_CONCURRENT:-4} \ |
| 41 | + --root /usr/local \ |
| 42 | + ${EXTRA_CARGO_ARGS:-} \ |
| 43 | + --path . |
| 44 | + |
| 45 | +popd |
| 46 | +rm -rf deqp-runner |
| 47 | + |
| 48 | +# Remove unused test runners |
| 49 | +if [ -z "${DEQP_RUNNER_GIT_TAG:-}" ]; then |
| 50 | + rm -f /usr/local/bin/igt-runner |
| 51 | +fi |
| 52 | + |
| 53 | +# Cleanup cargo cache |
| 54 | +rm -rf /root/.cargo/registry |
| 55 | +rustup self uninstall -y |
| 56 | + |
| 57 | +apt-get remove --purge -y ${BUILD_DEPS} |
| 58 | +apt-get autoremove --purge -y |
| 59 | +apt-get clean |
0 commit comments