From 9721150bb4083b937e518fe7e5d76c51f9ad929a Mon Sep 17 00:00:00 2001 From: Danathar Date: Mon, 21 Sep 2026 00:41:19 +0000 Subject: [PATCH 1/2] fix(iso): force software GL rendering for the E2E test's terminal Ghostty is a GTK4 app whose GDK surface needs a working GL context, and this VM never has one: luks-e2e.sh's VGA_ARGS is plain stdvga, no virtio-gpu, no /dev/dri. Starting with post-testing-e2e run 35521817359, every flavor failed identically: 'FAIL: fastfetch output was not visible in the desktop screenshot', an empty OCR transcript, and a screenshot of a bare desktop with no terminal on it. luks (utah) and luks (utah-nvidia) had passed as recently as run 35475091852 the day before, with the same script and the same QEMU flags, so the regression tracks something outside this repo rather than a Utah commit. installed-serial.log confirms it: the passing run's Ghostty (1.3.2-main-+5252b19) logs 'setting GDK_DISABLE=gles-api,vulkan', hits 'MESA: error: ZINK: failed to choose pdev', and still recovers to 'loaded OpenGL 4.6'. The failing run's Ghostty (1.3.2-main-+27e8b3f, pulled the next day from tuna-os's unpinned, unversioned master branch) logs only 'setting GDK_DISABLE=vulkan' -- gles-api dropped -- hits the same zink error, and this time never recovers: 'gtk_ghostty_surface: failed to initialize surface err=error.NotInitialized'. Ghostty exits without ever mapping a window, so fastfetch has nowhere to render and PR #181 (testing -> main) fails digest resolution because promote-to-testing never runs (#183). A flatpak --env override cannot fix this. Ghostty's own source (src/apprt/gtk/class/application.zig, gtk_ghostty_application scope) computes GDK_DISABLE from a hardcoded struct literal and calls setenv("GDK_DISABLE", value, 1) -- overwrite=1 -- right before gtk_init, unconditionally clobbering any inherited value. An initial version of this fix pinned a flatpak override for exactly that variable; reading the upstream source proved it a no-op and it is reverted here. luks-e2e.sh's terminal autostart entry now launches Ghostty with LIBGL_ALWAYS_SOFTWARE=1 MESA_LOADER_DRIVER_OVERRIDE=llvmpipe instead. Ghostty's setenv calls only ever touch LANG, GDK_DEBUG and GDK_DISABLE, so these two survive into the sandboxed process and force Mesa's software rasterizer directly, without depending on whichever GDK path Ghostty's own default happens to select on a given day. tests/test_iso_ci.py asserts the autostart Exec line carries both variables and neither script nor a flatpak override still references GDK_DISABLE. docs/skills/local-testing.md documents why the GDK_DISABLE route does not work, so a future contributor does not reintroduce it. Assisted-by: Claude Sonnet 5 via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Danathar --- docs/skills/index.json | 2 +- docs/skills/local-testing.md | 14 ++++++++++++- iso/scripts/luks-e2e.sh | 19 +++++++++++++++++- tests/test_iso_ci.py | 38 ++++++++++++++++++++++++++++++++++++ 4 files changed, 70 insertions(+), 3 deletions(-) diff --git a/docs/skills/index.json b/docs/skills/index.json index 6641f793a..15d5f2e32 100644 --- a/docs/skills/index.json +++ b/docs/skills/index.json @@ -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" }, { diff --git a/docs/skills/local-testing.md b/docs/skills/local-testing.md index 616f57046..a374ec3e5 100644 --- a/docs/skills/local-testing.md +++ b/docs/skills/local-testing.md @@ -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 @@ -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 diff --git a/iso/scripts/luks-e2e.sh b/iso/scripts/luks-e2e.sh index 3b69fc136..232995979 100755 --- a/iso/scripts/luks-e2e.sh +++ b/iso/scripts/luks-e2e.sh @@ -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 < Date: Mon, 21 Sep 2026 01:25:59 +0000 Subject: [PATCH 2/2] test: assert install-flatpaks.sh doesn't reintroduce GDK_DISABLE The PR body claimed the regression test covers both the autostart Exec line and iso/live/src/install-flatpaks.sh, but the assertion only checked the Exec line. Add the missing assertNotIn so a future reintroduction of the disproven flatpak override actually fails this test, matching the claim. --- tests/test_iso_ci.py | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/tests/test_iso_ci.py b/tests/test_iso_ci.py index 3143843c2..c8a4a2c59 100644 --- a/tests/test_iso_ci.py +++ b/tests/test_iso_ci.py @@ -130,20 +130,11 @@ def test_terminal_autostart_forces_software_gl_rendering(self): self.assertIn("env LIBGL_ALWAYS_SOFTWARE=1 MESA_LOADER_DRIVER_OVERRIDE=llvmpipe ", exec_line) self.assertTrue(exec_line.endswith("flatpak --system run ${TERMINAL_APP}")) - - def test_no_gdk_disable_override_survives_in_the_iso_build(self): - # The autostart assertion above covers the line the test harness - # writes. The disproven approach -- `flatpak override --env=GDK_DISABLE` - # -- lived in install-flatpaks.sh instead, and Ghostty setenv(3)s - # GDK_DISABLE with overwrite=1 right before gtk_init, so an override - # there is silently clobbered rather than failing loudly. Nothing - # asserted its removal, so it could return as a plausible-looking fix - # for the next GPU-less rendering failure and cost the same debugging - # round again. - self.assertNotIn( - "GDK_DISABLE", - (ROOT / "iso/live/src/install-flatpaks.sh").read_text(), - ) + # 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