Make cygwin install non-fatal

Cygwin mirror can be unreachable from Azure VMs. Don't block
the entire bootstrap if cygwin fails to install.

[build images]
This commit is contained in:
Dylan Conway
2026-02-12 17:17:32 -08:00
parent 0cefa2c753
commit 632b5bb2e8

View File

@@ -246,11 +246,16 @@ function Install-Make {
}
function Install-Cygwin {
Install-Scoop-Package cygwin
# Scoop installs to ~/scoop/apps/cygwin/current
$cygwinBin = Join-Path $env:USERPROFILE "scoop\apps\cygwin\current\bin"
if (Test-Path $cygwinBin) {
Add-To-Path $cygwinBin -Scope User
# Cygwin's default mirror (mirrors.kernel.org) can be unreachable from Azure.
# Make this non-fatal — the build will fail later if cygwin is actually needed.
try {
Install-Scoop-Package cygwin
$cygwinBin = Join-Path $env:USERPROFILE "scoop\apps\cygwin\current\bin"
if (Test-Path $cygwinBin) {
Add-To-Path $cygwinBin -Scope User
}
} catch {
Write-Warning "Cygwin installation failed (non-fatal): $_"
}
}