From 8729c6e98186b2feab4466ca288876e3a1078f6c Mon Sep 17 00:00:00 2001 From: Cristian Ciocaltea Date: Thu, 30 Dec 2021 22:55:33 +0200 Subject: [PATCH] ci: Support building and installing deqp-runner from source Add support for building and installing deqp-runner from a git source repository to facilitate further development & testing of new features or simply making use of the latest upstream changes which were not already tagged as a new package version. The git revision to be built must be specified by setting 'DEQP_RUNNER_GIT_REV' env variable. To specify a git tag name instead, 'DEQP_RUNNER_GIT_TAG' variable must be used. It is also possible to indicate a custom git repository via 'DEQP_RUNNER_GIT_URL'. If neither a git revision or tag name has been set, deqp-runner is installed from the rust package registry (the default behavior). v2: Make use of '--git' and '--rev' cargo args to automate the git checkout operation (Rohan). v3: Allow Git URL override by using the hardcoded URL only when DEQP_RUNNER_GIT_URL is not already set. v4: Override 'EXTRA_CARGO_ARGS' to optimize the script and avoid a second call to 'cargo install'. Additionally, add support for indicating git tags (Rohan). Signed-off-by: Cristian Ciocaltea Reviewed-by: Rohan Garg Reviewed-by: Tomeu Vizoso Part-of: --- .gitlab-ci/container/build-deqp-runner.sh | 25 +++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci/container/build-deqp-runner.sh b/.gitlab-ci/container/build-deqp-runner.sh index 9c726448c48..7919f0c74d0 100644 --- a/.gitlab-ci/container/build-deqp-runner.sh +++ b/.gitlab-ci/container/build-deqp-runner.sh @@ -1,9 +1,22 @@ -#!/bin/bash +#!/bin/sh set -ex -cargo install --locked deqp-runner \ - -j ${FDO_CI_CONCURRENT:-4} \ - --version 0.11.0 \ - --root /usr/local \ - $EXTRA_CARGO_ARGS +if [ -n "${DEQP_RUNNER_GIT_TAG}${DEQP_RUNNER_GIT_REV}" ]; then + # Build and install from source + EXTRA_CARGO_ARGS="--git ${DEQP_RUNNER_GIT_URL:-https://gitlab.freedesktop.org/anholt/deqp-runner.git} ${EXTRA_CARGO_ARGS}" + + if [ -n "${DEQP_RUNNER_GIT_TAG}" ]; then + EXTRA_CARGO_ARGS="--tag ${DEQP_RUNNER_GIT_TAG} ${EXTRA_CARGO_ARGS}" + else + EXTRA_CARGO_ARGS="--rev ${DEQP_RUNNER_GIT_REV} ${EXTRA_CARGO_ARGS}" + fi +else + # Install from package registry + EXTRA_CARGO_ARGS="--version 0.11.0 ${EXTRA_CARGO_ARGS} -- deqp-runner" +fi + +cargo install --locked \ + -j ${FDO_CI_CONCURRENT:-4} \ + --root /usr/local \ + ${EXTRA_CARGO_ARGS}