From 517f57c7d4b7953d71a81b8f2b90e8ef3e9b2226 Mon Sep 17 00:00:00 2001 From: Kenny Kerr Date: Fri, 24 May 2024 10:39:22 -0500 Subject: [PATCH 01/10] windows-2022 --- .github/workflows/clippy.yml | 2 +- .github/workflows/debugger_visualizer.yml | 2 +- .github/workflows/lib.yml | 2 +- .github/workflows/msrv-windows.yml | 2 +- .github/workflows/no-default-features.yml | 2 +- .github/workflows/raw_dylib.yml | 2 +- .github/workflows/test.yml | 2 +- crates/tools/yml/src/main.rs | 6 +++--- 8 files changed, 10 insertions(+), 10 deletions(-) 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..b4f85687b0 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 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: From 743e33e3074621ea9ab2589e19af20dcf61ab0cc Mon Sep 17 00:00:00 2001 From: Kenny Kerr Date: Fri, 24 May 2024 10:55:32 -0500 Subject: [PATCH 02/10] 2019 paths --- .github/actions/fix-environment/action.yml | 6 +++--- .github/workflows/lib.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/fix-environment/action.yml b/.github/actions/fix-environment/action.yml index 30ca782cdf..ff3f086171 100644 --- a/.github/actions/fix-environment/action.yml +++ b/.github/actions/fix-environment/action.yml @@ -27,19 +27,19 @@ 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") + ((Resolve-Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\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") + ((Resolve-Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\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") + ((Resolve-Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\*\bin\Hostx64\x64") | Sort-Object -Descending | Select -First 1).ToString() >> $env:GITHUB_PATH } "*" diff --git a/.github/workflows/lib.yml b/.github/workflows/lib.yml index b4f85687b0..08074e2a69 100644 --- a/.github/workflows/lib.yml +++ b/.github/workflows/lib.yml @@ -30,19 +30,19 @@ jobs: - name: Build i686_msvc shell: cmd run: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat" x86 + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\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 "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\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 "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars32.bat" amd64_arm64 cargo run -p tool_msvc - name: Upload libs From 400310d1c5f871719b2f9f8022de9934de1759ef Mon Sep 17 00:00:00 2001 From: Rafael Rivera Date: Fri, 24 May 2024 11:45:07 -0700 Subject: [PATCH 03/10] llvm workaround --- .github/actions/fix-environment/action.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/actions/fix-environment/action.yml b/.github/actions/fix-environment/action.yml index ff3f086171..673ea62633 100644 --- a/.github/actions/fix-environment/action.yml +++ b/.github/actions/fix-environment/action.yml @@ -3,6 +3,14 @@ description: GitHub VMs aren't configured correctly runs: using: "composite" steps: + # Workaround to address two issues with windows-2022 runners: + # 1. Old mingw-w64-* binutils that prevent deterministic builds. + # 2. Missing llvm-dlltool in the native Windows LLVM package. + - name: Update packages + shell: pwsh + run: | + pacman -S --noconfirm mingw-w64-x86_64-binutils + pacman -S --noconfirm mingw-w64-x86_64-llvm - name: Configure Cargo for GNU shell: pwsh run: | From f96f0ecd6fd22acc45602cd1c598520867273a7e Mon Sep 17 00:00:00 2001 From: Rafael Rivera Date: Fri, 24 May 2024 12:04:51 -0700 Subject: [PATCH 04/10] reorder --- .github/actions/fix-environment/action.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/actions/fix-environment/action.yml b/.github/actions/fix-environment/action.yml index 673ea62633..aaf93158f3 100644 --- a/.github/actions/fix-environment/action.yml +++ b/.github/actions/fix-environment/action.yml @@ -3,14 +3,6 @@ description: GitHub VMs aren't configured correctly runs: using: "composite" steps: - # Workaround to address two issues with windows-2022 runners: - # 1. Old mingw-w64-* binutils that prevent deterministic builds. - # 2. Missing llvm-dlltool in the native Windows LLVM package. - - name: Update packages - shell: pwsh - run: | - pacman -S --noconfirm mingw-w64-x86_64-binutils - pacman -S --noconfirm mingw-w64-x86_64-llvm - name: Configure Cargo for GNU shell: pwsh run: | @@ -58,3 +50,11 @@ runs: >> $env:GITHUB_ENV } } + # Workaround to address two issues with windows-2022 runners: + # 1. Old mingw-w64-* binutils that prevent deterministic builds. + # 2. Missing llvm-dlltool in the native Windows LLVM package. + - name: Update packages + shell: pwsh + run: | + pacman -S --noconfirm mingw-w64-x86_64-binutils + pacman -S --noconfirm mingw-w64-x86_64-llvm From c9645f29407bb43d62094ad167dcf3064d086161 Mon Sep 17 00:00:00 2001 From: Rafael Rivera Date: Fri, 24 May 2024 12:16:38 -0700 Subject: [PATCH 05/10] shell --- .github/actions/fix-environment/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/fix-environment/action.yml b/.github/actions/fix-environment/action.yml index aaf93158f3..7a1fdd2377 100644 --- a/.github/actions/fix-environment/action.yml +++ b/.github/actions/fix-environment/action.yml @@ -54,7 +54,7 @@ runs: # 1. Old mingw-w64-* binutils that prevent deterministic builds. # 2. Missing llvm-dlltool in the native Windows LLVM package. - name: Update packages - shell: pwsh + shell: bash run: | pacman -S --noconfirm mingw-w64-x86_64-binutils pacman -S --noconfirm mingw-w64-x86_64-llvm From 682bc2c267ef50873260c0a52053dba74d4e6b23 Mon Sep 17 00:00:00 2001 From: Rafael Rivera Date: Fri, 24 May 2024 12:22:48 -0700 Subject: [PATCH 06/10] explicit --- .github/actions/fix-environment/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/fix-environment/action.yml b/.github/actions/fix-environment/action.yml index 7a1fdd2377..c693828408 100644 --- a/.github/actions/fix-environment/action.yml +++ b/.github/actions/fix-environment/action.yml @@ -54,7 +54,7 @@ runs: # 1. Old mingw-w64-* binutils that prevent deterministic builds. # 2. Missing llvm-dlltool in the native Windows LLVM package. - name: Update packages - shell: bash + shell: pwsh run: | - pacman -S --noconfirm mingw-w64-x86_64-binutils - pacman -S --noconfirm mingw-w64-x86_64-llvm + 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 From 98fbe7b9cb4934132f79e0630063729e29e6d665 Mon Sep 17 00:00:00 2001 From: Rafael Rivera Date: Fri, 24 May 2024 13:22:13 -0700 Subject: [PATCH 07/10] gcc --- .github/actions/fix-environment/action.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/actions/fix-environment/action.yml b/.github/actions/fix-environment/action.yml index c693828408..e067fdace0 100644 --- a/.github/actions/fix-environment/action.yml +++ b/.github/actions/fix-environment/action.yml @@ -50,11 +50,14 @@ runs: >> $env:GITHUB_ENV } } - # Workaround to address two issues with windows-2022 runners: - # 1. Old mingw-w64-* binutils that prevent deterministic builds. - # 2. Missing llvm-dlltool in the native Windows LLVM package. + # 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 From b10723afb8a6cf073e94ba5d0ba5e8f799c42bbe Mon Sep 17 00:00:00 2001 From: Rafael Rivera Date: Fri, 24 May 2024 14:15:47 -0700 Subject: [PATCH 08/10] vswhere --- .github/actions/fix-environment/action.yml | 9 ++++++--- .github/workflows/lib.yml | 16 ++++++++++++---- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/actions/fix-environment/action.yml b/.github/actions/fix-environment/action.yml index e067fdace0..b419985903 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 = & 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe' ` + -latest -property installationPath -format value + switch -Wildcard ("${{ matrix.target }}") { "*-pc-windows-gnu" @@ -27,19 +30,19 @@ runs: "i686*" { "C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x86" >> $env:GITHUB_PATH - ((Resolve-Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\*\bin\Hostx86\x86") + ((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\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\*\bin\Hostx64\x64") + ((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\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\*\bin\Hostx64\x64") + ((Resolve-Path "$vs_root\VC\Tools\MSVC\*\bin\Hostx64\x64") | Sort-Object -Descending | Select -First 1).ToString() >> $env:GITHUB_PATH } "*" diff --git a/.github/workflows/lib.yml b/.github/workflows/lib.yml index 08074e2a69..961bb8669c 100644 --- a/.github/workflows/lib.yml +++ b/.github/workflows/lib.yml @@ -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 = & 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe' ` + -latest -property installationPath -format value + Write-Output "install_path=$path" >> $env::GITHUB_OUTPUT + - name: Build i686_msvc shell: cmd run: | - call "C:\Program Files\Microsoft Visual Studio\2022\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\Microsoft Visual Studio\2022\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\Microsoft Visual Studio\2022\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 = @( From eac43d93b71903ca75bff179ff80a420a173662e Mon Sep 17 00:00:00 2001 From: Rafael Rivera Date: Fri, 24 May 2024 15:50:26 -0700 Subject: [PATCH 09/10] output --- .github/workflows/lib.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lib.yml b/.github/workflows/lib.yml index 961bb8669c..7759841e58 100644 --- a/.github/workflows/lib.yml +++ b/.github/workflows/lib.yml @@ -33,7 +33,7 @@ jobs: run: | $path = & 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe' ` -latest -property installationPath -format value - Write-Output "install_path=$path" >> $env::GITHUB_OUTPUT + "install_path=$path" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - name: Build i686_msvc shell: cmd From a8d0ddbf46312047281b3ce0e953e196facac992 Mon Sep 17 00:00:00 2001 From: Rafael Rivera Date: Fri, 24 May 2024 16:22:06 -0700 Subject: [PATCH 10/10] program files --- .github/actions/fix-environment/action.yml | 10 +++++----- .github/workflows/lib.yml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/fix-environment/action.yml b/.github/actions/fix-environment/action.yml index b419985903..87e2d5464d 100644 --- a/.github/actions/fix-environment/action.yml +++ b/.github/actions/fix-environment/action.yml @@ -18,7 +18,7 @@ runs: - name: Configure environment shell: pwsh run: | - $vs_root = & 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe' ` + $vs_root = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" ` -latest -property installationPath -format value switch -Wildcard ("${{ matrix.target }}") @@ -29,19 +29,19 @@ runs: } "i686*" { - "C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x86" >> $env:GITHUB_PATH + "${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 + "${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 + "${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 } @@ -49,7 +49,7 @@ runs: { (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 } } diff --git a/.github/workflows/lib.yml b/.github/workflows/lib.yml index 7759841e58..15367212c9 100644 --- a/.github/workflows/lib.yml +++ b/.github/workflows/lib.yml @@ -31,7 +31,7 @@ jobs: id: visual-studio shell: pwsh run: | - $path = & 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe' ` + $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