Skip to content

fix: download pinned laufey archives directly for CI prewarm - #1

Merged
iownbey merged 30 commits into
mainfrom
copilot/laufey-fix
Aug 9, 2026
Merged

fix: download pinned laufey archives directly for CI prewarm#1
iownbey merged 30 commits into
mainfrom
copilot/laufey-fix

Conversation

Copilot AI commented Aug 9, 2026

Copy link
Copy Markdown

The laufey prewarm step was invoking deno desktop with the freshly built PR binary, which forced desktop runtime resolution through libdenort and fell back to a canary download keyed by the PR merge SHA. On Linux, that path always 404s because PR SHAs do not have canary desktop artifacts.

  • What changed

    • Reworked tools/download_laufey.ts to fetch the pinned laufey backend archive directly from the laufey GitHub release instead of compiling a dummy desktop app.
    • Kept the existing CLI contract:
      • deno run -A tools/download_laufey.ts [backend] [cache_dir]
      • default backend remains cef (webview on Windows)
  • Version / target / artifact resolution

    • Reads the pinned laufey version from cli/laufey_sums.lock (# version: vX.Y.Z).
    • Derives the native target triple from Deno.build.
    • Resolves the upstream artifact name exactly as laufey publishes it, including the raw -> winit archive mapping and Windows .zip handling.
  • Integrity and cache layout

    • Looks up the archive SHA-256 in cli/laufey_sums.lock and verifies the downloaded bytes before extraction.
    • Extracts into the same shared cache layout LaufeyBackendResolver already expects, including the .downloaded marker:
      <cache>/<version>/<backend>/<target>/
      
  • Focused coverage

    • Added targeted tests for:
      • pinned version parsing
      • SHA lookup from cli/laufey_sums.lock
      • target triple derivation
      • archive name selection
      • cache path layout generation
  • Example

    const version = parsePinnedVersion(lockContents);
    const target = laufeyTargetForBuild(Deno.build);
    const archive = laufeyArchiveName(backend, target);
    const url =
      `https://github.com/littledivy/laufey/releases/download/v${version}/${archive}`;

iownbey and others added 26 commits August 6, 2026 07:44
The existing tests assert the Linux app-dir layout (./<app>/<app>), which
macOS doesn't produce — macOS packages a .app bundle instead, and its
packaging path doesn't consume --backend-args at all (backend args only
reach the HMR launch path and the Linux/Windows/self-extracting launchers).

- Gate launcher + malformed-args compile tests to "linux"
- Cover malformed-args on macOS via the --hmr path, which does parse them
- Add macOS tests asserting the .app bundle is packaged successfully
  (CLI flag and deno.json config variants)
packages_macos_app_bundle_config compiles ./hello2, so its Bundle line
says hello2.app — it can't share desktop_mac.out (hello.app).
laufey v0.6.1 does not publish a cef build for aarch64-pc-windows-msvc,
so the "Pre-download native laufey" CI step always fails on the
windows aarch64 legs. Default to the webview backend on Windows (both
x86_64 and aarch64 pins exist for it).
laufey v0.6.1 has no cef build for aarch64-pc-windows-msvc, so the
Windows variants exercise the webview backend (which is published and
pinned for both Windows targets). Covers flag forwarding, quoted
spaces, escaped quotes, malformed args, and config-file backendArgs.
The laufey webview backend (all Windows tests use it — v0.6.1 has no
cef aarch64-pc-windows-msvc build) parses only --runtime from argv and
silently drops everything else; unlike cef, which feeds the process
argv into CefMainArgs so extra switches (e.g. --user-agent) reach
Chromium. Launching the packaged app on Windows therefore never makes
the user-agent request the fixture's main.ts waits for, and the test
hangs forever. Drop the exe-launch steps on Windows; packaging alone
still exercises --backend-args parsing, quoting, and baking into the
launcher. The *_windows.out launch fixtures are unused after this —
remove them separately (no API delete available here).
The windows (webview) packaging path reports the quoting error too late
and with different surrounding output than the non-hmr variants, so the
output pattern never matched. Mirror the mac variant: --hmr surfaces the
quoting error at dev-server startup, before any backend download.
Steps that launch a packaged desktop app only exit when the GUI backend
makes its HTTP request to the test server. When the backend can't start
on a CI runner (no usable display/sandbox), the process hangs until the
whole job is cancelled. Set a 60s timeout on every step so the harness
kills the process and fails the test with output instead of stalling.
Co-authored-by: iownbey <54186227+iownbey@users.noreply.github.com>
Copilot AI and others added 3 commits August 9, 2026 19:01
Co-authored-by: iownbey <54186227+iownbey@users.noreply.github.com>
Co-authored-by: iownbey <54186227+iownbey@users.noreply.github.com>
Co-authored-by: iownbey <54186227+iownbey@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix pre-download native laufey step for Linux fix: download pinned laufey archives directly for CI prewarm Aug 9, 2026
Copilot AI requested a review from iownbey August 9, 2026 19:13
@iownbey
iownbey marked this pull request as ready for review August 9, 2026 19:14
@iownbey
iownbey merged commit 17df72d into main Aug 9, 2026
36 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants