Setup on windows-2019 fails with: "Could not find a part of the path 'D:\Include\ucrt\module.modulemap'."
My Windows ci.yml just started failing yesterday (since https://github.com/compnerd/gha-setup-swift/commit/17be5ca66ad69b44177f01b6b0b23575d3d7791a):
windows:
runs-on: windows-2019
steps:
- uses: compnerd/gha-setup-swift@main
with:
branch: swift-5.9-release
tag: 5.9-RELEASE
- uses: actions/checkout@v4
- run: swift test
Here's the error:
install: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise
vsdevcmd: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\vsdevcmd.bat
$ cmd /q /k C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\vsdevcmd.bat -arch=amd64 && set
environment updated
Run Copy-Item "$env:SDKROOT\usr\share\ucrt.modulemap" -destination "$env:UniversalCRTSdkDir\Include\$env:UCRTVersion\ucrt\module.modulemap"
Copy-Item: D:\a\_temp\bce433de-ba56-4c96-a620-b77ea2e737f3.ps1:2
Line |
2 | Copy-Item "$env:SDKROOT\usr\share\ucrt.modulemap" -destination "$env: …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Could not find a part of the path 'D:\Include\ucrt\module.modulemap'.
Error: Process completed with exit code 1.
That implies that $env:UniversalCRTSdkDir and $env:UCRTVersion are undefined. This would imply that the gha-setup-vsdevenv didn't trigger or saving the environment went wrong.
@marcprux can you point me to one of the failing runs?
@marcprux can you point me to one of the failing runs?
Here's a failure with windows-2019: https://github.com/skiptools/swift-sqlcipher/actions/runs/14509591122
Then I bumped it to windows-2022 (and Swift 6.1, but I doubt that is relevant) and it passed: https://github.com/skiptools/swift-sqlcipher/actions/runs/14515775453
In case it helps, I had a similar issue and bumping to windows-2022 did not fix the issue for me, but switching to Swift 6.1 seems to have...
See windows-2022 with swift-6.0 which failed at https://github.com/drmohundro/SWXMLHash/actions/runs/16005946083/job/45152541496
And see windows-2022 with swift-6.1 which succeeded at https://github.com/drmohundro/SWXMLHash/actions/runs/16006037532/job/45152845289
I ended up removing swift-5.10 for now.