Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/skills/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
],
"description": "Local validation loop: build-ghcr, bootc install to-disk, QEMU/noVNC boot, live ISO boot paths, and Secure Boot strategy. Use when validating changes end-to-end or debugging boot, GDM, or live-session failures.",
"version": "1.0",
"last_updated": "2026-09-18",
"last_updated": "2026-09-21",
"doc_type": "runbook"
},
{
Expand Down
14 changes: 13 additions & 1 deletion docs/skills/local-testing.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: local-testing
version: "1.0"
last_updated: "2026-09-18"
last_updated: "2026-09-21"
id: local-testing
one_line_purpose: Build, install, and boot Utah locally in a VM or live ISO.
entry_point: docs/skills/local-testing.md
Expand Down Expand Up @@ -209,6 +209,18 @@ kernel output, and `UTAH_E2E_REQUIRE_SCREENSHOTS=1` to reject missing PNGs.
CI retains the tested commit/image digest and proposes evidence updates in a
documentation PR only after all flavors pass. See [ci-workflows.md](ci-workflows.md).

Ghostty is the only terminal the harness's fastfetch capture can show, and
this VM never has a GPU (plain stdvga, no `/dev/dri`), so its terminal
autostart entry (`iso/scripts/luks-e2e.sh`) launches it with
`LIBGL_ALWAYS_SOFTWARE=1 MESA_LOADER_DRIVER_OVERRIDE=llvmpipe`. A
`flatpak override --env=GDK_DISABLE=...` looks like the obvious fix but does
not work: Ghostty computes `GDK_DISABLE` from a hardcoded struct and
`setenv(3)`s it with `overwrite=1` right before `gtk_init`, clobbering any
inherited value, and an upstream build on 2026-09-20 dropped `gles-api` from
that struct and broke every flavor's harness run this way (#183). The two
Mesa variables above are never among the ones Ghostty itself sets, so they
are the ones that actually reach the process.

The harness blocks outbound guest networking while retaining loopback-only
SSH forwards, so installation cannot silently fall back to an online pull.
For digest-pinned builds, the builder exports the original registry blobs
Expand Down
19 changes: 18 additions & 1 deletion iso/scripts/luks-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -525,11 +525,28 @@ window-height = ${TERMINAL_ROWS}
CFG
done
mkdir -p ~/.config/autostart
# This VM never has a GPU (VGA_ARGS above is plain stdvga, no virtio-gpu,
# no /dev/dri), so Ghostty's GTK surface has to fall back to software
# rendering. It used to get there via GDK_DISABLE=gles-api,vulkan, which
# steered GDK away from the EGL/GLES path onto a GLX path that Mesa could
# still soften. Ghostty computes GDK_DISABLE itself from a hardcoded
# struct and setenv(3)s it with overwrite=1 right before gtk_init --
# https://github.com/ghostty-org/ghostty src/apprt/gtk/class/application.zig,
# gtk_ghostty_application scope -- so any value this script or a flatpak
# override sets is clobbered unconditionally; only the fields Ghostty
# itself compiles in ever apply, and an upstream build on 2026-09-20
# dropped gles-api from that struct, taking the GLX fallback with it
# (\"MESA: error: ZINK: failed to choose pdev\", then \"gtk_ghostty_surface:
# failed to initialize surface\") (#183). LIBGL_ALWAYS_SOFTWARE and
# MESA_LOADER_DRIVER_OVERRIDE are never touched by Ghostty's own setenv
# calls (only LANG, GDK_DEBUG and GDK_DISABLE are), so they survive into
# the sandboxed process and force llvmpipe directly, without depending on
# whichever GDK path Ghostty's own default happens to select.
cat > ~/.config/autostart/${TERMINAL_APP}.desktop <<EOF
[Desktop Entry]
Type=Application
Name=Terminal
Exec=flatpak --system run ${TERMINAL_APP}
Exec=env LIBGL_ALWAYS_SOFTWARE=1 MESA_LOADER_DRIVER_OVERRIDE=llvmpipe flatpak --system run ${TERMINAL_APP}
X-GNOME-Autostart-enabled=true
EOF
" || fail "could not write the terminal autostart entry"
Expand Down
29 changes: 29 additions & 0 deletions tests/test_iso_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,35 @@ def test_production_boot_args_and_unsupported_paths(self):
self.assertIn("rd.live.image", script)
self.assertIn("rd.live.overlay.overlayfs=1", script)

def test_terminal_autostart_forces_software_gl_rendering(self):
# #183: Ghostty computes GDK_DISABLE from a hardcoded struct and
# setenv(3)s it with overwrite=1 right before gtk_init (upstream
# src/apprt/gtk/class/application.zig, gtk_ghostty_application
# scope), so neither this script nor a `flatpak override --env` can
# steer it: an upstream build on 2026-09-20 dropped `gles-api` from
# that struct, and every flavor's terminal exited without ever
# mapping a window under QEMU's GPU-less VGA device ("MESA: error:
# ZINK: failed to choose pdev", then "gtk_ghostty_surface: failed to
# initialize surface"). LIBGL_ALWAYS_SOFTWARE and
# MESA_LOADER_DRIVER_OVERRIDE are never among the variables Ghostty
# itself setenv(3)s (only LANG, GDK_DEBUG and GDK_DISABLE are), so
# they survive into the sandboxed process and force llvmpipe
# directly -- assert the fix that actually reaches the process, not
# a GDK_DISABLE override Ghostty is proven to clobber.
script = (ROOT / "iso/scripts/luks-e2e.sh").read_text()
marker = "cat > ~/.config/autostart/"
autostart = script[script.index(marker):script.index("\nEOF", script.index(marker))]
exec_line = next(l for l in autostart.splitlines() if l.startswith("Exec="))
self.assertNotIn("GDK_DISABLE", exec_line)
self.assertIn("env LIBGL_ALWAYS_SOFTWARE=1 MESA_LOADER_DRIVER_OVERRIDE=llvmpipe ",
exec_line)
self.assertTrue(exec_line.endswith("flatpak --system run ${TERMINAL_APP}"))
# The disproven `flatpak override --env=GDK_DISABLE=...` route (see
# comment above) was added and reverted during review; assert it
# never comes back in the installer script either.
installer = (ROOT / "iso/live/src/install-flatpaks.sh").read_text()
self.assertNotIn("GDK_DISABLE", installer)

def test_iso_budget_guard_fails_closed_above_ceiling(self):
# The budget guard (#128) is the whole point of the size drift this PR
# closes. Extract the real block and run it with du stubbed so we can
Expand Down
Loading