ci: distribute XDG_RUNTIME_DIR with setup-test-env script
authorDavid Heidelberg <david.heidelberg@collabora.com>
Sat, 18 Mar 2023 13:49:59 +0000 (14:49 +0100)
committerDavid Heidelberg <david.heidelberg@collabora.com>
Sun, 19 Mar 2023 14:39:12 +0000 (15:39 +0100)
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>

.gitlab-ci/common/init-stage2.sh
.gitlab-ci/crosvm-init.sh
.gitlab-ci/setup-test-env.sh
src/gallium/drivers/llvmpipe/ci/gitlab-ci.yml

index 22a8874..833d23d 100755 (executable)
@@ -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
index ac5eb1b..d2b67fb 100755 (executable)
@@ -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}"
index 8f61f9b..b066b3b 100644 (file)
@@ -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
index fef30e7..40963bd 100644 (file)
@@ -64,14 +64,12 @@ llvmpipe-traces:
 llvmpipe:
   variables:
     DEQP_SUITE: llvmpipe
-    XDG_RUNTIME_DIR: /run/user
     XVFB_SCRIPT: "install/deqp-runner.sh"
     DEQP_FRACTION: 4
   extends: .llvmpipe-deqp-test
   script: |
     . "$SCRIPTS_DIR"/setup-test-env.sh
     section_start weston "weston: prepare"
-    mkdir -p $XDG_RUNTIME_DIR
     LD_LIBRARY_PATH=`pwd`/install weston -Bheadless-backend.so -Swayland-0 &
     section_end weston
     LD_LIBRARY_PATH=`pwd`/install WAYLAND_DISPLAY=wayland-0 xvfb-run --server-args='-noreset' bash -c ". $SCRIPTS_DIR/setup-test-env.sh && ${XVFB_SCRIPT}"