Skip to content

Commit a5e9452

Browse files
CopilotDefaultRyan
andauthored
CI: test against VS2022 (v143) and VS2026 (v145) in parallel (#1573)
* Run Windows CI matrix on 2025 and 2025-vs2026 toolsets Agent-Logs-Url: https://github.com/microsoft/cppwinrt/sessions/b78f8378-0fed-463c-97ac-e16f18e532a9 Co-authored-by: DefaultRyan <26174284+DefaultRyan@users.noreply.github.com> * Simplify CI: drop vswhere version/prerelease fields, keep platform_toolset Agent-Logs-Url: https://github.com/microsoft/cppwinrt/sessions/d084d7e4-1d03-4234-a219-7b58887d42d5 Co-authored-by: DefaultRyan <26174284+DefaultRyan@users.noreply.github.com> * Fix clang-cl v145 build: exclude clang from memset path in com_array::detach_abi Clang 19+ (VS2026/v145) treats memset on non-trivially-copyable types as a hard error. clang-cl defines _MSC_VER, so it was taking the memset workaround path meant only for MSVC. Guard with !defined(__clang__) so clang-cl uses the safe member-assignment branch instead. Agent-Logs-Url: https://github.com/microsoft/cppwinrt/sessions/d433cd66-3565-4257-9c9d-23ec477f8c4d Co-authored-by: DefaultRyan <26174284+DefaultRyan@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: DefaultRyan <26174284+DefaultRyan@users.noreply.github.com>
1 parent 748d1e0 commit a5e9452

2 files changed

Lines changed: 32 additions & 13 deletions

File tree

.github/workflows/ci.yml

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,25 @@ on:
88

99
jobs:
1010
test-msvc-cppwinrt-build:
11-
name: '${{ matrix.compiler }}: Build (${{ matrix.arch }}, ${{ matrix.config }})'
11+
name: '${{ matrix.compiler }}: Build (${{ matrix.arch }}, ${{ matrix.config }}, ${{ matrix.toolchain.platform_toolset }})'
1212
strategy:
1313
matrix:
1414
compiler: [MSVC, clang-cl]
1515
arch: [x86, x64, arm64]
1616
config: [Debug, Release]
17+
toolchain:
18+
- image: windows-2025
19+
platform_toolset: v143
20+
- image: windows-2025-vs2026
21+
platform_toolset: v145
1722
exclude:
1823
- arch: arm64
1924
config: Debug
2025
- compiler: clang-cl
2126
arch: arm64
2227
- compiler: clang-cl
2328
config: Release
24-
runs-on: windows-latest
29+
runs-on: ${{ matrix.toolchain.image }}
2530
steps:
2631
- uses: actions/checkout@v6
2732

@@ -45,6 +50,8 @@ jobs:
4550
$props = "Configuration=$target_configuration,Platform=$target_platform,CppWinRTBuildVersion=$target_version"
4651
if ("${{ matrix.compiler }}" -eq "clang-cl") {
4752
$props += ",Clang=1,PlatformToolset=ClangCl"
53+
} else {
54+
$props += ",PlatformToolset=${{ matrix.toolchain.platform_toolset }}"
4855
}
4956
Add-Content $env:GITHUB_ENV "msbuild_config_props=/p:$props"
5057
@@ -68,7 +75,7 @@ jobs:
6875
- name: Upload built executables
6976
uses: actions/upload-artifact@v7
7077
with:
71-
name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-bin
78+
name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.toolchain.platform_toolset }}-bin
7279
path: |
7380
_build/${{ matrix.arch }}/${{ matrix.config }}/*.exe
7481
_build/${{ matrix.arch }}/${{ matrix.config }}/*.dll
@@ -84,7 +91,7 @@ jobs:
8491
& "_build\$target_platform\$target_configuration\cppwinrt.exe" -in local -out _build\$target_platform\$target_configuration -verbose
8592
8693
test-msvc-cppwinrt-test:
87-
name: '${{ matrix.compiler }}: Test [${{ matrix.test_exe }}] (${{ matrix.arch }}, ${{ matrix.config }})'
94+
name: '${{ matrix.compiler }}: Test [${{ matrix.test_exe }}] (${{ matrix.arch }}, ${{ matrix.config }}, ${{ matrix.toolchain.platform_toolset }})'
8895
needs: test-msvc-cppwinrt-build
8996
strategy:
9097
fail-fast: false
@@ -93,29 +100,34 @@ jobs:
93100
arch: [x86, x64, arm64]
94101
config: [Debug, Release]
95102
test_exe: [test, test_nocoro, test_cpp20, test_cpp20_no_sourcelocation, test_fast, test_slow, test_old, test_module_lock_custom, test_module_lock_none]
103+
toolchain:
104+
- image: windows-2025
105+
platform_toolset: v143
106+
- image: windows-2025-vs2026
107+
platform_toolset: v145
96108
exclude:
97109
- arch: arm64
98110
config: Debug
99111
- compiler: clang-cl
100112
arch: arm64
101113
- compiler: clang-cl
102114
config: Release
103-
runs-on: windows-latest
115+
runs-on: ${{ matrix.toolchain.image }}
104116
steps:
105117
- uses: actions/checkout@v6
106118

107119
- name: Fetch cppwinrt executables
108120
if: matrix.arch != 'arm64'
109121
uses: actions/download-artifact@v8
110122
with:
111-
name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-bin
123+
name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.toolchain.platform_toolset }}-bin
112124
path: _build/${{ matrix.arch }}/${{ matrix.config }}/
113125

114126
- name: Fetch x86 cppwinrt executables (arm64 only)
115127
if: matrix.arch == 'arm64'
116128
uses: actions/download-artifact@v8
117129
with:
118-
name: msvc-build-${{ matrix.compiler}}-x86-Release-bin
130+
name: msvc-build-${{ matrix.compiler}}-x86-Release-${{ matrix.toolchain.platform_toolset }}-bin
119131
path: _build/x86/Release/
120132

121133
- name: Download nuget
@@ -138,6 +150,8 @@ jobs:
138150
$props = "Configuration=$target_configuration,Platform=$target_platform,CppWinRTBuildVersion=$target_version"
139151
if ("${{ matrix.compiler }}" -eq "clang-cl") {
140152
$props += ",Clang=1,PlatformToolset=ClangCl"
153+
} else {
154+
$props += ",PlatformToolset=${{ matrix.toolchain.platform_toolset }}"
141155
}
142156
Add-Content $env:GITHUB_ENV "msbuild_config_props=/p:$props"
143157
@@ -232,7 +246,7 @@ jobs:
232246
if: matrix.arch == 'arm64'
233247
uses: actions/upload-artifact@v7
234248
with:
235-
name: msvc-tests-${{ matrix.test_exe }}-${{ matrix.compiler }}-${{ matrix.arch }}-${{ matrix.config }}-bin
249+
name: msvc-tests-${{ matrix.test_exe }}-${{ matrix.compiler }}-${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.toolchain.platform_toolset }}-bin
236250
path: |
237251
_build/${{ matrix.arch }}/${{ matrix.config }}/*.exe
238252
_build/${{ matrix.arch }}/${{ matrix.config }}/*.dll
@@ -313,22 +327,27 @@ jobs:
313327
cmd /c "$env:VSDevCmd" "&" msbuild /m /clp:ForceConsoleColor "$env:msbuild_config_props" /p:Deployment=${{ matrix.Deployment }} natvis\cppwinrtvisualizer.sln
314328
315329
build-msvc-nuget-test:
316-
name: 'Build nuget test (${{ matrix.arch }})'
330+
name: 'Build nuget test (${{ matrix.arch }}, ${{ matrix.toolchain.platform_toolset }})'
317331
needs: test-msvc-cppwinrt-build
318332
strategy:
319333
matrix:
320334
compiler:
321335
- MSVC
322336
arch: [x86, x64]
323337
config: [Release]
324-
runs-on: windows-latest
338+
toolchain:
339+
- image: windows-2025
340+
platform_toolset: v143
341+
- image: windows-2025-vs2026
342+
platform_toolset: v145
343+
runs-on: ${{ matrix.toolchain.image }}
325344
steps:
326345
- uses: actions/checkout@v6
327346

328347
- name: Fetch cppwinrt executables
329348
uses: actions/download-artifact@v8
330349
with:
331-
name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-bin
350+
name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.toolchain.platform_toolset }}-bin
332351
path: _build/${{ matrix.arch }}/${{ matrix.config }}/
333352

334353
- name: Download nuget
@@ -348,7 +367,7 @@ jobs:
348367
$target_configuration = "${{ matrix.config }}"
349368
$target_platform = "${{ matrix.arch }}"
350369
$target_version = "999.999.999.999"
351-
Add-Content $env:GITHUB_ENV "msbuild_config_props=/p:Configuration=$target_configuration,Platform=$target_platform,CppWinRTBuildVersion=$target_version"
370+
Add-Content $env:GITHUB_ENV "msbuild_config_props=/p:Configuration=$target_configuration,Platform=$target_platform,CppWinRTBuildVersion=$target_version,PlatformToolset=${{ matrix.toolchain.platform_toolset }}"
352371
353372
- name: Restore nuget packages
354373
run: |

strings/base_array.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ WINRT_EXPORT namespace winrt
376376

377377
std::pair<std::uint32_t, impl::arg_out<T>> detach_abi() noexcept
378378
{
379-
#ifdef _MSC_VER
379+
#if defined(_MSC_VER) && !defined(__clang__)
380380
// https://github.com/microsoft/cppwinrt/pull/1165
381381
std::pair<std::uint32_t, impl::arg_out<T>> result;
382382
std::memset(&result, 0, sizeof(result));

0 commit comments

Comments
 (0)