Fix Windows preflight command-source logging escapes.

Replace embedded subexpression interpolation in the dockerized PowerShell preflight checks with format strings so command source logging does not break script parsing.
This commit is contained in:
Vijay Janapa Reddi
2026-03-06 08:04:36 -05:00
parent 2ce2919be8
commit 60cffb80b7

View File

@@ -480,12 +480,12 @@ jobs:
}
}
Invoke-Check 'quarto on PATH' { `$resolved = Get-Command quarto -ErrorAction Stop; Write-Host \" quarto -> `$(`$resolved.Source)\" }
Invoke-Check 'quarto on PATH' { `$resolved = Get-Command quarto -ErrorAction Stop; Write-Host (\" quarto -> {0}\" -f `$resolved.Source) }
Invoke-Check 'quarto version' { quarto --version | Select-Object -First 1 }
Invoke-Check 'pandoc available' {
`$pandocCmd = Get-Command pandoc -ErrorAction SilentlyContinue
if (`$pandocCmd) {
Write-Host \" pandoc -> `$(`$pandocCmd.Source)\"
Write-Host (\" pandoc -> {0}\" -f `$pandocCmd.Source)
} else {
quarto pandoc --version | Select-Object -First 1 | Out-Null
Write-Host \" pandoc -> bundled via quarto\"
@@ -499,24 +499,24 @@ jobs:
quarto pandoc --version | Select-Object -First 1
}
}
Invoke-Check 'python on PATH' { `$resolved = Get-Command python -ErrorAction Stop; Write-Host \" python -> `$(`$resolved.Source)\" }
Invoke-Check 'python on PATH' { `$resolved = Get-Command python -ErrorAction Stop; Write-Host (\" python -> {0}\" -f `$resolved.Source) }
Invoke-Check 'python version' { python --version }
Invoke-Check 'python3 on PATH' { `$resolved = Get-Command python3 -ErrorAction Stop; Write-Host \" python3 -> `$(`$resolved.Source)\" }
Invoke-Check 'python3 on PATH' { `$resolved = Get-Command python3 -ErrorAction Stop; Write-Host (\" python3 -> {0}\" -f `$resolved.Source) }
Invoke-Check 'python3 version' { python3 --version }
Invoke-Check 'mlsysim import' { python -c 'import mlsysim,sys; print(\"mlsysim:\", mlsysim.__file__); print(\"python:\", sys.executable)' }
Invoke-Check 'Rscript on PATH' { `$resolved = Get-Command Rscript -ErrorAction Stop; Write-Host \" Rscript -> `$(`$resolved.Source)\" }
Invoke-Check 'Rscript on PATH' { `$resolved = Get-Command Rscript -ErrorAction Stop; Write-Host (\" Rscript -> {0}\" -f `$resolved.Source) }
Invoke-Check 'Rscript version' { Rscript --version | Select-Object -First 1 }
Invoke-Check 'inkscape on PATH' { `$resolved = Get-Command inkscape -ErrorAction Stop; Write-Host \" inkscape -> `$(`$resolved.Source)\" }
Invoke-Check 'inkscape on PATH' { `$resolved = Get-Command inkscape -ErrorAction Stop; Write-Host (\" inkscape -> {0}\" -f `$resolved.Source) }
Invoke-Check 'inkscape version' { inkscape --version | Select-Object -First 1 }
if ('${{ matrix.format_name }}' -eq 'PDF') {
Invoke-Check 'lualatex on PATH' { `$resolved = Get-Command lualatex -ErrorAction Stop; Write-Host \" lualatex -> `$(`$resolved.Source)\" }
Invoke-Check 'lualatex on PATH' { `$resolved = Get-Command lualatex -ErrorAction Stop; Write-Host (\" lualatex -> {0}\" -f `$resolved.Source) }
Invoke-Check 'lualatex version' { lualatex --version | Select-Object -First 1 }
Invoke-Check 'ghostscript on PATH' {
`$gsCmd = Get-Command gs -ErrorAction SilentlyContinue
if (-not `$gsCmd) { `$gsCmd = Get-Command gswin64c -ErrorAction SilentlyContinue }
if (-not `$gsCmd) { throw 'Ghostscript not found (expected gs or gswin64c)' }
Write-Host \" ghostscript -> `$(`$gsCmd.Source)\"
Write-Host (\" ghostscript -> {0}\" -f `$gsCmd.Source)
}
Invoke-Check 'ghostscript version' {
`$gsCmd = Get-Command gs -ErrorAction SilentlyContinue