Skip to content

fix(ci): make the Tauri functional gate fail honestly on Windows and macOS - #128

Open
TsekaLuk wants to merge 5 commits into
mainfrom
fix/tauri-functional-gate-windows-and-launch-budget
Open

fix(ci): make the Tauri functional gate fail honestly on Windows and macOS#128
TsekaLuk wants to merge 5 commits into
mainfrom
fix/tauri-functional-gate-windows-and-launch-budget

Conversation

@TsekaLuk

@TsekaLuk TsekaLuk commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Why

Tauri functional macos and Tauri functional windows have been red on every branch since 65441b45c (2026-07-20) — 0 successes in the last 40 runs, including on main and on the v1.4.131 release commit. Both platforms failed with messages that named no cause, so nothing was diagnosable and the two most important desktop platforms went three weeks without a functional gate.

Three separate defects were behind it.

1. Windows: spawnSync npm.cmd fails with EINVAL. Since CVE-2024-27980 Node refuses to spawn a .cmd shim without shell: true. The gate spawned npm/pnpm shims directly, so the Windows job died before doing any work. config/scripts/run-tauri-terminal-evidence.mjs had the same defect, which is the likely real cause behind the two Windows jobs disabled in release-cut.yml as "flaky" / "PTY readiness".

2. macOS: the Rust build ate the evidence budget. The gate gave build + launch + evidence a single 240s deadline. Timeline from the failing run: budget opened 22:25:52, cargo self-reported Finished dev profile ... in 3m 18s at 22:29:11, page loaded 22:29:16, budget expired 22:29:52. The gate got 41 of its 240 seconds. This was starvation, not a hang — but it was reported as timed out after terminal-mounted, which pointed at the terminal.

3. Every wait reported the same thing. The gate has 17 waitFor calls that all threw the bare string real runtime gate timed out. Even once a genuine failure surfaced, it named no condition.

What this changes

  • needsWindowsShell / requiresShellToSpawn: spawn .cmd shims through a shell, at all four spawn sites. Args carry no spaces, so shell: true is safe here.
  • Split the single deadline into GATE_LAUNCH_TIMEOUT_MS (600s, covers the Rust build) and GATE_EVIDENCE_TIMEOUT_MS (240s, starts when the app first writes evidence). Timeout text now distinguishes "never launched" from "launched, then stalled at <stage>".
  • waitFor(read, condition) — the label is a required parameter, so tsc forces all 17 call sites to say what they are waiting for. Failures now read real runtime gate timed out waiting for the shell prompt in PTY <id> to render the working directory.
  • verify-tauri-mainline.mjs rules pin all three, mutation-tested (reverting any single spawn site, widening the deadline back, or making condition optional each fail the verifier).

What this does not do

macOS and Windows are still red, and this PR does not claim otherwise. What changed is that both now fail honestly:

  • macOS previously died to the outer job guillotine with no artifact. It now writes real evidence — {"status":"failed","durationMs":37283,"error":"real runtime gate timed out"} — and with the labels above, the next run will name the specific wait that hung.
  • Windows previously died at EINVAL before doing anything. It now gets through git init / git commit and reaches the Rust build, where it hits a pre-existing problem: pebble-desktop-tauri does not compile on Windows (7 errors — E0583 module path, E0425/E0433 PWSTR not in scope, E0277 NonNull<c_void> not Send, E0593 ×2 closure arity, E0004 non-exhaustive NativeBrowserInterceptDecision::Pause). Filed as pebble-desktop-tauri does not compile on Windows (7 errors) #130 with per-error root causes; two of them need design decisions about WebView2 UI-thread affinity that cannot be compile-checked from macOS. No user-facing artifact is affected — tauri-desktop-release.yml:68-78 comments the windows-x64 matrix entry out, so Pebble ships macOS + Linux only.

The disabled Windows jobs in release-cut.yml are deliberately not re-enabled here; that should wait until Windows compiles.

verify and both Linux gates are green.

The `Tauri functional macos` and `Tauri functional windows` jobs have been
red on main since 2026-07-20, for two unrelated reasons.

Windows: `command()` maps `npm` to `npm.cmd`, but since CVE-2024-27980 Node
refuses to spawn a `.cmd` shim without a shell, so every spawn died with
`spawnSync npm.cmd EINVAL` before the app was built. Pass `shell` for the
shim commands only; their args carry no spaces for cmd.exe to mangle.
`run-tauri-terminal-evidence.mjs` had the same defect, which is the likely
cause behind the two Windows release-cut jobs disabled as "flaky".

macOS: the 240s evidence budget started before `npm run tauri:functional:shell`
compiled the Rust shell. Cargo reported `Finished dev profile in 3m 18s`, so
the gate got 41s of its 240s, reached `terminal-mounted`, and reported a
timeout naming whatever stage it happened to die on. Time build-and-launch
separately from evidence, and say which of the two ran out.
The gate had 17 identical waits that all threw "real runtime gate timed
out", so the macOS failure reported nothing about where it hung and went
undiagnosed for three weeks. Make the label a required parameter so tsc
forces every call site to say what it is waiting for.
@TsekaLuk TsekaLuk changed the title fix(ci): unblock the Tauri functional gate on Windows and macOS fix(ci): make the Tauri functional gate fail honestly on Windows and macOS Aug 10, 2026
@TsekaLuk TsekaLuk closed this Aug 10, 2026
@TsekaLuk TsekaLuk reopened this Aug 10, 2026
…gate-windows-and-launch-budget

# Conflicts:
#	config/scripts/verify-tauri-mainline.mjs
… text

The wait read the terminal for a working directory, which exists only when
the runner's shell config prints one: the Linux image does, the macOS image
runs zsh with no rc file and a host-only prompt, so the check could never
pass there. That is the whole of the three-week macOS red. Probe by running
a command and reading the runtime tail, which no prompt format can hide.
The macOS trusted-input evidence polled the guest before its child WebView
attached a native label, and the resulting "Guest not ready" throw killed the
run. It surfaced only once the terminal probe stopped failing first. Tolerate
that one transient message so a real evaluation error still surfaces.
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.

1 participant