Skip to content

Commit 295df7c

Browse files
pi-anldpgeorge
authored andcommitted
github/workflows: Drop VS2017, use preinstalled v142 toolset for VS2019.
The VS 2017 and VS 2019 MSVC CI jobs have been failing intermittently for months due to Chocolatey/Microsoft installer infrastructure issues when downloading old Visual Studio build tools onto windows-latest runners. These are not code failures - the build tools installation itself is unreliable (CDN timeouts, corrupt downloads, installer self-update loops). This removes VS 2017 from the matrix entirely and switches VS 2019 to use the v142 toolset that's already pre-installed on windows-2022 runners as a component of VS 2022. The PlatformToolset is now passed explicitly to MSBuild for both VS 2019 (v142) and VS 2022 (v143), and the Chocolatey installation step is removed. VS 2017 reached end-of-life in 2022, and the v141 toolset is no longer reliably installable on GitHub-hosted runners (actions/runner-images#9701, actions/runner-images#12764). The windows-2019 runner image was removed in June 2025. Docker containers are not supported on Windows runners, and the repo's 10GB Actions cache is already full, so caching the installation isn't feasible either. MSVC v143 is binary-compatible back to v141, so the testing value of v141 was marginal. The net effect is 16 MSVC jobs (down from 24) with zero installation steps and hopefully no more flaky failures. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
1 parent f456a23 commit 295df7c

1 file changed

Lines changed: 11 additions & 21 deletions

File tree

.github/workflows/ports_windows.yml

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,24 @@ jobs:
2525
platform: [x86, x64]
2626
configuration: [Debug, Release]
2727
variant: [dev, standard]
28-
visualstudio: ['2017', '2019', '2022']
28+
visualstudio: ['2019', '2022']
2929
include:
30-
- visualstudio: '2017'
31-
vs_version: '[15, 16)'
32-
custom_vs_install: true
3330
- visualstudio: '2019'
34-
vs_version: '[16, 17)'
35-
custom_vs_install: true
31+
# The v142 toolset (VS 2019 compiler) is pre-installed on
32+
# windows-2022 as a component of VS 2022. Use VS 2022's
33+
# MSBuild and select the v142 toolset via PlatformToolset.
34+
vs_version: '[17, 18)'
35+
platform_toolset: v142
3636
- visualstudio: '2022'
3737
vs_version: '[17, 18)'
38+
platform_toolset: v143
3839
# trim down the number of jobs in the matrix
3940
exclude:
4041
- variant: standard
4142
configuration: Debug
4243
- visualstudio: '2019'
4344
configuration: Debug
44-
runs-on: windows-latest
45+
runs-on: windows-2022
4546
env:
4647
CI_BUILD_CONFIGURATION: ${{ matrix.configuration }}
4748
steps:
@@ -51,31 +52,20 @@ jobs:
5152
uses: actions/setup-python@v6
5253
with:
5354
python-version: '3.11'
54-
- name: Install Visual Studio ${{ matrix.visualstudio }}
55-
if: matrix.custom_vs_install
56-
shell: bash
57-
# Shell functions in this block are to retry intermittent corrupt
58-
# downloads (with a clean download dir) before failing the job outright
59-
run: |
60-
try () { ($@) || ($@) || ($@) || ($@) }
61-
clean_install () ( rm -rf $TEMP/chocolatey; choco install $1 )
62-
try clean_install visualstudio${{ matrix.visualstudio }}buildtools
63-
try clean_install visualstudio${{ matrix.visualstudio }}-workload-vctools
64-
try clean_install windows-sdk-8.1
6555
- uses: microsoft/setup-msbuild@v2
6656
with:
6757
vs-version: ${{ matrix.vs_version }}
6858
- uses: actions/checkout@v6
6959
- name: Build mpy-cross.exe
70-
run: msbuild mpy-cross\mpy-cross.vcxproj -maxcpucount -property:Configuration=${{ matrix.configuration }} -property:Platform=${{ matrix.platform }}
60+
run: msbuild mpy-cross\mpy-cross.vcxproj -maxcpucount -property:Configuration=${{ matrix.configuration }} -property:Platform=${{ matrix.platform }} -property:PlatformToolset=${{ matrix.platform_toolset }}
7161
- name: Update submodules
7262
run: git submodule update --init lib/micropython-lib
7363
- name: Build micropython.exe
74-
run: msbuild ports\windows\micropython.vcxproj -maxcpucount -property:Configuration=${{ matrix.configuration }} -property:Platform=${{ matrix.platform }} -property:PyVariant=${{ matrix.variant }}
64+
run: msbuild ports\windows\micropython.vcxproj -maxcpucount -property:Configuration=${{ matrix.configuration }} -property:Platform=${{ matrix.platform }} -property:PyVariant=${{ matrix.variant }} -property:PlatformToolset=${{ matrix.platform_toolset }}
7565
- name: Get micropython.exe path
7666
id: get_path
7767
run: |
78-
$exePath="$(msbuild ports\windows\micropython.vcxproj -nologo -v:m -t:ShowTargetPath -property:Configuration=${{ matrix.configuration }} -property:Platform=${{ matrix.platform }} -property:PyVariant=${{ matrix.variant }})"
68+
$exePath="$(msbuild ports\windows\micropython.vcxproj -nologo -v:m -t:ShowTargetPath -property:Configuration=${{ matrix.configuration }} -property:Platform=${{ matrix.platform }} -property:PyVariant=${{ matrix.variant }} -property:PlatformToolset=${{ matrix.platform_toolset }})"
7969
echo ("micropython=" + $exePath.Trim()) >> $env:GITHUB_OUTPUT
8070
- name: Run tests
8171
id: test

0 commit comments

Comments
 (0)