contrib: install VS BuildTools 2022 in the Windows dependency installer script
VS 2017 was getting old, and 2022 is the latest supported compiler[1]. The
exact bootstrapper here is the newly released LTSC 17.12.3, which looks to be
supported until July 2026[2].
In making this change, I'm switching to the exported config settings file,
because it's easier to open the bootstrapper, select the things needed, and then
export to a file than figuring out all of the component names from the website.
Somehow, I missed the x86/x64 compiler adapting the previous command line args.
Also, the file nicely cleans up a very long command line.
[1] https://wiki.python.org/moin/WindowsCompilers#Microsoft_Visual_C.2B-.2B-_14.x_with_Visual_Studio_2022_.28x86.2C_x64.2C_ARM.2C_ARM64.29
[2] https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-history#fixed-version-bootstrappers
--- a/contrib/install-windows-dependencies.ps1 Fri Dec 13 21:35:05 2024 -0500
+++ b/contrib/install-windows-dependencies.ps1 Thu Dec 12 23:24:00 2024 -0500
@@ -16,8 +16,8 @@
#
# The script is tested on Windows 10 and Windows Server 2019 (in EC2).
-$VS_BUILD_TOOLS_URL = "https://download.visualstudio.microsoft.com/download/pr/a1603c02-8a66-4b83-b821-811e3610a7c4/aa2db8bb39e0cbd23e9940d8951e0bc3/vs_buildtools.exe"
-$VS_BUILD_TOOLS_SHA256 = "911E292B8E6E5F46CBC17003BDCD2D27A70E616E8D5E6E69D5D489A605CAA139"
+$VS_BUILD_TOOLS_URL = "https://download.visualstudio.microsoft.com/download/pr/f2819554-a618-400d-bced-774bb5379965/cc7231dc668ec1fb92f694c66b5d67cba1a9e21127a6e0b31c190f772bd442f2/vs_BuildTools.exe"
+$VS_BUILD_TOOLS_SHA256 = "CC7231DC668EC1FB92F694C66B5D67CBA1A9E21127A6E0B31C190F772BD442F2"
$PYTHON38_x86_URL = "https://www.python.org/ftp/python/3.8.10/python-3.8.10.exe"
$PYTHON38_x86_SHA256 = "ad07633a1f0cd795f3bf9da33729f662281df196b4567fa795829f3bb38a30ac"
@@ -186,8 +186,8 @@
Install-Python3 "Python 3.13 32-bit" ${prefix}\assets\python313-x86.exe ${prefix}\python313-x86 ${pip}
Install-Python3 "Python 3.13 64-bit" ${prefix}\assets\python313-x64.exe ${prefix}\python313-x64 ${pip}
- Write-Output "installing Visual Studio 2017 Build Tools and SDKs"
- Invoke-Process ${prefix}\assets\vs_buildtools.exe "--quiet --wait --norestart --nocache --channelUri https://aka.ms/vs/15/release/channel --add Microsoft.VisualStudio.Workload.MSBuildTools --add Microsoft.VisualStudio.Component.Windows10SDK.17763 --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.Windows10SDK --add Microsoft.VisualStudio.Component.VC.140 --add Microsoft.VisualStudio.Component.VC.Tools.ARM64"
+ Write-Output "installing Visual Studio 2022 Build Tools and SDKs"
+ Invoke-Process ${prefix}\assets\vs_buildtools.exe "--quiet --wait --norestart --nocache --channelUri https://aka.ms/vs/17/release/channel --config $PSScriptRoot\vs2022-settings.json"
Write-Output "installing PyOxidizer"
Invoke-Process msiexec.exe "/i ${prefix}\assets\PyOxidizer.msi /l* ${prefix}\assets\PyOxidizer.log /quiet"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/vs2022-settings.json Thu Dec 12 23:24:00 2024 -0500
@@ -0,0 +1,21 @@
+{
+ "version": "1.0",
+ "components": [
+ "Microsoft.VisualStudio.Component.Roslyn.Compiler",
+ "Microsoft.Component.MSBuild",
+ "Microsoft.VisualStudio.Component.CoreBuildTools",
+ "Microsoft.VisualStudio.Workload.MSBuildTools",
+ "Microsoft.VisualStudio.Component.Windows10SDK",
+ "Microsoft.VisualStudio.Component.VC.CoreBuildTools",
+ "Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
+ "Microsoft.VisualStudio.Component.VC.Redist.14.Latest",
+ "Microsoft.VisualStudio.Component.TextTemplating",
+ "Microsoft.VisualStudio.Component.VC.CoreIde",
+ "Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core",
+ "Microsoft.VisualStudio.Component.Windows10SDK.20348",
+ "Microsoft.VisualStudio.Workload.VCTools",
+ "Microsoft.VisualStudio.Component.VC.Tools.ARM64EC",
+ "Microsoft.VisualStudio.Component.VC.Tools.ARM64"
+ ],
+ "extensions": []
+}
\ No newline at end of file
--- a/tests/test-check-code.t Fri Dec 13 21:35:05 2024 -0500
+++ b/tests/test-check-code.t Thu Dec 12 23:24:00 2024 -0500
@@ -94,5 +94,6 @@
$ testrepohg files 'set:eol(dos)'
contrib/packaging/build-windows-wheels.bat
+ contrib/vs2022-settings.json
contrib/win32/hg.bat
contrib/win32/mercurial.ini