summaryrefslogtreecommitdiff
path: root/.gitlab-ci
diff options
context:
space:
mode:
authorDavid Heidelberg <david.heidelberg@collabora.com>2023-03-18 14:49:59 +0100
committerDavid Heidelberg <david.heidelberg@collabora.com>2023-03-19 15:39:12 +0100
commitfb3632d24f41afda9ab4fc7e96019ea8b32ae59d (patch)
tree67a64cbaf96fd98b85e26ec37972a3a4907ac08b /.gitlab-ci
parent210c6c11cc61c8f53c2c5506e97084dc5f9f2270 (diff)
downloadmesa-fb3632d24f41afda9ab4fc7e96019ea8b32ae59d.tar.gz
mesa-fb3632d24f41afda9ab4fc7e96019ea8b32ae59d.tar.bz2
mesa-fb3632d24f41afda9ab4fc7e96019ea8b32ae59d.zip
ci: distribute XDG_RUNTIME_DIR with setup-test-env script
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8615 Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8646 Reviewed-by: Eric Engestrom <eric@igalia.com> Reviewed-by: Martin Roukala <martin.roukala@mupuf.org> Signed-off-by: David Heidelberg <david.heidelberg@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22004>
Diffstat (limited to '.gitlab-ci')
-rwxr-xr-x.gitlab-ci/common/init-stage2.sh3
-rwxr-xr-x.gitlab-ci/crosvm-init.sh3
-rw-r--r--.gitlab-ci/setup-test-env.sh3
3 files changed, 3 insertions, 6 deletions
diff --git a/.gitlab-ci/common/init-stage2.sh b/.gitlab-ci/common/init-stage2.sh
index 22a8874c293..833d23d8f88 100755
--- a/.gitlab-ci/common/init-stage2.sh
+++ b/.gitlab-ci/common/init-stage2.sh
@@ -125,9 +125,6 @@ fi
/capture-devcoredump.sh &
BACKGROUND_PIDS="$! $BACKGROUND_PIDS"
-export XDG_RUNTIME_DIR=/run/user
-mkdir -p $XDG_RUNTIME_DIR
-
# If we want Xorg to be running for the test, then we start it up before the
# HWCI_TEST_SCRIPT because we need to use xinit to start X (otherwise
# without using -displayfd you can race with Xorg's startup), but xinit will eat
diff --git a/.gitlab-ci/crosvm-init.sh b/.gitlab-ci/crosvm-init.sh
index ac5eb1b9ea6..d2b67fbd428 100755
--- a/.gitlab-ci/crosvm-init.sh
+++ b/.gitlab-ci/crosvm-init.sh
@@ -15,9 +15,6 @@ mount -t tmpfs tmpfs /tmp
. ${VM_TEMP_DIR}/crosvm-env.sh
. ${VM_TEMP_DIR}/setup-test-env.sh
-# Required by the wayland platform
-export XDG_RUNTIME_DIR=$(mktemp -d)
-
# .gitlab-ci.yml script variable is using relative paths to install directory,
# so change to that dir before running `crosvm-script`
cd "${CI_PROJECT_DIR}"
diff --git a/.gitlab-ci/setup-test-env.sh b/.gitlab-ci/setup-test-env.sh
index 8f61f9b0c6f..b066b3b3d9c 100644
--- a/.gitlab-ci/setup-test-env.sh
+++ b/.gitlab-ci/setup-test-env.sh
@@ -93,5 +93,8 @@ export -f section_end
export -f section_switch
export -f uncollapsed_section_switch
+# Freedesktop requirement (needed for Wayland)
+[ -n "${XDG_RUNTIME_DIR}" ] || export XDG_RUNTIME_DIR="$(mktemp -p "$PWD" -d xdg-runtime-XXXXXX)"
+
set -E
trap 'trap_err $?' ERR