Skip to content

Commit 1d5a076

Browse files
committed
CI: select PlatformToolset per runner (x64 v145, ARM64 v143)
The windows-latest x64 runner is on Visual Studio 2026 (toolset v145), but windows-11-arm is still on Visual Studio 2022 (newest toolset v143), so the hardcoded v145 failed ARM64 with MSB8020 (v145 build tools not found). v143 won't work on x64 either, since that image only ships ATL for its default v145 toolset. Add a per-platform toolset matrix field and use it in the native C++ build steps.
1 parent d889eb5 commit 1d5a076

2 files changed

Lines changed: 18 additions & 14 deletions

File tree

.github/workflows/build.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ jobs:
3535
- id: pick
3636
shell: pwsh
3737
run: |
38-
$x64 = '{"runner":"windows-latest","platform":"x64","rid":"win-x64","vcpkg-triplet":"x64-windows-release","install-root":"vcpkg_installed_x64","rust-target":"x86_64-pc-windows-msvc","publish-profile":"win-x64"}'
39-
$arm = '{"runner":"windows-11-arm","platform":"ARM64","rid":"win-arm64","vcpkg-triplet":"arm64-windows-release","install-root":"vcpkg_installed_arm64","rust-target":"aarch64-pc-windows-msvc","publish-profile":"win-ARM64"}'
38+
$x64 = '{"runner":"windows-latest","platform":"x64","rid":"win-x64","vcpkg-triplet":"x64-windows-release","install-root":"vcpkg_installed_x64","rust-target":"x86_64-pc-windows-msvc","publish-profile":"win-x64","toolset":"v145"}'
39+
$arm = '{"runner":"windows-11-arm","platform":"ARM64","rid":"win-arm64","vcpkg-triplet":"arm64-windows-release","install-root":"vcpkg_installed_arm64","rust-target":"aarch64-pc-windows-msvc","publish-profile":"win-ARM64","toolset":"v143"}'
4040
$items = switch ("${{ inputs.platform }}") {
4141
'x64' { $x64 }
4242
'ARM64' { $arm }
@@ -149,8 +149,10 @@ jobs:
149149
# Step 2 -- Native C++: FlyNativeLib.dll, FlyNativeLibHeif.dll,
150150
# FlyContextMenuHelper.exe
151151
# -----------------------------------------------------------------------
152-
# PlatformToolset=v145 matches the toolset shipped with Visual Studio 18
153-
# (now on the windows-latest / windows-11-arm runners) and the local scripts.
152+
# PlatformToolset is per-runner (matrix.toolset): the windows-latest x64
153+
# runner is on Visual Studio 2026 (v145), but windows-11-arm is still on
154+
# Visual Studio 2022 (newest toolset v143) and has no v145. ATL ships with
155+
# both images for their default toolset, so each compiles with its own.
154156
# Build order matters: FlyNativeLib has no vcpkg dependency and must be
155157
# built before FlyNativeLibHeif which links against heif.lib.
156158
# Output lands in Src/<Platform>/Release/ (not Src/<Project>/<Platform>/Release/).
@@ -162,7 +164,7 @@ jobs:
162164
msbuild FlyNativeLib.vcxproj `
163165
/p:Configuration=Release `
164166
/p:Platform=${{ matrix.platform }} `
165-
/p:PlatformToolset=v145
167+
/p:PlatformToolset=${{ matrix.toolset }}
166168
167169
- name: Build FlyNativeLibHeif
168170
if: ${{ inputs.native == 'Build fresh' }}
@@ -171,7 +173,7 @@ jobs:
171173
msbuild FlyNativeLibHeif.vcxproj `
172174
/p:Configuration=Release `
173175
/p:Platform=${{ matrix.platform }} `
174-
/p:PlatformToolset=v145
176+
/p:PlatformToolset=${{ matrix.toolset }}
175177
176178
- name: Build FlyContextMenuHelper
177179
if: ${{ inputs.native == 'Build fresh' }}
@@ -180,7 +182,7 @@ jobs:
180182
msbuild FlyContextMenuHelper.vcxproj `
181183
/p:Configuration=Release `
182184
/p:Platform=${{ matrix.platform }} `
183-
/p:PlatformToolset=v145
185+
/p:PlatformToolset=${{ matrix.toolset }}
184186
185187
# -----------------------------------------------------------------------
186188
# Step 3 -- Rust: fly_rust_bridge.dll (RAW decode + SVG render)

.github/workflows/build_installer.yaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ jobs:
3636
- id: pick
3737
shell: pwsh
3838
run: |
39-
$x64 = '{"runner":"windows-latest","platform":"x64","rid":"win-x64","vcpkg-triplet":"x64-windows-release","install-root":"vcpkg_installed_x64","rust-target":"x86_64-pc-windows-msvc","publish-profile":"win-x64"}'
40-
$arm = '{"runner":"windows-11-arm","platform":"ARM64","rid":"win-arm64","vcpkg-triplet":"arm64-windows-release","install-root":"vcpkg_installed_arm64","rust-target":"aarch64-pc-windows-msvc","publish-profile":"win-ARM64"}'
39+
$x64 = '{"runner":"windows-latest","platform":"x64","rid":"win-x64","vcpkg-triplet":"x64-windows-release","install-root":"vcpkg_installed_x64","rust-target":"x86_64-pc-windows-msvc","publish-profile":"win-x64","toolset":"v145"}'
40+
$arm = '{"runner":"windows-11-arm","platform":"ARM64","rid":"win-arm64","vcpkg-triplet":"arm64-windows-release","install-root":"vcpkg_installed_arm64","rust-target":"aarch64-pc-windows-msvc","publish-profile":"win-ARM64","toolset":"v143"}'
4141
$items = switch ("${{ inputs.platform }}") {
4242
'x64' { $x64 }
4343
'ARM64' { $arm }
@@ -150,8 +150,10 @@ jobs:
150150
# Step 2 -- Native C++: FlyNativeLib.dll, FlyNativeLibHeif.dll,
151151
# FlyContextMenuHelper.exe
152152
# -----------------------------------------------------------------------
153-
# PlatformToolset=v145 matches the toolset shipped with Visual Studio 18
154-
# (now on the windows-latest / windows-11-arm runners) and the local scripts.
153+
# PlatformToolset is per-runner (matrix.toolset): the windows-latest x64
154+
# runner is on Visual Studio 2026 (v145), but windows-11-arm is still on
155+
# Visual Studio 2022 (newest toolset v143) and has no v145. ATL ships with
156+
# both images for their default toolset, so each compiles with its own.
155157
# Build order matters: FlyNativeLib has no vcpkg dependency and must be
156158
# built before FlyNativeLibHeif which links against heif.lib.
157159
# Output lands in Src/<Platform>/Release/ (not Src/<Project>/<Platform>/Release/).
@@ -163,7 +165,7 @@ jobs:
163165
msbuild FlyNativeLib.vcxproj `
164166
/p:Configuration=Release `
165167
/p:Platform=${{ matrix.platform }} `
166-
/p:PlatformToolset=v145
168+
/p:PlatformToolset=${{ matrix.toolset }}
167169
168170
- name: Build FlyNativeLibHeif
169171
if: ${{ inputs.native == 'Build fresh' }}
@@ -172,7 +174,7 @@ jobs:
172174
msbuild FlyNativeLibHeif.vcxproj `
173175
/p:Configuration=Release `
174176
/p:Platform=${{ matrix.platform }} `
175-
/p:PlatformToolset=v145
177+
/p:PlatformToolset=${{ matrix.toolset }}
176178
177179
- name: Build FlyContextMenuHelper
178180
if: ${{ inputs.native == 'Build fresh' }}
@@ -181,7 +183,7 @@ jobs:
181183
msbuild FlyContextMenuHelper.vcxproj `
182184
/p:Configuration=Release `
183185
/p:Platform=${{ matrix.platform }} `
184-
/p:PlatformToolset=v145
186+
/p:PlatformToolset=${{ matrix.toolset }}
185187
186188
# -----------------------------------------------------------------------
187189
# Step 3 -- Rust: fly_rust_bridge.dll (RAW decode + SVG render)

0 commit comments

Comments
 (0)