From 9ca36170b062c20e841aaf5038d599fcc320975a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Apr 2026 00:36:00 +0000 Subject: [PATCH 1/3] 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> --- .github/workflows/ci.yml | 76 ++++++++++++++++++++++++++++++++-------- 1 file changed, 61 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb8cafd2b..a5ca4d4e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,12 +8,21 @@ on: jobs: test-msvc-cppwinrt-build: - name: '${{ matrix.compiler }}: Build (${{ matrix.arch }}, ${{ matrix.config }})' + name: '${{ matrix.compiler }}: Build (${{ matrix.arch }}, ${{ matrix.config }}, ${{ matrix.toolchain.platform_toolset }})' strategy: matrix: compiler: [MSVC, clang-cl] arch: [x86, x64, arm64] config: [Debug, Release] + toolchain: + - image: windows-2025 + platform_toolset: v143 + vswhere_version: "[17.0,18.0)" + vswhere_prerelease: "false" + - image: windows-2025-vs2026 + platform_toolset: v145 + vswhere_version: "[18.0,19.0)" + vswhere_prerelease: "true" exclude: - arch: arm64 config: Debug @@ -21,7 +30,7 @@ jobs: arch: arm64 - compiler: clang-cl config: Release - runs-on: windows-latest + runs-on: ${{ matrix.toolchain.image }} steps: - uses: actions/checkout@v6 @@ -32,7 +41,12 @@ jobs: - name: Find VsDevCmd.bat run: | - $VSDevCmd = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere" -latest -find Common7\tools\VSDevCmd.bat + $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere" + $vswhereArgs = @("-latest", "-products", "*", "-requires", "Microsoft.Component.MSBuild", "-version", "${{ matrix.toolchain.vswhere_version }}", "-find", "Common7\tools\VSDevCmd.bat") + if ("${{ matrix.toolchain.vswhere_prerelease }}" -eq "true") { + $vswhereArgs += "-prerelease" + } + $VSDevCmd = & $vswhere @vswhereArgs if (!$VSDevCmd) { exit 1 } echo "Using VSDevCmd: ${VSDevCmd}" Add-Content $env:GITHUB_ENV "VSDevCmd=$VSDevCmd" @@ -45,6 +59,8 @@ jobs: $props = "Configuration=$target_configuration,Platform=$target_platform,CppWinRTBuildVersion=$target_version" if ("${{ matrix.compiler }}" -eq "clang-cl") { $props += ",Clang=1,PlatformToolset=ClangCl" + } else { + $props += ",PlatformToolset=${{ matrix.toolchain.platform_toolset }}" } Add-Content $env:GITHUB_ENV "msbuild_config_props=/p:$props" @@ -68,7 +84,7 @@ jobs: - name: Upload built executables uses: actions/upload-artifact@v7 with: - name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-bin + name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.toolchain.platform_toolset }}-bin path: | _build/${{ matrix.arch }}/${{ matrix.config }}/*.exe _build/${{ matrix.arch }}/${{ matrix.config }}/*.dll @@ -84,7 +100,7 @@ jobs: & "_build\$target_platform\$target_configuration\cppwinrt.exe" -in local -out _build\$target_platform\$target_configuration -verbose test-msvc-cppwinrt-test: - name: '${{ matrix.compiler }}: Test [${{ matrix.test_exe }}] (${{ matrix.arch }}, ${{ matrix.config }})' + name: '${{ matrix.compiler }}: Test [${{ matrix.test_exe }}] (${{ matrix.arch }}, ${{ matrix.config }}, ${{ matrix.toolchain.platform_toolset }})' needs: test-msvc-cppwinrt-build strategy: fail-fast: false @@ -93,6 +109,15 @@ jobs: arch: [x86, x64, arm64] config: [Debug, Release] 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] + toolchain: + - image: windows-2025 + platform_toolset: v143 + vswhere_version: "[17.0,18.0)" + vswhere_prerelease: "false" + - image: windows-2025-vs2026 + platform_toolset: v145 + vswhere_version: "[18.0,19.0)" + vswhere_prerelease: "true" exclude: - arch: arm64 config: Debug @@ -100,7 +125,7 @@ jobs: arch: arm64 - compiler: clang-cl config: Release - runs-on: windows-latest + runs-on: ${{ matrix.toolchain.image }} steps: - uses: actions/checkout@v6 @@ -108,14 +133,14 @@ jobs: if: matrix.arch != 'arm64' uses: actions/download-artifact@v8 with: - name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-bin + name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.toolchain.platform_toolset }}-bin path: _build/${{ matrix.arch }}/${{ matrix.config }}/ - name: Fetch x86 cppwinrt executables (arm64 only) if: matrix.arch == 'arm64' uses: actions/download-artifact@v8 with: - name: msvc-build-${{ matrix.compiler}}-x86-Release-bin + name: msvc-build-${{ matrix.compiler}}-x86-Release-${{ matrix.toolchain.platform_toolset }}-bin path: _build/x86/Release/ - name: Download nuget @@ -125,7 +150,12 @@ jobs: - name: Find VsDevCmd.bat run: | - $VSDevCmd = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere" -latest -find Common7\tools\VSDevCmd.bat + $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere" + $vswhereArgs = @("-latest", "-products", "*", "-requires", "Microsoft.Component.MSBuild", "-version", "${{ matrix.toolchain.vswhere_version }}", "-find", "Common7\tools\VSDevCmd.bat") + if ("${{ matrix.toolchain.vswhere_prerelease }}" -eq "true") { + $vswhereArgs += "-prerelease" + } + $VSDevCmd = & $vswhere @vswhereArgs if (!$VSDevCmd) { exit 1 } echo "Using VSDevCmd: ${VSDevCmd}" Add-Content $env:GITHUB_ENV "VSDevCmd=$VSDevCmd" @@ -138,6 +168,8 @@ jobs: $props = "Configuration=$target_configuration,Platform=$target_platform,CppWinRTBuildVersion=$target_version" if ("${{ matrix.compiler }}" -eq "clang-cl") { $props += ",Clang=1,PlatformToolset=ClangCl" + } else { + $props += ",PlatformToolset=${{ matrix.toolchain.platform_toolset }}" } Add-Content $env:GITHUB_ENV "msbuild_config_props=/p:$props" @@ -232,7 +264,7 @@ jobs: if: matrix.arch == 'arm64' uses: actions/upload-artifact@v7 with: - name: msvc-tests-${{ matrix.test_exe }}-${{ matrix.compiler }}-${{ matrix.arch }}-${{ matrix.config }}-bin + name: msvc-tests-${{ matrix.test_exe }}-${{ matrix.compiler }}-${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.toolchain.platform_toolset }}-bin path: | _build/${{ matrix.arch }}/${{ matrix.config }}/*.exe _build/${{ matrix.arch }}/${{ matrix.config }}/*.dll @@ -313,7 +345,7 @@ jobs: cmd /c "$env:VSDevCmd" "&" msbuild /m /clp:ForceConsoleColor "$env:msbuild_config_props" /p:Deployment=${{ matrix.Deployment }} natvis\cppwinrtvisualizer.sln build-msvc-nuget-test: - name: 'Build nuget test (${{ matrix.arch }})' + name: 'Build nuget test (${{ matrix.arch }}, ${{ matrix.toolchain.platform_toolset }})' needs: test-msvc-cppwinrt-build strategy: matrix: @@ -321,14 +353,23 @@ jobs: - MSVC arch: [x86, x64] config: [Release] - runs-on: windows-latest + toolchain: + - image: windows-2025 + platform_toolset: v143 + vswhere_version: "[17.0,18.0)" + vswhere_prerelease: "false" + - image: windows-2025-vs2026 + platform_toolset: v145 + vswhere_version: "[18.0,19.0)" + vswhere_prerelease: "true" + runs-on: ${{ matrix.toolchain.image }} steps: - uses: actions/checkout@v6 - name: Fetch cppwinrt executables uses: actions/download-artifact@v8 with: - name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-bin + name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.toolchain.platform_toolset }}-bin path: _build/${{ matrix.arch }}/${{ matrix.config }}/ - name: Download nuget @@ -338,7 +379,12 @@ jobs: - name: Find VsDevCmd.bat run: | - $VSDevCmd = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere" -latest -find Common7\tools\VSDevCmd.bat + $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere" + $vswhereArgs = @("-latest", "-products", "*", "-requires", "Microsoft.Component.MSBuild", "-version", "${{ matrix.toolchain.vswhere_version }}", "-find", "Common7\tools\VSDevCmd.bat") + if ("${{ matrix.toolchain.vswhere_prerelease }}" -eq "true") { + $vswhereArgs += "-prerelease" + } + $VSDevCmd = & $vswhere @vswhereArgs if (!$VSDevCmd) { exit 1 } echo "Using VSDevCmd: ${VSDevCmd}" Add-Content $env:GITHUB_ENV "VSDevCmd=$VSDevCmd" @@ -348,7 +394,7 @@ jobs: $target_configuration = "${{ matrix.config }}" $target_platform = "${{ matrix.arch }}" $target_version = "999.999.999.999" - Add-Content $env:GITHUB_ENV "msbuild_config_props=/p:Configuration=$target_configuration,Platform=$target_platform,CppWinRTBuildVersion=$target_version" + Add-Content $env:GITHUB_ENV "msbuild_config_props=/p:Configuration=$target_configuration,Platform=$target_platform,CppWinRTBuildVersion=$target_version,PlatformToolset=${{ matrix.toolchain.platform_toolset }}" - name: Restore nuget packages run: | From 7dd60feb7b3287ee3831794984917bb60293e209 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Apr 2026 01:02:58 +0000 Subject: [PATCH 2/3] 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> --- .github/workflows/ci.yml | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5ca4d4e0..d660400a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,12 +17,8 @@ jobs: toolchain: - image: windows-2025 platform_toolset: v143 - vswhere_version: "[17.0,18.0)" - vswhere_prerelease: "false" - image: windows-2025-vs2026 platform_toolset: v145 - vswhere_version: "[18.0,19.0)" - vswhere_prerelease: "true" exclude: - arch: arm64 config: Debug @@ -41,12 +37,7 @@ jobs: - name: Find VsDevCmd.bat run: | - $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere" - $vswhereArgs = @("-latest", "-products", "*", "-requires", "Microsoft.Component.MSBuild", "-version", "${{ matrix.toolchain.vswhere_version }}", "-find", "Common7\tools\VSDevCmd.bat") - if ("${{ matrix.toolchain.vswhere_prerelease }}" -eq "true") { - $vswhereArgs += "-prerelease" - } - $VSDevCmd = & $vswhere @vswhereArgs + $VSDevCmd = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere" -latest -find Common7\tools\VSDevCmd.bat if (!$VSDevCmd) { exit 1 } echo "Using VSDevCmd: ${VSDevCmd}" Add-Content $env:GITHUB_ENV "VSDevCmd=$VSDevCmd" @@ -112,12 +103,8 @@ jobs: toolchain: - image: windows-2025 platform_toolset: v143 - vswhere_version: "[17.0,18.0)" - vswhere_prerelease: "false" - image: windows-2025-vs2026 platform_toolset: v145 - vswhere_version: "[18.0,19.0)" - vswhere_prerelease: "true" exclude: - arch: arm64 config: Debug @@ -150,12 +137,7 @@ jobs: - name: Find VsDevCmd.bat run: | - $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere" - $vswhereArgs = @("-latest", "-products", "*", "-requires", "Microsoft.Component.MSBuild", "-version", "${{ matrix.toolchain.vswhere_version }}", "-find", "Common7\tools\VSDevCmd.bat") - if ("${{ matrix.toolchain.vswhere_prerelease }}" -eq "true") { - $vswhereArgs += "-prerelease" - } - $VSDevCmd = & $vswhere @vswhereArgs + $VSDevCmd = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere" -latest -find Common7\tools\VSDevCmd.bat if (!$VSDevCmd) { exit 1 } echo "Using VSDevCmd: ${VSDevCmd}" Add-Content $env:GITHUB_ENV "VSDevCmd=$VSDevCmd" @@ -356,12 +338,8 @@ jobs: toolchain: - image: windows-2025 platform_toolset: v143 - vswhere_version: "[17.0,18.0)" - vswhere_prerelease: "false" - image: windows-2025-vs2026 platform_toolset: v145 - vswhere_version: "[18.0,19.0)" - vswhere_prerelease: "true" runs-on: ${{ matrix.toolchain.image }} steps: - uses: actions/checkout@v6 @@ -379,12 +357,7 @@ jobs: - name: Find VsDevCmd.bat run: | - $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere" - $vswhereArgs = @("-latest", "-products", "*", "-requires", "Microsoft.Component.MSBuild", "-version", "${{ matrix.toolchain.vswhere_version }}", "-find", "Common7\tools\VSDevCmd.bat") - if ("${{ matrix.toolchain.vswhere_prerelease }}" -eq "true") { - $vswhereArgs += "-prerelease" - } - $VSDevCmd = & $vswhere @vswhereArgs + $VSDevCmd = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere" -latest -find Common7\tools\VSDevCmd.bat if (!$VSDevCmd) { exit 1 } echo "Using VSDevCmd: ${VSDevCmd}" Add-Content $env:GITHUB_ENV "VSDevCmd=$VSDevCmd" From 2034d297a99a147d15ab541ea3f64b16ebc4a76e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Apr 2026 23:06:56 +0000 Subject: [PATCH 3/3] 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> --- strings/base_array.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/base_array.h b/strings/base_array.h index 9544dcf8c..48d10c6ce 100644 --- a/strings/base_array.h +++ b/strings/base_array.h @@ -376,7 +376,7 @@ WINRT_EXPORT namespace winrt std::pair> detach_abi() noexcept { -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) // https://github.com/microsoft/cppwinrt/pull/1165 std::pair> result; std::memset(&result, 0, sizeof(result));