{"record":{"id":"700b16e9fb4a4bf8","repo":"stablyai/orca","slug":"wayland-gpu-sandbox-validation-requires-a-wayland","errorCode":null,"errorMessage":"Wayland GPU sandbox validation requires a Wayland session.","messagePattern":"Wayland GPU sandbox validation requires a Wayland session\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/scripts/verify-linux-wayland-gpu-sandbox.mjs","lineNumber":73,"sourceCode":"function run(command, args, options = {}) {\n  execFileSync(command, args, {\n    cwd: rootDir,\n    env: process.env,\n    stdio: 'inherit',\n    ...options\n  })\n}\n\nfunction assertWaylandHost() {\n  if (process.platform !== 'linux') {\n    throw new Error('Wayland GPU sandbox validation must run on Linux.')\n  }\n  if (\n    !process.env.WAYLAND_DISPLAY &&\n    process.env.XDG_SESSION_TYPE !== 'wayland' &&\n    process.env.ELECTRON_OZONE_PLATFORM_HINT !== 'wayland'\n  ) {\n    throw new Error('Wayland GPU sandbox validation requires a Wayland session.')\n  }\n}\n\nfunction ensureElectronRuntime() {\n  run(process.execPath, ['config/scripts/ensure-native-runtime.mjs', '--runtime=electron'])\n}\n\nfunction buildAppIfNeeded() {\n  if (process.env.SKIP_BUILD === '1' && existsSync(outMain)) {\n    console.log('[wayland-gpu] SKIP_BUILD=1 and out/main/index.js exists; skipping build.')\n    return\n  }\n  run('npx', ['electron-vite', 'build', '--mode', 'e2e'])\n}\n\nfunction createGitRepo() {\n  const repoDir = mkdtempSync(path.join(tmpdir(), 'orca-wayland-gpu-repo-'))\n  run('git', ['init'], { cwd: repoDir, stdio: 'pipe' })","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/verify-linux-wayland-gpu-sandbox.mjs#L55-L91","documentation":"Even on Linux, the script requires an actual Wayland session — at least one of WAYLAND_DISPLAY, XDG_SESSION_TYPE=wayland, or ELECTRON_OZONE_PLATFORM_HINT=wayland must be set. Without a Wayland session Electron would fall back to X11 and the GPU-sandbox code path under test would never execute, making the validation meaningless. This is the second guard, after the platform check.","triggerScenarios":"All three of !WAYLAND_DISPLAY, XDG_SESSION_TYPE !== 'wayland', and ELECTRON_OZONE_PLATFORM_HINT !== 'wayland' hold at line 68-72. Happens on an X11 Linux session, a headless container without a Wayland compositor, or SSH with no display.","commonSituations":"Running on a standard X11 desktop; a CI container with no compositor; an SSH session where neither variable is exported.","solutions":["Run inside a Wayland session (log into a Wayland desktop, or start weston/sway in the container).","Export ELECTRON_OZONE_PLATFORM_HINT=wayland (and a real WAYLAND_DISPLAY) if running under a nested compositor.","Ensure XDG_SESSION_TYPE reflects the actual session type."],"exampleFix":"# before (headless / X11)\nnode config/scripts/verify-linux-wayland-gpu-sandbox.mjs\n# after (nested weston)\nweston --width=1280 --height=800 &\nexport WAYLAND_DISPLAY=wayland-1\nexport ELECTRON_OZONE_PLATFORM_HINT=wayland\nnode config/scripts/verify-linux-wayland-gpu-sandbox.mjs","handlingStrategy":"validation","validationCode":"const hasWayland =\n  !!process.env.WAYLAND_DISPLAY ||\n  process.env.XDG_SESSION_TYPE === 'wayland' ||\n  process.env.ELECTRON_OZONE_PLATFORM_HINT === 'wayland'\nif (!hasWayland) {\n  console.error('Start a Wayland session (weston/sway) and export WAYLAND_DISPLAY')\n  process.exit(1)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run the script inside a real or nested Wayland compositor (weston/sway).","Export ELECTRON_OZONE_PLATFORM_HINT=wayland for nested setups."],"tags":["wayland","environment","linux","gpu-sandbox","session"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}