ci: dedupe weston setup

We're doing almost the same thing 3 times; let's put that in a script.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36485>
This commit is contained in:
Eric Engestrom
2025-08-04 09:39:03 +02:00
committed by Marge Bot
parent 812fad7065
commit 8e71665468
4 changed files with 18 additions and 28 deletions

View File

@@ -187,22 +187,14 @@ if [ -n "$HWCI_START_XORG" ]; then
fi fi
if [ -n "$HWCI_START_WESTON" ]; then if [ -n "$HWCI_START_WESTON" ]; then
WESTON_X11_SOCK="/tmp/.X11-unix/X0"
if [ -n "$HWCI_START_XORG" ]; then if [ -n "$HWCI_START_XORG" ]; then
echo "Please consider dropping HWCI_START_XORG and instead using Weston XWayland for testing." echo "Please consider dropping HWCI_START_XORG and instead using Weston XWayland for testing."
# shellcheck disable=2034
WESTON_X11_SOCK="/tmp/.X11-unix/X1" WESTON_X11_SOCK="/tmp/.X11-unix/X1"
fi fi
WAYLAND_DISPLAY=wayland-0
# Display server is Weston Xwayland when HWCI_START_XORG is not set or Xorg when it's . /install/common/weston.sh --renderer=gl
export DISPLAY=:0
mkdir -p /tmp/.X11-unix
weston --config="/install/common/weston.ini" --socket="$WAYLAND_DISPLAY" --renderer=gl &
BACKGROUND_PIDS="$! $BACKGROUND_PIDS" BACKGROUND_PIDS="$! $BACKGROUND_PIDS"
export WAYLAND_DISPLAY
while [ ! -S "$WESTON_X11_SOCK" ]; do sleep 1; done
fi fi
set +x set +x

14
.gitlab-ci/common/weston.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
CI_COMMON_DIR=$(dirname -- "${BASH_SOURCE[0]}")
# init-stage2.sh overwrites this when xorg is already started
WESTON_X11_SOCK=${WESTON_X11_SOCK:-/tmp/.X11-unix/X0}
mkdir -p /tmp/.X11-unix
export DISPLAY=:0
WAYLAND_DISPLAY=wayland-0
weston --config="$CI_COMMON_DIR/weston.ini" --socket="$WAYLAND_DISPLAY" "$@" &
export WAYLAND_DISPLAY
while [ ! -S "$WESTON_X11_SOCK" ]; do sleep 1; done

View File

@@ -90,18 +90,7 @@ elif [ "$PIGLIT_PLATFORM" = "mixed_glx_egl" ]; then
SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD --platform glx --api gl" SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD --platform glx --api gl"
else else
SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD --platform glx --api gl --profile core" SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD --platform glx --api gl --profile core"
# copy-paste from init-stage2.sh, please update accordingly . /install/common/weston.sh --renderer=gl
{
WESTON_X11_SOCK="/tmp/.X11-unix/X0"
WAYLAND_DISPLAY=wayland-0
export DISPLAY=:0
mkdir -p /tmp/.X11-unix
weston --config="/install/common/weston.ini" --socket="$WAYLAND_DISPLAY" --renderer=gl &
export WAYLAND_DISPLAY
while [ ! -S "$WESTON_X11_SOCK" ]; do sleep 1; done
}
fi fi
# If the job is parallel at the gitlab job level, will take the corresponding # If the job is parallel at the gitlab job level, will take the corresponding

View File

@@ -41,12 +41,7 @@ llvmpipe:
export LD_LIBRARY_PATH="$CI_PROJECT_DIR/install/lib" export LD_LIBRARY_PATH="$CI_PROJECT_DIR/install/lib"
export LIBGL_DRIVERS_PATH="$CI_PROJECT_DIR/install/lib/dri" export LIBGL_DRIVERS_PATH="$CI_PROJECT_DIR/install/lib/dri"
section_start weston "weston: prepare" section_start weston "weston: prepare"
WAYLAND_DISPLAY=wayland-0 . "$CI_PROJECT_DIR/install/common/weston.sh"
export DISPLAY=:0
mkdir -p /tmp/.X11-unix
weston --config="$CI_PROJECT_DIR/install/common/weston.ini" --socket="$WAYLAND_DISPLAY" &
export WAYLAND_DISPLAY
while [ ! -S /tmp/.X11-unix/X0 ]; do sleep 1; done
section_end weston section_end weston
$CI_PROJECT_DIR/install/deqp-runner.sh $CI_PROJECT_DIR/install/deqp-runner.sh