b664ae373d
apple / swift (push) Successful in 1m14s
android / android (push) Successful in 4m17s
arch / build-publish (push) Successful in 5m37s
ci / web (push) Successful in 1m4s
apple / screenshots (push) Successful in 6m11s
ci / docs-site (push) Successful in 1m5s
ci / rust (push) Successful in 3m45s
deb / build-publish (push) Successful in 4m1s
decky / build-publish (push) Successful in 25s
ci / bench (push) Successful in 5m4s
docker / build-push (., web/Dockerfile, punktfunk-web) (push) Successful in 34s
docker / build-push (--build-arg FEDORA_VERSION=44, ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora44-rpm) (push) Successful in 2m58s
docker / build-push (ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora-rpm) (push) Successful in 2m42s
docker / build-push (docs-site, docs-site/Dockerfile, punktfunk-docs) (push) Successful in 56s
docker / build-push (ci, ci/rust-ci.Dockerfile, punktfunk-rust-ci) (push) Successful in 2m26s
flatpak / build-publish (push) Successful in 4m23s
rpm / build-publish (43, bazzite, punktfunk-fedora-rpm) (push) Successful in 10m39s
docker / deploy-docs (push) Successful in 22s
rpm / build-publish (44, fedora-44, punktfunk-fedora44-rpm) (push) Successful in 10m2s
The linux-client-screenshots job red-lit on a single scene — the first one (`hosts`) — with "client never signalled PF_SHOT_READY", while the other six captured fine (~1-2s each). Root cause: the first client launch pays a large one-time cold-start under software rendering (llvmpipe GL-shader + fontconfig cache build, plus first-run client-identity generation into the shared scratch HOME), ~25s on the CI runner; the relm4 shell rebuilt in 0.8.3 tipped it just over the 20s PF_SHOT_READY cap. Every scene rendered correctly — the cap was simply too tight for cold start. Raise it to ~60s (warm scenes still break out in ~1-2s, so the happy path is unchanged). Best-effort job; it never blocked the release, but now it goes green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
159 lines
5.9 KiB
Bash
Executable File
159 lines
5.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Capture host-free UI screenshots of the native Linux client. Mirrors the iOS harness
|
|
# (clients/apple/tools/screenshots.sh): one app launch per scene (PUNKTFUNK_SHOT_SCENE),
|
|
# the app renders a mock-populated REAL view and — when the binary supports it — CAPTURES
|
|
# ITSELF (PUNKTFUNK_SHOT_OUT: widget snapshot → gsk render → PNG) before printing
|
|
# `PF_SHOT_READY`. Self-capture needs no Xvfb/ImageMagick and runs under a live Wayland
|
|
# session too; the X11 root-grab path is kept as a fallback for old binaries. No host,
|
|
# GPU, or live stream — only the chrome scenes (the stream page needs a live connector).
|
|
#
|
|
# cargo build --release -p punktfunk-client-linux
|
|
# bash clients/linux/tools/screenshots.sh # → clients/linux/screenshots/<scene>.png
|
|
# bash clients/linux/tools/screenshots.sh hosts pair # a subset
|
|
#
|
|
# Env knobs: BIN (client binary), OUT (output dir), GEOMETRY (Xvfb WxHxDepth),
|
|
# SETTLE (extra seconds after PF_SHOT_READY, X11-fallback only), SHOT_DISPLAY (X display),
|
|
# GSK_RENDERER (gl|ngl|cairo — cairo is the safe headless/no-GPU choice), FORCE_XVFB=1
|
|
# (ignore a live Wayland session and go through Xvfb anyway).
|
|
set -euo pipefail
|
|
|
|
here="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # clients/linux
|
|
BIN="${BIN:-$here/../../target/release/punktfunk-client}"
|
|
OUT="${OUT:-$here/screenshots}"
|
|
# X11 fallback only: the client window maps at its 1200x780 default; with no WM under
|
|
# Xvfb it lands at the top-left, so keep the root just larger so the full window (incl.
|
|
# its CSD shadow) is captured by a root grab with only a thin margin to crop.
|
|
GEOMETRY="${GEOMETRY:-1380x860x24}"
|
|
SETTLE="${SETTLE:-1.2}"
|
|
SHOT_DISPLAY="${SHOT_DISPLAY:-:99}"
|
|
|
|
if [ "$#" -gt 0 ]; then SCENES=("$@"); else SCENES=(hosts settings trust pair addhost shortcuts library); fi
|
|
|
|
[ -x "$BIN" ] || {
|
|
echo "client binary not found: $BIN (build it first: cargo build --release -p punktfunk-client-linux)" >&2
|
|
exit 1
|
|
}
|
|
|
|
# Isolated scratch HOME: the client generates its identity here on first run, and the
|
|
# saved-hosts grid is read from client-known-hosts.json, so seed mock hosts for the
|
|
# `hosts` scene (the dialogs/settings build their own mock state in-app). `last_used`
|
|
# on the first entry renders the most-recent accent bar.
|
|
WORK="$(mktemp -d)"
|
|
export HOME="$WORK"
|
|
mkdir -p "$HOME/.config/punktfunk"
|
|
cat >"$HOME/.config/punktfunk/client-known-hosts.json" <<'JSON'
|
|
{
|
|
"hosts": [
|
|
{ "name": "Living Room PC", "addr": "192.168.1.42", "port": 9777,
|
|
"fp_hex": "9f8e7d6c5b4a39281706f5e4d3c2b1a0998877665544332211ffeeddccbbaa00",
|
|
"paired": true, "last_used": 1780000000 },
|
|
{ "name": "Office", "addr": "192.168.1.50", "port": 9777,
|
|
"fp_hex": "a1b2c3d4e5f60718293a4b5c6d7e8f90112233445566778899aabbccddeeff00",
|
|
"paired": false }
|
|
]
|
|
}
|
|
JSON
|
|
|
|
XVFB_PID=""
|
|
cleanup() {
|
|
if [ -n "$XVFB_PID" ]; then kill "$XVFB_PID" 2>/dev/null || true; fi
|
|
rm -rf "$WORK"
|
|
}
|
|
trap cleanup EXIT
|
|
|
|
if [ -n "${WAYLAND_DISPLAY:-}" ] && [ -z "${FORCE_XVFB:-}" ]; then
|
|
# Live Wayland session: self-capture only (there is no root grab on Wayland). The
|
|
# window flashes up briefly per scene — this is a dev harness, not CI polish.
|
|
MODE=wayland
|
|
export GDK_BACKEND=wayland
|
|
else
|
|
# Software-rendered X session — no GPU/Wayland needed. GL/llvmpipe runs the real NGL
|
|
# renderer (cairo is documented-incomplete for 3D-transformed content / libadwaita
|
|
# transitions).
|
|
MODE=x11
|
|
unset WAYLAND_DISPLAY
|
|
export DISPLAY="$SHOT_DISPLAY"
|
|
export GDK_BACKEND=x11
|
|
export LIBGL_ALWAYS_SOFTWARE=1
|
|
export GALLIUM_DRIVER="${GALLIUM_DRIVER:-llvmpipe}"
|
|
export GSK_RENDERER="${GSK_RENDERER:-gl}"
|
|
|
|
Xvfb "$SHOT_DISPLAY" -screen 0 "$GEOMETRY" -nolisten tcp >"$WORK/xvfb.log" 2>&1 &
|
|
XVFB_PID=$!
|
|
# Wait for the display to accept connections.
|
|
for _ in $(seq 1 50); do
|
|
if command -v xdpyinfo >/dev/null 2>&1; then
|
|
xdpyinfo -display "$SHOT_DISPLAY" >/dev/null 2>&1 && break
|
|
else
|
|
[ -e "/tmp/.X11-unix/X${SHOT_DISPLAY#:}" ] && break
|
|
fi
|
|
sleep 0.1
|
|
done
|
|
fi
|
|
|
|
# X11 root grab — the fallback for binaries without self-capture.
|
|
capture_x11() {
|
|
local out="$1"
|
|
if command -v import >/dev/null 2>&1; then
|
|
import -silent -window root "$out"
|
|
elif command -v scrot >/dev/null 2>&1; then
|
|
scrot -o "$out"
|
|
else
|
|
echo "no screenshot tool — install imagemagick or scrot" >&2
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
mkdir -p "$OUT"
|
|
rc=0
|
|
for scene in "${SCENES[@]}"; do
|
|
: >"$WORK/log"
|
|
rm -f "$OUT/$scene.png"
|
|
PUNKTFUNK_SHOT_SCENE="$scene" PUNKTFUNK_SHOT_OUT="$OUT/$scene.png" \
|
|
"$BIN" >"$WORK/log" 2>&1 &
|
|
pid=$!
|
|
ready=0
|
|
# Up to ~60s: a warm scene signals in ~1-2s, but the FIRST launch pays a large one-time
|
|
# cold-start under software rendering (llvmpipe GL-shader + fontconfig cache build, plus
|
|
# first-run client-identity generation into the shared scratch HOME) that can run ~25s on a
|
|
# loaded CI runner. A 20s cap tripped exactly one scene (the first) even though every scene
|
|
# rendered fine — give it headroom instead of red-lighting the whole capture on cold start.
|
|
for _ in $(seq 1 600); do
|
|
if grep -q "PF_SHOT_READY" "$WORK/log"; then
|
|
ready=1
|
|
break
|
|
fi
|
|
if ! kill -0 "$pid" 2>/dev/null; then
|
|
# Self-capture binaries exit(0) right after READY — check the log once more.
|
|
grep -q "PF_SHOT_READY" "$WORK/log" && ready=1
|
|
break
|
|
fi
|
|
sleep 0.1
|
|
done
|
|
if [ "$ready" = 1 ]; then
|
|
if [ -f "$OUT/$scene.png" ]; then
|
|
echo "✓ $scene → $OUT/$scene.png (self-capture)"
|
|
elif [ "$MODE" = x11 ]; then
|
|
# Old binary (no PUNKTFUNK_SHOT_OUT support) — grab the X root instead.
|
|
sleep "$SETTLE"
|
|
if capture_x11 "$OUT/$scene.png"; then
|
|
echo "✓ $scene → $OUT/$scene.png (x11 grab)"
|
|
else
|
|
rc=1
|
|
fi
|
|
else
|
|
echo "✗ $scene: no PNG (self-capture failed — see log)" >&2
|
|
sed 's/^/ /' "$WORK/log" >&2 || true
|
|
rc=1
|
|
fi
|
|
else
|
|
echo "✗ $scene: client never signalled PF_SHOT_READY" >&2
|
|
sed 's/^/ /' "$WORK/log" >&2 || true
|
|
rc=1
|
|
fi
|
|
kill "$pid" 2>/dev/null || true
|
|
wait "$pid" 2>/dev/null || true
|
|
done
|
|
|
|
exit "$rc"
|