Skip to content

RediWM is a Wayland compositor written in Zig (OpenGL ES) that includes everything in one process

release-verify: start the compositor on GLES2 with the host's render node

oxydizer6b6dc4fbf6d7
diff --git a/scripts/make-release.sh b/scripts/make-release.sh
index e88e7c8..33d1a1d 100755
--- a/scripts/make-release.sh
+++ b/scripts/make-release.sh
@@ -76,10 +76,13 @@ fi
# Each build writes into its tree (zig-out), so each family gets its own copy.
# Rootless podman maps root in the container to this user, so what it writes to
# a bind mount is already ours; docker's root-owned files are handed back.
+# run_args: extra engine options for the next run() (the verify step's render node).
+run_args=""
run() { # family script args...
family=$1; shift
rc=0
- "$engine" run --rm \
+ # shellcheck disable=SC2086 # word-split on purpose
+ "$engine" run --rm $run_args \
-v "$work/$family:/work" -v "$out:/out" \
-v "$cache/zig:/cache/zig" -v "$cache/zig-global:/cache/zig-global" \
-e REDIWM_ZIG_DIR=/cache/zig -e ZIG_GLOBAL_CACHE_DIR=/cache/zig-global \
@@ -96,7 +99,13 @@ for family in $families; do
run "$family" sh /work/scripts/release-build.sh "$family" /out
if [ "$verify" = yes ]; then
log "Verifying $family in a fresh container"
+ # The compositor needs GLES2, which needs a DRM render node even for
+ # llvmpipe, and a bare container has none: hand it the host's.
+ node=${REDIWM_RENDER_NODE:-$(ls /dev/dri/renderD* 2>/dev/null | head -n 1)}
+ [ -n "$node" ] || die "no /dev/dri/renderD* on this machine for the verify step (set REDIWM_RENDER_NODE, or use --no-verify)"
+ run_args="--device $node"
run "$family" sh /work/scripts/release-verify.sh "$family" /out
+ run_args=""
fi
rm -rf -- "$work/$family"
done
diff --git a/scripts/release-verify.sh b/scripts/release-verify.sh
index 7db729e..6ae56fe 100644
--- a/scripts/release-verify.sh
+++ b/scripts/release-verify.sh
@@ -64,8 +64,11 @@ xdg=$(mktemp -d)
chown tester "$xdg"
chmod 700 "$xdg"
log_file=/tmp/rediwm-verify.log
+# make-release.sh passes the host's render node in; GLES2 needs one even for llvmpipe.
+node=$(ls /dev/dri/renderD* 2>/dev/null | head -n 1) || true
+[ -n "$node" ] || die "no DRM render node in the container"
runuser -u tester -- env HOME=/home/tester XDG_RUNTIME_DIR="$xdg" XDG_STATE_HOME="$xdg/state" \
- WLR_BACKENDS=headless WLR_HEADLESS_OUTPUTS=1 WLR_RENDERER=gles2 WLR_RENDERER_ALLOW_SOFTWARE=1 REDIWM_SCALE=1 \
+ WLR_BACKENDS=headless WLR_HEADLESS_OUTPUTS=1 WLR_RENDERER=gles2 WLR_RENDERER_ALLOW_SOFTWARE=1 WLR_RENDER_DRM_DEVICE="$node" REDIWM_SCALE=1 \
/usr/local/bin/rediwm > "$log_file" 2>&1 &
pid=$!
up=no