Skip to content

Commit 3bcc719

Browse files
Toolset update: MSVC Compiler 19.50.35702, test <filesystem> long path support (#5783)
1 parent 85e4b57 commit 3bcc719

File tree

27 files changed

+287
-100
lines changed

27 files changed

+287
-100
lines changed

CMakeLists.txt

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Copyright (c) Microsoft Corporation.
22
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
33

4-
cmake_minimum_required(VERSION 3.31.0)
4+
cmake_minimum_required(VERSION 4.1.1)
55

66
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
77
project(msvc_standard_libraries LANGUAGES CXX)
88

9-
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.50.35503")
10-
message(FATAL_ERROR "The STL must be built with MSVC Compiler 19.50 Preview 1 or later.")
9+
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.50.35702")
10+
message(FATAL_ERROR "The STL must be built with MSVC Compiler 19.50.35702 or later.")
1111
endif()
1212

1313
include(CheckCXXSourceCompiles)
@@ -112,13 +112,7 @@ endif()
112112

113113
set(VCLIBS_DEBUG_OPTIONS "$<$<COMPILE_LANGUAGE:CXX>:/Od>")
114114

115-
# TRANSITION: Potentially remove `/Os` if it results in speed improvements.
116-
# This requires benchmarking!
117-
# Note that in MSVC version 19.32.31328,
118-
# `/Os` results in a binary size difference of 102K
119-
# in the release DLL (a gain of 18.4%).
120-
# So, make certain that that tradeoff is considered when or if `/Os` is removed.
121-
# See GH-2108 for more info.
115+
# TRANSITION, GH-2108: Investigate building the STL with only /O2, not /Os.
122116
set(VCLIBS_RELEASE_OPTIONS "$<$<COMPILE_LANGUAGE:CXX>:/O2;/Os>")
123117

124118
if(BUILD_TESTING)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem
151151
- "Windows 11 SDK (10.0.26100)" or later
152152
- "C++ Clang tools for Windows (20.1.8 - x64/x86)"
153153
- *Optional, see Note 2 below:* "MSVC v145 - C++ ARM64/ARM64EC build tools (Latest)"
154-
* Install [Python][] 3.13 or later.
154+
* Install [Python][] 3.14.0 or later.
155155
+ Select "Add python.exe to PATH" if you want to follow the instructions below that invoke `python`.
156156
Otherwise, you should be familiar with alternative methods.
157157

azure-devops/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
variables:
77
- name: poolName
8-
value: 'StlBuild-2025-09-09T1526-Pool'
8+
value: 'Stl-2025-10-14T1635-x64-Pool'
99
readonly: true
1010
- name: poolDemands
1111
value: 'EnableSpotVM -equals false'

azure-devops/create-1es-hosted-pool.ps1

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,18 @@ See https://github.com/microsoft/STL/wiki/Checklist-for-Toolset-Updates for more
1212
$ErrorActionPreference = 'Stop'
1313

1414
$CurrentDate = Get-Date
15+
$Timestamp = $CurrentDate.ToString('yyyy-MM-ddTHHmm')
16+
$Arch = 'x64'
1517

1618
$Location = 'eastus2'
1719
$VMSize = 'Standard_F32as_v6'
20+
$PoolSize = 64
1821
$ProtoVMName = 'PROTOTYPE'
1922
$ImagePublisher = 'MicrosoftWindowsServer'
2023
$ImageOffer = 'WindowsServer'
2124
$ImageSku = '2025-datacenter-azure-edition'
2225

23-
$LogFile = '1es-hosted-pool.log'
26+
$LogFile = "1es-hosted-pool-$Timestamp-$Arch.log"
2427
$ProgressActivity = 'Preparing STL CI pool'
2528
$TotalProgress = 38
2629
$CurrentProgress = 1
@@ -82,15 +85,16 @@ Update-AzConfig `
8285
-Scope 'Process' >> $LogFile
8386

8487
####################################################################################################
85-
Display-ProgressBar -Status 'Setting the subscription context'
88+
Display-ProgressBar -Status 'Getting the subscription context'
8689

87-
Set-AzContext `
88-
-SubscriptionName 'CPP_STL_GitHub' >> $LogFile
90+
if ((Get-AzContext).Subscription.Name -cne 'CPP_STL_GitHub') {
91+
Write-Error 'Please sign in with `Connect-AzAccount -Subscription ''CPP_STL_GitHub''` before running this script.'
92+
}
8993

9094
####################################################################################################
9195
Display-ProgressBar -Status 'Creating resource group'
9296

93-
$ResourceGroupName = 'StlBuild-' + $CurrentDate.ToString('yyyy-MM-ddTHHmm')
97+
$ResourceGroupName = "Stl-$Timestamp-$Arch"
9498

9599
New-AzResourceGroup `
96100
-Name $ResourceGroupName `
@@ -105,7 +109,7 @@ $Credential = New-Object System.Management.Automation.PSCredential ('AdminUser',
105109
####################################################################################################
106110
Display-ProgressBar -Status 'Creating public IP address'
107111

108-
$PublicIpAddressName = $ResourceGroupName + '-PublicIpAddress'
112+
$PublicIpAddressName = "$ResourceGroupName-PublicIpAddress"
109113
$PublicIpAddress = New-AzPublicIpAddress `
110114
-Name $PublicIpAddressName `
111115
-ResourceGroupName $ResourceGroupName `
@@ -116,7 +120,7 @@ $PublicIpAddress = New-AzPublicIpAddress `
116120
####################################################################################################
117121
Display-ProgressBar -Status 'Creating NAT gateway'
118122

119-
$NatGatewayName = $ResourceGroupName + '-NatGateway'
123+
$NatGatewayName = "$ResourceGroupName-NatGateway"
120124
$NatGateway = New-AzNatGateway `
121125
-Name $NatGatewayName `
122126
-ResourceGroupName $ResourceGroupName `
@@ -128,7 +132,7 @@ $NatGateway = New-AzNatGateway `
128132
####################################################################################################
129133
Display-ProgressBar -Status 'Creating network security group'
130134

131-
$NetworkSecurityGroupName = $ResourceGroupName + '-NetworkSecurity'
135+
$NetworkSecurityGroupName = "$ResourceGroupName-NetworkSecurity"
132136
$NetworkSecurityGroup = New-AzNetworkSecurityGroup `
133137
-Name $NetworkSecurityGroupName `
134138
-ResourceGroupName $ResourceGroupName `
@@ -137,10 +141,12 @@ $NetworkSecurityGroup = New-AzNetworkSecurityGroup `
137141
####################################################################################################
138142
Display-ProgressBar -Status 'Creating virtual network subnet config'
139143

140-
# TRANSITION, 2025-09-30: "On September 30, 2025, default outbound access for new deployments will be retired."
144+
# TRANSITION, 2026-03-31: "After March 31, 2026, new virtual networks will default to using private subnets,
145+
# meaning that an explicit outbound method must be enabled in order to reach public endpoints on the Internet
146+
# and within Microsoft."
141147
# https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/default-outbound-access
142148
# We're using `-DefaultOutboundAccess $false` to opt-in early.
143-
$SubnetName = $ResourceGroupName + '-Subnet'
149+
$SubnetName = "$ResourceGroupName-Subnet"
144150
$Subnet = New-AzVirtualNetworkSubnetConfig `
145151
-Name $SubnetName `
146152
-AddressPrefix '10.0.0.0/16' `
@@ -151,7 +157,7 @@ $Subnet = New-AzVirtualNetworkSubnetConfig `
151157
####################################################################################################
152158
Display-ProgressBar -Status 'Creating virtual network'
153159

154-
$VirtualNetworkName = $ResourceGroupName + '-Network'
160+
$VirtualNetworkName = "$ResourceGroupName-Network"
155161
$VirtualNetwork = New-AzVirtualNetwork `
156162
-Name $VirtualNetworkName `
157163
-ResourceGroupName $ResourceGroupName `
@@ -162,7 +168,7 @@ $VirtualNetwork = New-AzVirtualNetwork `
162168
####################################################################################################
163169
Display-ProgressBar -Status 'Creating network interface'
164170

165-
$NicName = $ResourceGroupName + '-NIC'
171+
$NicName = "$ResourceGroupName-NIC"
166172
$Nic = New-AzNetworkInterface `
167173
-Name $NicName `
168174
-ResourceGroupName $ResourceGroupName `
@@ -295,7 +301,7 @@ Set-AzVM `
295301
####################################################################################################
296302
Display-ProgressBar -Status 'Creating gallery'
297303

298-
$GalleryName = 'StlBuild_' + $CurrentDate.ToString('yyyy_MM_ddTHHmm') + '_Gallery'
304+
$GalleryName = "$ResourceGroupName-Gallery" -replace '-', '_'
299305
$Gallery = New-AzGallery `
300306
-Location $Location `
301307
-ResourceGroupName $ResourceGroupName `
@@ -314,7 +320,7 @@ New-AzRoleAssignment `
314320
####################################################################################################
315321
Display-ProgressBar -Status 'Creating image definition'
316322

317-
$ImageDefinitionName = $ResourceGroupName + '-ImageDefinition'
323+
$ImageDefinitionName = "$ResourceGroupName-ImageDefinition"
318324
$FeatureTrustedLaunch = @{ Name = 'SecurityType'; Value = 'TrustedLaunch'; }
319325
$FeatureNVMe = @{ Name = 'DiskControllerTypes'; Value = 'SCSI, NVMe'; }
320326
$ImageDefinitionFeatures = @($FeatureTrustedLaunch, $FeatureNVMe)
@@ -352,7 +358,7 @@ Register-AzResourceProvider `
352358
####################################################################################################
353359
Display-ProgressBar -Status 'Creating 1ES image'
354360

355-
$ImageName = $ResourceGroupName + '-Image'
361+
$ImageName = "$ResourceGroupName-Image"
356362
New-AzResource `
357363
-Location $Location `
358364
-ResourceGroupName $ResourceGroupName `
@@ -364,14 +370,14 @@ New-AzResource `
364370
####################################################################################################
365371
Display-ProgressBar -Status 'Creating 1ES Hosted Pool'
366372

367-
$PoolName = $ResourceGroupName + '-Pool'
373+
$PoolName = "$ResourceGroupName-Pool"
368374

369375
$PoolProperties = @{
370376
'organization' = 'https://dev.azure.com/vclibs'
371377
'projects' = @('STL')
372378
'sku' = @{ 'name' = $VMSize; 'tier' = 'StandardSSD'; 'enableSpot' = $false; }
373379
'images' = @(@{ 'imageName' = $ImageName; 'poolBufferPercentage' = '100'; })
374-
'maxPoolSize' = 64
380+
'maxPoolSize' = $PoolSize
375381
'agentProfile' = @{ 'type' = 'Stateless'; }
376382
}
377383

azure-devops/provision-image.ps1

Lines changed: 50 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ if ($Env:COMPUTERNAME -cne 'PROTOTYPE') {
1919
Write-Error 'You should not run provision-image.ps1 on your local machine.'
2020
}
2121

22+
if ($Env:PROCESSOR_ARCHITECTURE -ceq 'AMD64') {
23+
Write-Host 'Provisioning x64.'
24+
$Provisioning_x64 = $true
25+
} elseif ($Env:PROCESSOR_ARCHITECTURE -ceq 'ARM64') {
26+
Write-Host 'Provisioning ARM64.'
27+
$Provisioning_x64 = $false
28+
} else {
29+
Write-Error "Unrecognized PROCESSOR_ARCHITECTURE: '$Env:PROCESSOR_ARCHITECTURE'"
30+
}
31+
2232
$VisualStudioWorkloads = @(
2333
'Microsoft.VisualStudio.Component.VC.ASAN',
2434
'Microsoft.VisualStudio.Component.VC.CLI.Support',
@@ -31,6 +41,10 @@ $VisualStudioWorkloads = @(
3141
'Microsoft.VisualStudio.Component.Windows11SDK.26100'
3242
)
3343

44+
# https://learn.microsoft.com/en-us/visualstudio/install/visual-studio-on-arm-devices
45+
# "There's a single installer for both Visual Studio x64 and Visual Studio Arm64 architectures.
46+
# The Visual Studio Installer detects whether the system architecture is Arm64.
47+
# If it is, the installer downloads and installs the Arm64 version of Visual Studio."
3448
$VisualStudioUrl = 'https://aka.ms/vs/18/insiders/vs_Community.exe'
3549
$VisualStudioArgs = @('--quiet', '--norestart', '--wait', '--nocache')
3650
foreach ($workload in $VisualStudioWorkloads) {
@@ -39,13 +53,27 @@ foreach ($workload in $VisualStudioWorkloads) {
3953
}
4054

4155
# https://github.com/PowerShell/PowerShell/releases/latest
42-
$PowerShellUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.5.2/PowerShell-7.5.2-win-x64.msi'
56+
if ($Provisioning_x64) {
57+
$PowerShellUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.5.3/PowerShell-7.5.3-win-x64.msi'
58+
} else {
59+
$PowerShellUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.5.3/PowerShell-7.5.3-win-arm64.msi'
60+
}
4361
$PowerShellArgs = @('/quiet', '/norestart')
4462

45-
$PythonUrl = 'https://www.python.org/ftp/python/3.13.7/python-3.13.7-amd64.exe'
63+
# https://www.python.org
64+
if ($Provisioning_x64) {
65+
$PythonUrl = 'https://www.python.org/ftp/python/3.14.0/python-3.14.0-amd64.exe'
66+
} else {
67+
$PythonUrl = 'https://www.python.org/ftp/python/3.14.0/python-3.14.0-arm64.exe'
68+
}
4669
$PythonArgs = @('/quiet', 'InstallAllUsers=1', 'PrependPath=1', 'CompileAll=1', 'Include_doc=0')
4770

48-
$CudaUrl = 'https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_551.61_windows.exe'
71+
# https://developer.nvidia.com/cuda-toolkit
72+
if ($Provisioning_x64) {
73+
$CudaUrl = 'https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_551.61_windows.exe'
74+
} else {
75+
$CudaUrl = 'CUDA is not installed for ARM64'
76+
}
4977
$CudaArgs = @('-s', '-n')
5078

5179
<#
@@ -91,10 +119,16 @@ Function DownloadAndInstall {
91119
} else {
92120
Write-Error "Installation failed! Exited with $exitCode."
93121
}
122+
} catch {
123+
Write-Error "Installation failed! Exception: $($_.Exception.Message)"
124+
}
94125

126+
try {
127+
# Briefly sleep before removing the installer, attempting to avoid "Access to the path '$installerPath' is denied."
128+
Start-Sleep -Seconds 5
95129
Remove-Item -Path $installerPath
96130
} catch {
97-
Write-Error "Installation failed! Exception: $($_.Exception.Message)"
131+
Write-Error "Remove-Item failed! Exception: $($_.Exception.Message)"
98132
}
99133
}
100134

@@ -104,16 +138,24 @@ Write-Host "Old PowerShell version: $($PSVersionTable.PSVersion)"
104138
# Skip a blank line to improve the output.
105139
(cmd /c ver)[1]
106140

107-
DownloadAndInstall -Name 'PowerShell' -Url $PowerShellUrl -Args $PowerShellArgs
108-
DownloadAndInstall -Name 'Python' -Url $PythonUrl -Args $PythonArgs
109-
DownloadAndInstall -Name 'Visual Studio' -Url $VisualStudioUrl -Args $VisualStudioArgs
110-
DownloadAndInstall -Name 'CUDA' -Url $CudaUrl -Args $CudaArgs
141+
DownloadAndInstall -Name 'PowerShell' -Url $PowerShellUrl -Args $PowerShellArgs
142+
DownloadAndInstall -Name 'Python' -Url $PythonUrl -Args $PythonArgs
143+
DownloadAndInstall -Name 'Visual Studio' -Url $VisualStudioUrl -Args $VisualStudioArgs
144+
if ($Provisioning_x64) {
145+
DownloadAndInstall -Name 'CUDA' -Url $CudaUrl -Args $CudaArgs
146+
}
111147

112148
Write-Host 'Setting environment variables...'
113149

114150
# The STL's PR/CI builds are totally unrepresentative of customer usage.
115151
[Environment]::SetEnvironmentVariable('VSCMD_SKIP_SENDTELEMETRY', '1', 'Machine')
116152

153+
Write-Host 'Enabling long paths...'
154+
155+
# https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=powershell
156+
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' `
157+
-Value 1 -PropertyType DWORD -Force | Out-Null
158+
117159
# Tell create-1es-hosted-pool.ps1 that we succeeded.
118160
Write-Host 'PROVISION_IMAGE_SUCCEEDED'
119161

benchmarks/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) Microsoft Corporation.
22
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
33

4-
cmake_minimum_required(VERSION 3.31.0)
4+
cmake_minimum_required(VERSION 4.1.1)
55
project(msvc_standard_libraries_benchmarks LANGUAGES CXX)
66

77
if(DEFINED STL_BINARY_DIR)

boost-math

Submodule boost-math updated 1766 files

stl/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ set(SATELLITE_DLL_SOURCES
400400
set(CMAKE_CXX_FLAGS "")
401401
set(CMAKE_CXX_FLAGS_DEBUG "")
402402
set(CMAKE_CXX_FLAGS_RELEASE "")
403+
set(CMAKE_MSVC_RUNTIME_CHECKS "")
403404
set(CMAKE_CXX_STANDARD_LIBRARIES "kernel32.lib")
404405
set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "kernel32.lib")
405406
set(CMAKE_MSVC_RUNTIME_LIBRARY "")

stl/inc/xutility

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -876,17 +876,10 @@ namespace ranges {
876876
return type_identity<decltype(iter_move(_STD declval<_Ty>()))>{}; // intentional ADL
877877
} else if constexpr (_Can_deref<_Ty>) {
878878
using _Ref = decltype(*_STD declval<_Ty>());
879-
#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-1008447, VSO-2066340
880-
if constexpr (is_function_v<remove_reference_t<_Ref>>) {
881-
return type_identity<_Ref&>{};
882-
} else
883-
#endif // ^^^ workaround ^^^
884-
{
885-
if constexpr (is_lvalue_reference_v<_Ref>) {
886-
return type_identity<remove_reference_t<_Ref>&&>{};
887-
} else {
888-
return type_identity<_Ref>{};
889-
}
879+
if constexpr (is_lvalue_reference_v<_Ref>) {
880+
return type_identity<remove_reference_t<_Ref>&&>{};
881+
} else {
882+
return type_identity<_Ref>{};
890883
}
891884
} else {
892885
return _Must_have_ADL_found_iter_move_or_be_dereferenceable{};

stl/src/special_math.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#pragma warning(push)
1111
#pragma warning(disable : 4702) // unreachable code
12+
#pragma warning(disable : 4714) // function marked as __forceinline not inlined
1213

1314
#define BOOST_MATH_DOMAIN_ERROR_POLICY errno_on_error
1415
#define BOOST_MATH_OVERFLOW_ERROR_POLICY ignore_error

0 commit comments

Comments
 (0)