From 05b06b1fc10f759ce8c192c4ada130f2c1ac4754 Mon Sep 17 00:00:00 2001 From: foxyz Date: Sat, 10 Oct 2026 00:13:23 +0300 Subject: [PATCH] CI: capture the verbose Windows build through cmd (PowerShell 'Stop' aborted on stderr) Co-Authored-By: Claude Opus 5.5 --- tool/package_windows.ps1 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tool/package_windows.ps1 b/tool/package_windows.ps1 index 654e3013..6abdc316 100644 --- a/tool/package_windows.ps1 +++ b/tool/package_windows.ps1 @@ -31,8 +31,12 @@ if (-not $SkipBuild) { if ($LASTEXITCODE -ne 0) { # Flutter hides MSBuild's messages: rebuild verbosely and show only # the compiler/linker errors, so CI logs say what broke. - $log = flutter build windows --release -v "--dart-define=APP_VERSION=$Version" 2>&1 - $log | Select-String -Pattern 'error C\d+|error LNK\d+|fatal error|: error ' | ForEach-Object { $_.Line } | Select-Object -First 40 + # Through cmd and with 'Continue': under 'Stop' PowerShell aborts on + # the first stderr line of a native command. + $ErrorActionPreference = 'Continue' + $log = cmd /c "flutter build windows --release -v --dart-define=APP_VERSION=$Version 2>&1" + $ErrorActionPreference = 'Stop' + $log | Select-String -Pattern 'error C\d+|error LNK\d+|fatal error|: error |error MSB' | ForEach-Object { $_.Line } | Select-Object -Unique -First 40 throw 'flutter build windows failed' } } finally { Pop-Location }