From beefeaf9d7e865a4a4e1d5823dfdce08904d8bc6 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Thu, 30 Jul 2026 14:31:27 +0200 Subject: [PATCH] fix(ci/windows-host): refuse to pack an installer that is missing a payload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every payload the job bundles is now asserted before packing: the console, the bun runtime, the plugin runner, the FFmpeg DLLs and VB-CABLE. Each is optional to pack-host-installer.ps1 — right for a local debug pack, and the reason 0.22.1 and 0.22.2 shipped with no web console: one unset variable omitted it behind a single line of log and the build stayed green. CI knows it bundles all five, so a missing input belongs here as a failure rather than downstream as a quietly smaller installer. FFmpeg is the one that would hurt most and was silent too: an amf-qsv host link-imports avcodec, so an installer missing those DLLs ships a host that cannot start at all, and FFMPEG_DIR is a fallback to a provisioned path that nothing verified. The shape is borrowed from the packer's own VB-CABLE check, which already throws on a supplied-but-empty dir "instead of silently shipping an installer without the virtual mic - exactly the field regression this bundling fixes". Same lesson, applied to the rest. Both paths were exercised on the Windows runner: all five unset fails with exit 1 naming each one, all five present passes with exit 0. Co-Authored-By: Claude Fable 5 --- .gitea/workflows/windows-host.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.gitea/workflows/windows-host.yml b/.gitea/workflows/windows-host.yml index 04b033d9..0b63931f 100644 --- a/.gitea/workflows/windows-host.yml +++ b/.gitea/workflows/windows-host.yml @@ -391,6 +391,33 @@ jobs: # error 3)" and took the whole job with it. ~1 min of rebuild is the correct price; the # same rotation is why the other Windows jobs use a fixed C:\t instead of a cached # workspace-relative target. + # Every payload this job is SUPPOSED to bundle, asserted before packing. The packer treats each + # one as optional — correct for a local debug pack, and the reason 0.22.1/0.22.2 shipped with no + # web console: an unset WEB_OUTPUT_DIR omitted it behind a single Write-Host. CI knows it bundles + # all of these, so here a missing input is a build failure rather than a quietly smaller + # installer. (pack-host-installer.ps1 already does this for VB-CABLE, for the same reason.) + - name: Verify every installer payload is present + shell: pwsh + run: | + $need = @( + @{ n = 'web console (WEB_OUTPUT_DIR)'; p = $env:WEB_OUTPUT_DIR; f = 'server\index.mjs' } + @{ n = 'bun runtime (BUN_EXE)'; p = $env:BUN_EXE; f = '' } + @{ n = 'plugin runner (SCRIPTING_BUNDLE)';p = $env:SCRIPTING_BUNDLE; f = '' } + @{ n = 'FFmpeg DLLs (FFMPEG_DIR\bin)'; p = $env:FFMPEG_DIR; f = 'bin' } + @{ n = 'VB-CABLE (VBCABLE_DIR)'; p = $env:VBCABLE_DIR; f = 'VBCABLE_Setup_x64.exe' } + ) + $missing = @() + foreach ($x in $need) { + if (-not $x.p) { $missing += "$($x.n): env var not set"; continue } + $full = if ($x.f) { Join-Path $x.p $x.f } else { $x.p } + if (-not (Test-Path $full)) { $missing += "$($x.n): missing $full" } + else { Write-Output "payload OK - $($x.n) -> $full" } + } + if ($missing.Count) { + $missing | ForEach-Object { Write-Output "MISSING PAYLOAD - $_" } + throw "$($missing.Count) installer payload(s) missing - refusing to ship an incomplete installer" + } + - name: Pack + sign installer shell: pwsh env: