diff --git a/.gitea/workflows/build-windows.yml b/.gitea/workflows/build-windows.yml index 4b40aad06..7f01035cb 100644 --- a/.gitea/workflows/build-windows.yml +++ b/.gitea/workflows/build-windows.yml @@ -33,14 +33,26 @@ jobs: with: submodules: recursive - - name: Show toolchain versions - shell: bash + - name: Verify host toolchain + shell: pwsh run: | - rustc --version - cargo --version - clang --version - flutter --version - python --version + $required = 'node','pwsh','git','bash','python','rustc','cargo','rustup','clang','flutter','nuget','cmake','ninja' + $missing = @() + foreach ($tool in $required) { + $cmd = Get-Command $tool -ErrorAction SilentlyContinue + if (-not $cmd) { $missing += $tool; continue } + $ver = & $tool --version 2>&1 | Select-Object -First 1 + Write-Host ("{0,-10} {1} ({2})" -f $tool, $cmd.Source, $ver) + } + if ($missing.Count -gt 0) { + Write-Error ("Missing tools on runner: {0}. Re-run provision.ps1 or install manually." -f ($missing -join ', ')) + exit 1 + } + if (-not $env:VCPKG_ROOT -or -not (Test-Path "$env:VCPKG_ROOT\vcpkg.exe")) { + Write-Error "VCPKG_ROOT not set or vcpkg.exe missing at $env:VCPKG_ROOT" + exit 1 + } + Write-Host "VCPKG_ROOT $env:VCPKG_ROOT" - name: Install flutter_rust_bridge codegen tools shell: bash diff --git a/ci/runners/windows/provision.ps1 b/ci/runners/windows/provision.ps1 index 903bfc8a1..b3e9c8b20 100644 --- a/ci/runners/windows/provision.ps1 +++ b/ci/runners/windows/provision.ps1 @@ -47,10 +47,14 @@ if (-not (Get-Command choco -ErrorAction SilentlyContinue)) { } Write-Host '==> Installing base packages' -choco install -y --no-progress git python311 nuget.commandline 7zip cmake ninja +# nodejs-lts: act_runner needs node to execute JavaScript actions. +# powershell-core: workflows commonly use `shell: pwsh` (PS 7), not the OS's PS 5.1. +choco install -y --no-progress git python311 nuget.commandline 7zip cmake ninja nodejs-lts powershell-core Add-MachinePath 'C:\Program Files\Git\cmd' Add-MachinePath 'C:\Python311' Add-MachinePath 'C:\Python311\Scripts' +Add-MachinePath 'C:\Program Files\nodejs' +Add-MachinePath 'C:\Program Files\PowerShell\7' # --- 2. Visual Studio 2022 Build Tools (MSVC v143 + Win10 SDK) --- $vsInstaller = "$env:ProgramFiles(x86)\Microsoft Visual Studio\Installer\vswhere.exe"