ci/traces: switch from xvfb to Weston XWayland
authorDavid Heidelberg <david.heidelberg@collabora.com>
Sat, 8 Jul 2023 11:14:58 +0000 (13:14 +0200)
committerMarge Bot <emma+marge@anholt.net>
Mon, 10 Jul 2023 19:57:45 +0000 (19:57 +0000)
 - Drop now unused RUN_CMD_WRAPPER.
 - Copy-paste Weston initiation code from init-stage2.sh with slightly adjustments.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24056>

.gitlab-ci/piglit/piglit-traces.sh

index 8bb9b90..06214b9 100755 (executable)
@@ -100,7 +100,19 @@ elif [ "$PIGLIT_PLATFORM" = "mixed_glx_egl" ]; then
     SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD --platform glx --api gl"
 else
     SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD --platform glx --api gl --profile core"
-    RUN_CMD_WRAPPER="xvfb-run --server-args=\"-noreset\" sh -c"
+    # copy-paste from init-stage2.sh, please update accordingly
+    {
+      WESTON_X11_SOCK="/tmp/.X11-unix/X0"
+      export WAYLAND_DISPLAY=wayland-0
+      export DISPLAY=:0
+      mkdir -p /tmp/.X11-unix
+
+      env \
+        VK_ICD_FILENAMES="/install/share/vulkan/icd.d/${VK_DRIVER}_icd.$(uname -m).json" \
+       weston -Bheadless-backend.so --use-gl -Swayland-0 --xwayland --idle-time=0 &
+
+      while [ ! -S "$WESTON_X11_SOCK" ]; do sleep 1; done
+    }
 fi
 
 # If the job is parallel at the  gitlab job level, will take the corresponding
@@ -161,10 +173,6 @@ PIGLIT_CMD="./piglit run -l verbose --timeout 300 -j${FDO_CI_CONCURRENT:-4} $PIG
 
 RUN_CMD="export LD_LIBRARY_PATH=$__LD_LIBRARY_PATH; $SANITY_MESA_VERSION_CMD && $HANG_DETECTION_CMD $PIGLIT_CMD"
 
-if [ "$RUN_CMD_WRAPPER" ]; then
-    RUN_CMD="set +e; $RUN_CMD_WRAPPER \"$(/usr/bin/printf "%q" "$RUN_CMD")\"; set -e"
-fi
-
 # The replayer doesn't do any size or checksum verification for the traces in
 # the replayer db, so if we had to restart the system due to intermittent device
 # errors (or tried to cache replayer-db between runs, which would be nice to