diff --git a/.github/actions/fix-environment/action.yml b/.github/actions/fix-environment/action.yml index 30ca782cdf..87e2d5464d 100644 --- a/.github/actions/fix-environment/action.yml +++ b/.github/actions/fix-environment/action.yml @@ -18,6 +18,9 @@ runs: - name: Configure environment shell: pwsh run: | + $vs_root = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" ` + -latest -property installationPath -format value + switch -Wildcard ("${{ matrix.target }}") { "*-pc-windows-gnu" @@ -26,27 +29,38 @@ runs: } "i686*" { - "C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x86" >> $env:GITHUB_PATH - ((Resolve-Path "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\*\bin\Hostx86\x86") + "${env:ProgramFiles(x86)}\Windows Kits\10\bin\10.0.22000.0\x86" >> $env:GITHUB_PATH + ((Resolve-Path "$vs_root\VC\Tools\MSVC\*\bin\Hostx86\x86") | Sort-Object -Descending | Select -First 1).ToString() >> $env:GITHUB_PATH } "x86_64*" { - "C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64" >> $env:GITHUB_PATH - ((Resolve-Path "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\*\bin\Hostx64\x64") + "${env:ProgramFiles(x86)}\Windows Kits\10\bin\10.0.22000.0\x64" >> $env:GITHUB_PATH + ((Resolve-Path "$vs_root\VC\Tools\MSVC\*\bin\Hostx64\x64") | Sort-Object -Descending | Select -First 1).ToString() >> $env:GITHUB_PATH } "aarch64*" { - "C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64" >> $env:GITHUB_PATH - ((Resolve-Path "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\*\bin\Hostx64\x64") + "${env:ProgramFiles(x86)}\Windows Kits\10\bin\10.0.22000.0\x64" >> $env:GITHUB_PATH + ((Resolve-Path "$vs_root\VC\Tools\MSVC\*\bin\Hostx64\x64") | Sort-Object -Descending | Select -First 1).ToString() >> $env:GITHUB_PATH } "*" { (Join-Path $env:GITHUB_WORKSPACE "target\debug\deps").ToString() >> $env:GITHUB_PATH (Join-Path $env:GITHUB_WORKSPACE "target\test\debug\deps").ToString() >> $env:GITHUB_PATH - "INCLUDE=C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" ` + "INCLUDE=${env:ProgramFiles(x86)}\Windows Kits\10\include\10.0.22000.0\winrt;${env:ProgramFiles(x86)}\Windows Kits\10\include\10.0.22000.0\cppwinrt" ` >> $env:GITHUB_ENV } } + # Workaround to address several issues with windows-2022 runners: + # - Old mingw-w64-* binutils that prevent deterministic builds. + # - Missing llvm-dlltool in the native Windows LLVM package. + # - Missing mingw-w64 compiler packages. + - name: Update packages + shell: pwsh + run: | + C:\msys64\usr\bin\pacman.exe -S --noconfirm mingw-w64-x86_64-binutils + C:\msys64\usr\bin\pacman.exe -S --noconfirm mingw-w64-x86_64-llvm + C:\msys64\usr\bin\pacman.exe -S --noconfirm mingw-w64-i686-gcc + C:\msys64\usr\bin\pacman.exe -S --noconfirm mingw-w64-x86_64-gcc diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 38dda4ca3a..189ea46770 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -13,7 +13,7 @@ env: jobs: check: - runs-on: windows-2019 + runs-on: windows-2022 strategy: matrix: diff --git a/.github/workflows/debugger_visualizer.yml b/.github/workflows/debugger_visualizer.yml index 6df42008b8..856eeeaf6b 100644 --- a/.github/workflows/debugger_visualizer.yml +++ b/.github/workflows/debugger_visualizer.yml @@ -13,7 +13,7 @@ env: jobs: check: - runs-on: windows-2019 + runs-on: windows-2022 strategy: matrix: diff --git a/.github/workflows/lib.yml b/.github/workflows/lib.yml index 3f76c20db8..15367212c9 100644 --- a/.github/workflows/lib.yml +++ b/.github/workflows/lib.yml @@ -13,7 +13,7 @@ env: jobs: check: - runs-on: windows-2019 + runs-on: windows-2022 steps: - name: Checkout uses: actions/checkout@v4 @@ -27,22 +27,30 @@ jobs: set PATH=C:\msys64\mingw64\bin;%PATH% cargo run -p tool_gnu -- all + - name: Find Visual Studio + id: visual-studio + shell: pwsh + run: | + $path = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" ` + -latest -property installationPath -format value + "install_path=$path" | Out-File -FilePath $env:GITHUB_OUTPUT -Append + - name: Build i686_msvc shell: cmd run: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat" x86 + call "${{steps.visual-studio.outputs.install_path}}\VC\Auxiliary\Build\vcvars32.bat" x86 cargo run -p tool_msvc - name: Build x86_64_msvc shell: cmd run: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat" amd64 + call "${{steps.visual-studio.outputs.install_path}}\VC\Auxiliary\Build\vcvars32.bat" amd64 cargo run -p tool_msvc - name: Build aarch64_msvc shell: cmd run: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat" amd64_arm64 + call "${{steps.visual-studio.outputs.install_path}}\VC\Auxiliary\Build\vcvars32.bat" amd64_arm64 cargo run -p tool_msvc - name: Upload libs @@ -60,7 +68,7 @@ jobs: - name: Check dumpbin shell: pwsh run: | - $VisualStudioRoot = & vswhere -latest -property installationPath -format value + $VisualStudioRoot = "${{steps.visual-studio.outputs.install_path}}" $DumpbinPath = Resolve-Path "$VisualStudioRoot\VC\Tools\MSVC\*\bin\*\x86\dumpbin.exe" | Select -ExpandProperty Path -First 1 $Tests = @( diff --git a/.github/workflows/msrv-windows.yml b/.github/workflows/msrv-windows.yml index faeb6202aa..ebd08bc1c4 100644 --- a/.github/workflows/msrv-windows.yml +++ b/.github/workflows/msrv-windows.yml @@ -17,7 +17,7 @@ jobs: matrix: rust: [1.70.0, stable, nightly] runs-on: - - windows-2019 + - windows-2022 - ubuntu-latest runs-on: ${{ matrix.runs-on }} steps: diff --git a/.github/workflows/no-default-features.yml b/.github/workflows/no-default-features.yml index 23e7ce54cf..4c12533e62 100644 --- a/.github/workflows/no-default-features.yml +++ b/.github/workflows/no-default-features.yml @@ -13,7 +13,7 @@ env: jobs: check: - runs-on: windows-2019 + runs-on: windows-2022 strategy: matrix: diff --git a/.github/workflows/raw_dylib.yml b/.github/workflows/raw_dylib.yml index 6cd27939ad..7ff54f8ad9 100644 --- a/.github/workflows/raw_dylib.yml +++ b/.github/workflows/raw_dylib.yml @@ -13,7 +13,7 @@ env: jobs: check: - runs-on: windows-2019 + runs-on: windows-2022 strategy: matrix: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index db5d776699..04a71b28d3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ env: jobs: check: - runs-on: windows-2019 + runs-on: windows-2022 strategy: matrix: diff --git a/crates/tools/yml/src/main.rs b/crates/tools/yml/src/main.rs index 5d31d0b624..c60e79865c 100644 --- a/crates/tools/yml/src/main.rs +++ b/crates/tools/yml/src/main.rs @@ -22,7 +22,7 @@ env: jobs: check: - runs-on: windows-2019 + runs-on: windows-2022 strategy: matrix: @@ -119,7 +119,7 @@ env: jobs: check: - runs-on: windows-2019 + runs-on: windows-2022 strategy: matrix: @@ -171,7 +171,7 @@ env: jobs: check: - runs-on: windows-2019 + runs-on: windows-2022 strategy: matrix: