Skip to content

Commit d889eb5

Browse files
committed
CI: drop ATL install step; v145 toolset is the real fix
The atlstr.h failure was a toolset mismatch, not a missing ATL component: the runners moved to Visual Studio 2026 (v18), which has no v143 toolset. ATL ships with that image. Targeting v145 resolves the include; the VS Installer modify step is unnecessary, so remove it from both workflows.
1 parent 4aee24a commit d889eb5

2 files changed

Lines changed: 0 additions & 100 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -85,56 +85,6 @@ jobs:
8585
- name: Setup MSBuild
8686
uses: microsoft/setup-msbuild@v2
8787

88-
# The native C++ projects include ATL headers (<atlstr.h>, <atlcoll.h> in
89-
# FlyNativeLib). The windows-latest runner image no longer ships the C++ ATL
90-
# component by default, so install it into the runner's VS before building.
91-
- name: Install C++ ATL
92-
if: ${{ inputs.native == 'Build fresh' }}
93-
shell: pwsh
94-
run: |
95-
$vsInstaller = "C:\Program Files (x86)\Microsoft Visual Studio\Installer"
96-
$vsPath = & "$vsInstaller\vswhere.exe" -latest -property installationPath
97-
if (-not $vsPath) { Write-Error "Could not locate Visual Studio via vswhere."; exit 1 }
98-
99-
# Base ATL provides the headers (atlstr.h etc.) FlyNativeLib needs. The
100-
# ARM64 variant (ATL link libs for ARM64 targets) is added ONLY on the
101-
# ARM64 runner -- requesting it on the x64 runner can make the whole
102-
# modify fail, leaving even base ATL uninstalled.
103-
$components = @("Microsoft.VisualStudio.Component.VC.ATL")
104-
if ("${{ matrix.platform }}" -eq "ARM64") {
105-
$components += "Microsoft.VisualStudio.Component.VC.ATL.ARM64"
106-
}
107-
108-
# Build a single argument string so the install path (which contains
109-
# spaces, e.g. "C:\Program Files\Microsoft Visual Studio\18\Enterprise")
110-
# is passed quoted. Start-Process with an -ArgumentList ARRAY does not
111-
# quote elements that contain spaces, which truncated --installPath to
112-
# "C:\Program" and made the modify fail with "product cannot be found".
113-
$addArgs = ($components | ForEach-Object { "--add $_" }) -join " "
114-
$argString = "modify --installPath `"$vsPath`" --quiet --norestart --force --nocache $addArgs"
115-
116-
Write-Host "Installing ATL components: $($components -join ', ')"
117-
$proc = Start-Process -FilePath "$vsInstaller\setup.exe" -ArgumentList $argString -Wait -PassThru -NoNewWindow
118-
Write-Host "VS Installer exit code: $($proc.ExitCode)"
119-
if ($proc.ExitCode -ne 0 -and $proc.ExitCode -ne 3010) {
120-
Write-Error "VS Installer modify failed with exit code $($proc.ExitCode)."
121-
exit $proc.ExitCode
122-
}
123-
124-
# Verify the header is actually present -- fail here with a clear message
125-
# rather than letting the later C++ compile fail on a missing include.
126-
# The VS Installer can land files slightly after setup.exe returns, so
127-
# poll for up to ~60s before giving up.
128-
$vcRoot = Join-Path $vsPath "VC\Tools\MSVC"
129-
$atl = $null
130-
foreach ($i in 1..12) {
131-
$atl = Get-ChildItem -Path $vcRoot -Recurse -Filter "atlstr.h" -ErrorAction SilentlyContinue | Select-Object -First 1
132-
if ($atl) { break }
133-
Start-Sleep -Seconds 5
134-
}
135-
if (-not $atl) { Write-Error "atlstr.h still not found under $vcRoot after install."; exit 1 }
136-
Write-Host "Found ATL header: $($atl.FullName)"
137-
13888
# Install the stable Rust toolchain and pre-add the cross-compilation
13989
# target for this platform. On windows-latest the host IS x86_64 so
14090
# the target is native; on windows-11-arm the host IS aarch64 so same.

.github/workflows/build_installer.yaml

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -86,56 +86,6 @@ jobs:
8686
- name: Setup MSBuild
8787
uses: microsoft/setup-msbuild@v2
8888

89-
# The native C++ projects include ATL headers (<atlstr.h>, <atlcoll.h> in
90-
# FlyNativeLib). The windows-latest runner image no longer ships the C++ ATL
91-
# component by default, so install it into the runner's VS before building.
92-
- name: Install C++ ATL
93-
if: ${{ inputs.native == 'Build fresh' }}
94-
shell: pwsh
95-
run: |
96-
$vsInstaller = "C:\Program Files (x86)\Microsoft Visual Studio\Installer"
97-
$vsPath = & "$vsInstaller\vswhere.exe" -latest -property installationPath
98-
if (-not $vsPath) { Write-Error "Could not locate Visual Studio via vswhere."; exit 1 }
99-
100-
# Base ATL provides the headers (atlstr.h etc.) FlyNativeLib needs. The
101-
# ARM64 variant (ATL link libs for ARM64 targets) is added ONLY on the
102-
# ARM64 runner -- requesting it on the x64 runner can make the whole
103-
# modify fail, leaving even base ATL uninstalled.
104-
$components = @("Microsoft.VisualStudio.Component.VC.ATL")
105-
if ("${{ matrix.platform }}" -eq "ARM64") {
106-
$components += "Microsoft.VisualStudio.Component.VC.ATL.ARM64"
107-
}
108-
109-
# Build a single argument string so the install path (which contains
110-
# spaces, e.g. "C:\Program Files\Microsoft Visual Studio\18\Enterprise")
111-
# is passed quoted. Start-Process with an -ArgumentList ARRAY does not
112-
# quote elements that contain spaces, which truncated --installPath to
113-
# "C:\Program" and made the modify fail with "product cannot be found".
114-
$addArgs = ($components | ForEach-Object { "--add $_" }) -join " "
115-
$argString = "modify --installPath `"$vsPath`" --quiet --norestart --force --nocache $addArgs"
116-
117-
Write-Host "Installing ATL components: $($components -join ', ')"
118-
$proc = Start-Process -FilePath "$vsInstaller\setup.exe" -ArgumentList $argString -Wait -PassThru -NoNewWindow
119-
Write-Host "VS Installer exit code: $($proc.ExitCode)"
120-
if ($proc.ExitCode -ne 0 -and $proc.ExitCode -ne 3010) {
121-
Write-Error "VS Installer modify failed with exit code $($proc.ExitCode)."
122-
exit $proc.ExitCode
123-
}
124-
125-
# Verify the header is actually present -- fail here with a clear message
126-
# rather than letting the later C++ compile fail on a missing include.
127-
# The VS Installer can land files slightly after setup.exe returns, so
128-
# poll for up to ~60s before giving up.
129-
$vcRoot = Join-Path $vsPath "VC\Tools\MSVC"
130-
$atl = $null
131-
foreach ($i in 1..12) {
132-
$atl = Get-ChildItem -Path $vcRoot -Recurse -Filter "atlstr.h" -ErrorAction SilentlyContinue | Select-Object -First 1
133-
if ($atl) { break }
134-
Start-Sleep -Seconds 5
135-
}
136-
if (-not $atl) { Write-Error "atlstr.h still not found under $vcRoot after install."; exit 1 }
137-
Write-Host "Found ATL header: $($atl.FullName)"
138-
13989
# Install the stable Rust toolchain and pre-add the cross-compilation
14090
# target for this platform. On windows-latest the host IS x86_64 so
14191
# the target is native; on windows-11-arm the host IS aarch64 so same.

0 commit comments

Comments
 (0)