windows.yml smoke: a direct call with the exit code read, in place of Start-Process -Wait -PassThru that raced a program exiting at once (the 0.3.21 run's failure at the version read-back)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
igneum-labs 2026-10-07 17:02:58 +00:00
parent a9cb968f51
commit deac79eaf2

View file

@ -216,11 +216,13 @@ jobs:
run: |
$payload = Resolve-Path 'packaging\windows\igneum-windows-app'
function Run-Capture([string]$exe, [string]$flag) {
$out = Join-Path $env:RUNNER_TEMP ('smoke-' + [IO.Path]::GetRandomFileName() + '.txt')
$p = Start-Process -FilePath $exe -ArgumentList $flag -Wait -NoNewWindow -PassThru -RedirectStandardOutput $out
$text = if (Test-Path $out) { (Get-Content $out -Raw) } else { '' }
Write-Host ("{0} {1} -> exit {2}: {3}" -f (Split-Path -Leaf $exe), $flag, $p.ExitCode, $text.Trim())
if ($p.ExitCode -ne 0) { throw "$exe $flag exited $($p.ExitCode)" }
# a direct call, not Start-Process -Wait -PassThru: a program that prints and exits at once raced the cmdlet
# ("Cannot process request because the process has exited", 7 October 2026, the 0.3.21 run) and the read-back
# was lost; the host program is a windows-subsystem exe, so its text comes through the same pipe
$text = (& $exe $flag 2>&1 | Out-String)
$code = $LASTEXITCODE
Write-Host ("{0} {1} -> exit {2}: {3}" -f (Split-Path -Leaf $exe), $flag, $code, $text.Trim())
if ($code -ne 0) { throw "$exe $flag exited $code" }
return $text
}
$v = $env:APP_VERSION