From c886f6fa9696c2c0fe6e7aefa00be21a0fc27c0b Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 6 Nov 2026 12:39:57 -0800 Subject: [PATCH 1/3] fix(test): use system audio libraries for downloaded Firefox --- test/interop/clients/js/harness.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/test/interop/clients/js/harness.ts b/test/interop/clients/js/harness.ts index 30b9d24857a..bc3ec56ad86 100644 --- a/test/interop/clients/js/harness.ts +++ b/test/interop/clients/js/harness.ts @@ -119,20 +119,22 @@ export function launch(args: string[] = [], engine: Engine = "chromium"): Promis // Full Chromium includes WebTransport and WebCodecs; the headless shell does not. if (engine === "chromium") return chromium.launch({ channel: "chromium", headless: true, args, handleSIGTERM: false }); - if (engine === "firefox") + if (engine === "firefox") { + const env = { ...process.env }; + // Only the Nix browser needs Nix's dlopened media libraries. Downloaded Firefox + // uses the system libraries installed by Playwright; mixing in Nix's libraries + // can require a newer glibc than the host's and prevent the audio backend starting. + if (firefox.executablePath().startsWith("/nix/store/")) + env.LD_LIBRARY_PATH = [process.env.PLAYWRIGHT_FIREFOX_LIBRARY_PATH, process.env.LD_LIBRARY_PATH] + .filter(Boolean) + .join(":"); return firefox.launch({ headless: true, handleSIGTERM: false, - // Firefox dlopens its media libraries. Keep the Nix paths on this child, so other - // browsers and native tools retain their own library search paths. - env: { - ...process.env, - LD_LIBRARY_PATH: [process.env.PLAYWRIGHT_FIREFOX_LIBRARY_PATH, process.env.LD_LIBRARY_PATH] - .filter(Boolean) - .join(":"), - }, + env, firefoxUserPrefs: { "media.autoplay.default": 1, "media.autoplay.block-webaudio": true }, }); + } // WebKit's WebCodecs decode through the system GStreamer. The Nix dev shell points GStreamer at // its own newer plugins, which the system core refuses, leaving WebKit with no decoders at all. const env = Object.fromEntries( From 975665dbbfb15c9560a1b9b5f56fc31d50d1f495 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 6 Nov 2026 13:27:04 -0800 Subject: [PATCH 2/3] test(interop): resolve Firefox symlinks before choosing libraries Co-Authored-By: GPT-6.1 Sol --- test/interop/clients/js/harness.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/interop/clients/js/harness.ts b/test/interop/clients/js/harness.ts index bc3ec56ad86..369158481e6 100644 --- a/test/interop/clients/js/harness.ts +++ b/test/interop/clients/js/harness.ts @@ -7,6 +7,7 @@ * @module */ import { randomUUID } from "node:crypto"; +import { realpathSync } from "node:fs"; import { join } from "node:path"; import { type Browser, @@ -124,7 +125,7 @@ export function launch(args: string[] = [], engine: Engine = "chromium"): Promis // Only the Nix browser needs Nix's dlopened media libraries. Downloaded Firefox // uses the system libraries installed by Playwright; mixing in Nix's libraries // can require a newer glibc than the host's and prevent the audio backend starting. - if (firefox.executablePath().startsWith("/nix/store/")) + if (realpathSync(firefox.executablePath()).startsWith("/nix/store/")) env.LD_LIBRARY_PATH = [process.env.PLAYWRIGHT_FIREFOX_LIBRARY_PATH, process.env.LD_LIBRARY_PATH] .filter(Boolean) .join(":"); From 7ff977c6af519aa6ab25926c27932a0f6506dceb Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 6 Nov 2026 13:45:10 -0800 Subject: [PATCH 3/3] fix(test): preserve Playwright missing-browser diagnostics Co-Authored-By: GPT-6.1 Sol --- test/interop/clients/js/harness.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/interop/clients/js/harness.ts b/test/interop/clients/js/harness.ts index 369158481e6..1f6c38a4feb 100644 --- a/test/interop/clients/js/harness.ts +++ b/test/interop/clients/js/harness.ts @@ -7,7 +7,7 @@ * @module */ import { randomUUID } from "node:crypto"; -import { realpathSync } from "node:fs"; +import { existsSync, realpathSync } from "node:fs"; import { join } from "node:path"; import { type Browser, @@ -125,7 +125,8 @@ export function launch(args: string[] = [], engine: Engine = "chromium"): Promis // Only the Nix browser needs Nix's dlopened media libraries. Downloaded Firefox // uses the system libraries installed by Playwright; mixing in Nix's libraries // can require a newer glibc than the host's and prevent the audio backend starting. - if (realpathSync(firefox.executablePath()).startsWith("/nix/store/")) + const executable = firefox.executablePath(); + if (existsSync(executable) && realpathSync(executable).startsWith("/nix/store/")) env.LD_LIBRARY_PATH = [process.env.PLAYWRIGHT_FIREFOX_LIBRARY_PATH, process.env.LD_LIBRARY_PATH] .filter(Boolean) .join(":");