Skip to content

Commit d5a9fec

Browse files
committed
Use Visual Studio 2022 for builds instead of 2019
1 parent 55787ea commit d5a9fec

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

.github/workflows/windows.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ concurrency:
1414
jobs:
1515
pythonbuild:
1616
if: ${{ github.repository_owner == 'indygreg' || github.event_name != 'schedule' }}
17-
runs-on: 'windows-2019'
17+
runs-on: 'windows-2022'
1818
steps:
1919
- uses: actions/checkout@v4
2020

@@ -66,7 +66,7 @@ jobs:
6666
options: 'freethreaded+pgo'
6767

6868
needs: pythonbuild
69-
runs-on: 'windows-2019'
69+
runs-on: 'windows-2022'
7070
steps:
7171
- uses: actions/checkout@v4
7272
with:
@@ -96,7 +96,7 @@ jobs:
9696
- name: Build
9797
shell: cmd
9898
run: |
99-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\${{ matrix.vcvars }}"
99+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\${{ matrix.vcvars }}"
100100
py.exe -3.9 build-windows.py --python ${{ matrix.py }} --sh c:\cygwin\bin\sh.exe --options ${{ matrix.options }}
101101
102102
- name: Validate Distribution

cpython-windows/build.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1424,6 +1424,16 @@ def build_cpython(
14241424
# The python.props file keys off MSBUILD, so it needs to be set.
14251425
os.environ["MSBUILD"] = str(msbuild)
14261426

1427+
# Workaround for https://github.com/actions/runner-images/issues/10819
1428+
if not os.environ.get("VCToolsRedistDir"):
1429+
os.environ["VCToolsRedistDir"] = os.path.join(
1430+
os.environ["VCINSTALLDIR"],
1431+
"Redist",
1432+
"MSVC",
1433+
os.environ["VCToolsVersion"],
1434+
"",
1435+
)
1436+
14271437
bzip2_archive = download_entry("bzip2", BUILD)
14281438
sqlite_archive = download_entry("sqlite", BUILD)
14291439
tk_bin_archive = download_entry(
@@ -1887,7 +1897,7 @@ def main() -> None:
18871897
parser.add_argument(
18881898
"--vs",
18891899
choices={"2019", "2022"},
1890-
default="2019",
1900+
default="2022",
18911901
help="Visual Studio version to use",
18921902
)
18931903
parser.add_argument(

0 commit comments

Comments
 (0)