Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ __pycache__/
/out/
/tools/out/
/CMakeLists.txt.user
/*.log
*.log
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem

# How To Build With The Visual Studio IDE

1. Install Visual Studio 2022 17.13 Preview 4 or later.
1. Install Visual Studio 2022 17.14 Preview 1 or later.
* Select "Windows 11 SDK (10.0.22621.0)" in the VS Installer.
* Select "MSVC v143 - VS 2022 C++ ARM64/ARM64EC build tools (Latest)" in the VS Installer
if you would like to build the ARM64/ARM64EC target.
Expand All @@ -160,7 +160,7 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem

# How To Build With A Native Tools Command Prompt

1. Install Visual Studio 2022 17.13 Preview 4 or later.
1. Install Visual Studio 2022 17.14 Preview 1 or later.
* Select "Windows 11 SDK (10.0.22621.0)" in the VS Installer.
* Select "MSVC v143 - VS 2022 C++ ARM64/ARM64EC build tools (Latest)" in the VS Installer
if you would like to build the ARM64/ARM64EC target.
Expand Down
2 changes: 1 addition & 1 deletion azure-devops/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

variables:
- name: poolName
value: 'StlBuild-2025-01-28T1106-Pool'
value: 'StlBuild-2025-02-15T0137-Pool'
readonly: true
- name: poolDemands
value: 'EnableSpotVM -equals false'
Expand Down
41 changes: 21 additions & 20 deletions azure-devops/create-1es-hosted-pool.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ $VMSize = 'Standard_F32as_v6'
$ProtoVMName = 'PROTOTYPE'
$ImagePublisher = 'MicrosoftWindowsServer'
$ImageOffer = 'WindowsServer'
$ImageSku = '2025-datacenter-g2'
$ImageSku = '2025-datacenter-azure-edition'

$LogFile = '1es-hosted-pool.log'
$ProgressActivity = 'Preparing STL CI pool'
$TotalProgress = 26
$CurrentProgress = 1
Expand Down Expand Up @@ -78,13 +79,13 @@ $Env:SuppressAzurePowerShellBreakingChangeWarnings = 'true'

Update-AzConfig `
-DisplayBreakingChangeWarning $false `
-Scope 'Process' | Out-Null
-Scope 'Process' >> $LogFile

####################################################################################################
Display-ProgressBar -Status 'Setting the subscription context'

Set-AzContext `
-SubscriptionName 'CPP_STL_GitHub' | Out-Null
-SubscriptionName 'CPP_STL_GitHub' >> $LogFile

####################################################################################################
Display-ProgressBar -Status 'Creating resource group'
Expand All @@ -93,7 +94,7 @@ $ResourceGroupName = 'StlBuild-' + $CurrentDate.ToString('yyyy-MM-ddTHHmm')

New-AzResourceGroup `
-Name $ResourceGroupName `
-Location $Location | Out-Null
-Location $Location >> $LogFile

####################################################################################################
Display-ProgressBar -Status 'Creating credentials'
Expand Down Expand Up @@ -169,7 +170,7 @@ $VM = Set-AzVMBootDiagnostic `
New-AzVm `
-ResourceGroupName $ResourceGroupName `
-Location $Location `
-VM $VM | Out-Null
-VM $VM >> $LogFile

$VM = Get-AzVM `
-ResourceGroupName $ResourceGroupName `
Expand All @@ -192,7 +193,7 @@ if ($ProvisionImageResult.value.Message -cnotmatch 'PROVISION_IMAGE_SUCCEEDED')

Stop-AzVM `
-Id $VM.ID `
-Force | Out-Null
-Force >> $LogFile

Write-Error "VM stopped. Remember to delete unusable resource group: $ResourceGroupName"
}
Expand All @@ -201,7 +202,7 @@ if ($ProvisionImageResult.value.Message -cnotmatch 'PROVISION_IMAGE_SUCCEEDED')
Display-ProgressBar -Status 'Restarting VM'

Restart-AzVM `
-Id $VM.ID | Out-Null
-Id $VM.ID >> $LogFile

####################################################################################################
Display-ProgressBar -Status 'Sleeping after restart'
Expand All @@ -216,7 +217,7 @@ Display-ProgressBar -Status 'Running sysprep in VM'
Invoke-AzVMRunCommand `
-ResourceId $VM.ID `
-CommandId 'RunPowerShellScript' `
-ScriptString 'C:\Windows\system32\sysprep\sysprep.exe /oobe /generalize /mode:vm /shutdown' | Out-Null
-ScriptString 'C:\Windows\system32\sysprep\sysprep.exe /oobe /generalize /mode:vm /shutdown' >> $LogFile

####################################################################################################
Display-ProgressBar -Status 'Waiting for VM to shut down'
Expand All @@ -230,14 +231,14 @@ Display-ProgressBar -Status 'Stopping VM'

Stop-AzVM `
-Id $VM.ID `
-Force | Out-Null
-Force >> $LogFile

####################################################################################################
Display-ProgressBar -Status 'Generalizing VM'

Set-AzVM `
-Id $VM.ID `
-Generalized | Out-Null
-Generalized >> $LogFile

####################################################################################################
Display-ProgressBar -Status 'Creating gallery'
Expand All @@ -256,7 +257,7 @@ $ServicePrincipalObjectId = (Get-AzADServicePrincipal -DisplayName '1ES Resource
New-AzRoleAssignment `
-ObjectId $ServicePrincipalObjectId `
-RoleDefinitionName 'Reader' `
-Scope $Gallery.Id | Out-Null
-Scope $Gallery.Id >> $LogFile

####################################################################################################
Display-ProgressBar -Status 'Creating image definition'
Expand All @@ -276,7 +277,7 @@ New-AzGalleryImageDefinition `
-Offer $ImageOffer `
-Sku $ImageSku `
-Feature $ImageDefinitionFeatures `
-HyperVGeneration 'V2' | Out-Null
-HyperVGeneration 'V2' >> $LogFile

####################################################################################################
Display-ProgressBar -Status 'Creating image version'
Expand All @@ -294,7 +295,7 @@ $ImageVersion = New-AzGalleryImageVersion `
Display-ProgressBar -Status 'Registering CloudTest resource provider'

Register-AzResourceProvider `
-ProviderNamespace 'Microsoft.CloudTest' | Out-Null
-ProviderNamespace 'Microsoft.CloudTest' >> $LogFile

####################################################################################################
Display-ProgressBar -Status 'Creating 1ES image'
Expand All @@ -306,7 +307,7 @@ New-AzResource `
-ResourceType 'Microsoft.CloudTest/Images' `
-ResourceName $ImageName `
-Properties @{ 'imageType' = 'SharedImageGallery'; 'resourceId' = $ImageVersion.Id; } `
-Force | Out-Null
-Force >> $LogFile

####################################################################################################
Display-ProgressBar -Status 'Creating 1ES Hosted Pool'
Expand All @@ -328,46 +329,46 @@ New-AzResource `
-ResourceType 'Microsoft.CloudTest/hostedpools' `
-ResourceName $PoolName `
-Properties $PoolProperties `
-Force | Out-Null
-Force >> $LogFile

####################################################################################################
Display-ProgressBar -Status 'Deleting unused VM'

Remove-AzVM `
-Id $VM.ID `
-Force | Out-Null
-Force >> $LogFile

####################################################################################################
Display-ProgressBar -Status 'Deleting unused disk'

Remove-AzDisk `
-ResourceGroupName $ResourceGroupName `
-DiskName $PrototypeOSDiskName `
-Force | Out-Null
-Force >> $LogFile

####################################################################################################
Display-ProgressBar -Status 'Deleting unused network interface'

Remove-AzNetworkInterface `
-ResourceGroupName $ResourceGroupName `
-Name $NicName `
-Force | Out-Null
-Force >> $LogFile

####################################################################################################
Display-ProgressBar -Status 'Deleting unused virtual network'

Remove-AzVirtualNetwork `
-ResourceGroupName $ResourceGroupName `
-Name $VirtualNetworkName `
-Force | Out-Null
-Force >> $LogFile

####################################################################################################
Display-ProgressBar -Status 'Deleting unused network security group'

Remove-AzNetworkSecurityGroup `
-ResourceGroupName $ResourceGroupName `
-Name $NetworkSecurityGroupName `
-Force | Out-Null
-Force >> $LogFile

####################################################################################################
Write-Progress -Activity $ProgressActivity -Completed
Expand Down
12 changes: 10 additions & 2 deletions azure-devops/provision-image.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ foreach ($workload in $VisualStudioWorkloads) {
$PowerShellUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.5.0/PowerShell-7.5.0-win-x64.msi'
$PowerShellArgs = @('/quiet', '/norestart')

$PythonUrl = 'https://www.python.org/ftp/python/3.13.1/python-3.13.1-amd64.exe'
$PythonUrl = 'https://www.python.org/ftp/python/3.13.2/python-3.13.2-amd64.exe'
$PythonArgs = @('/quiet', 'InstallAllUsers=1', 'PrependPath=1', 'CompileAll=1', 'Include_doc=0')

# TRANSITION, GH-5282: Install only nvcc and cudart, then manually add CUDA to the PATH (see below).
$CudaUrl = 'https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_551.61_windows.exe'
$CudaArgs = @('-s', '-n', 'nvcc_12.4')
$CudaArgs = @('-s', '-n', 'nvcc_12.4', 'cudart_12.4')
$CudaPath = 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\bin'

<#
.SYNOPSIS
Expand Down Expand Up @@ -112,6 +114,12 @@ DownloadAndInstall -Name 'CUDA' -Url $CudaUrl -Args $CudaArgs

Write-Host 'Setting environment variables...'

# TRANSITION, GH-5282: Manually add CUDA to the PATH.
# Don't use $Env:PATH here - that's the local path for this running script, captured before we installed anything.
# The machine path was just updated by the installers above.
$machinePath = [Environment]::GetEnvironmentVariable('Path', 'Machine')
[Environment]::SetEnvironmentVariable('Path', "$machinePath;$CudaPath", 'Machine')

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

Expand Down
2 changes: 1 addition & 1 deletion docs/import_library.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The caveats of this technique are:
+ This limitation is subtle (not readily apparent from the source code) and critical.
If shared global state is necessary, our only option while preserving bincompat is adding a satellite DLL.
* Due to having just two flavors of the import library (debug and release),
we cannot use anything that depends on `_CONTAINER_DEBUG_LEVEL` or `_ITERATOR_DEBUG_LEVEL`.
we cannot use anything that depends on `_ITERATOR_DEBUG_LEVEL`.

For these reasons, especially the last one, we need to strictly control what is used by the import library.
In particular, `basic_string` must not be used there.
Expand Down
14 changes: 7 additions & 7 deletions stl/inc/__msvc_bit_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,19 +337,19 @@ constexpr decltype(auto) _Select_countr_zero_impl(_Fn _Callback) {
#if _HAS_TZCNT_BSF_INTRINSICS && _HAS_CXX20
if (!_STD is_constant_evaluated()) {
#ifdef __AVX2__
return _Callback([](_Ty _Val) _STATIC_CALL_OPERATOR { return _Countr_zero_tzcnt(_Val); });
return _Callback([](_Ty _Val) _STATIC_LAMBDA { return _Countr_zero_tzcnt(_Val); });
#else // ^^^ AVX2 / not AVX2 vvv
const bool _Definitely_have_tzcnt = __isa_available >= _Stl_isa_available_avx2;
if (_Definitely_have_tzcnt) {
return _Callback([](_Ty _Val) _STATIC_CALL_OPERATOR { return _Countr_zero_tzcnt(_Val); });
return _Callback([](_Ty _Val) _STATIC_LAMBDA { return _Countr_zero_tzcnt(_Val); });
} else {
return _Callback([](_Ty _Val) _STATIC_CALL_OPERATOR { return _Countr_zero_bsf(_Val); });
return _Callback([](_Ty _Val) _STATIC_LAMBDA { return _Countr_zero_bsf(_Val); });
}
#endif // ^^^ not AVX2 ^^^
}
#endif // ^^^ _HAS_TZCNT_BSF_INTRINSICS && _HAS_CXX20 ^^^
// C++17 constexpr gcd() calls this function, so it should be constexpr unless we detect runtime evaluation.
return _Callback([](_Ty _Val) _STATIC_CALL_OPERATOR { return _Countr_zero_fallback(_Val); });
return _Callback([](_Ty _Val) _STATIC_LAMBDA { return _Countr_zero_fallback(_Val); });
}

template <class _Ty, enable_if_t<_Is_standard_unsigned_integer<_Ty>, int> = 0>
Expand All @@ -376,13 +376,13 @@ _CONSTEXPR20 decltype(auto) _Select_popcount_impl(_Fn _Callback) {
#if !_POPCNT_INTRINSICS_ALWAYS_AVAILABLE
const bool _Definitely_have_popcnt = __isa_available >= _Stl_isa_available_sse42;
if (!_Definitely_have_popcnt) {
return _Callback([](_Ty _Val) _STATIC_CALL_OPERATOR { return _Popcount_fallback(_Val); });
return _Callback([](_Ty _Val) _STATIC_LAMBDA { return _Popcount_fallback(_Val); });
}
#endif // ^^^ !_POPCNT_INTRINSICS_ALWAYS_AVAILABLE ^^^
return _Callback([](_Ty _Val) _STATIC_CALL_OPERATOR { return _Unchecked_popcount(_Val); });
return _Callback([](_Ty _Val) _STATIC_LAMBDA { return _Unchecked_popcount(_Val); });
}
#endif // ^^^ _HAS_POPCNT_INTRINSICS ^^^
return _Callback([](_Ty _Val) _STATIC_CALL_OPERATOR { return _Popcount_fallback(_Val); });
return _Callback([](_Ty _Val) _STATIC_LAMBDA { return _Popcount_fallback(_Val); });
}

#undef _HAS_POPCNT_INTRINSICS
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/__msvc_ranges_to.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ namespace ranges {
"the default-constructed object. (N4981 [range.utility.conv.to]/2.1.5)");
}
} else if constexpr (input_range<range_reference_t<_Rng>>) {
const auto _Xform = [](auto&& _Elem) _STATIC_CALL_OPERATOR {
const auto _Xform = [](auto&& _Elem) _STATIC_LAMBDA {
return _RANGES to<range_value_t<_Container>>(_STD forward<decltype(_Elem)>(_Elem));
};
return _RANGES to<_Container>(views::transform(ref_view{_Range}, _Xform), _STD forward<_Types>(_Args)...);
Expand Down
4 changes: 2 additions & 2 deletions stl/inc/__msvc_ranges_tuple_formatter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class basic_format_arg {
template <class _Ty>
explicit handle(_Ty& _Val) noexcept
: _Ptr(_STD addressof(_Val)), _Format([](basic_format_parse_context<_CharType>& _Parse_ctx,
_Context& _Format_ctx, const void* _Ptr) _STATIC_CALL_OPERATOR {
_Context& _Format_ctx, const void* _Ptr) _STATIC_LAMBDA {
using _Td = remove_const_t<_Ty>;
// doesn't drop const-qualifier per an unnumbered LWG issue
using _Tq = conditional_t<_Formattable_with<const _Ty, _Context>, const _Ty, _Ty>;
Expand Down Expand Up @@ -324,7 +324,7 @@ class basic_format_arg {
case _Basic_format_arg_type::_Custom_type:
return _STD forward<_Visitor>(_Vis)(_Custom_state);
default:
_STL_VERIFY(false, "basic_format_arg is in impossible state");
_STL_REPORT_ERROR("basic_format_arg contains an impossible type");
int _Dummy{};
return _STD forward<_Visitor>(_Vis)(_Dummy);
}
Expand Down
20 changes: 10 additions & 10 deletions stl/inc/__msvc_string_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,7 @@ class basic_string_view { // wrapper for any kind of contiguous character buffer
: _Mydata(_Cts), _Mysize(_Count) {
#if _CONTAINER_DEBUG_LEVEL > 0
_STL_VERIFY(_Count == 0 || _Cts, "non-zero size null string_view");
#endif // _CONTAINER_DEBUG_LEVEL > 0
#endif
}

#if _HAS_CXX20
Expand Down Expand Up @@ -1476,7 +1476,7 @@ class basic_string_view { // wrapper for any kind of contiguous character buffer
_NODISCARD constexpr const_reference operator[](const size_type _Off) const noexcept /* strengthened */ {
#if _CONTAINER_DEBUG_LEVEL > 0
_STL_VERIFY(_Off < _Mysize, "string_view subscript out of range");
#endif // _CONTAINER_DEBUG_LEVEL > 0
#endif

// CodeQL [SM01954] This index is optionally validated above.
return _Mydata[_Off];
Expand All @@ -1490,30 +1490,30 @@ class basic_string_view { // wrapper for any kind of contiguous character buffer

_NODISCARD constexpr const_reference front() const noexcept /* strengthened */ {
#if _CONTAINER_DEBUG_LEVEL > 0
_STL_VERIFY(_Mysize != 0, "cannot call front on empty string_view");
#endif // _CONTAINER_DEBUG_LEVEL > 0
_STL_VERIFY(_Mysize != 0, "front() called on empty string_view");
#endif
return _Mydata[0];
}

_NODISCARD constexpr const_reference back() const noexcept /* strengthened */ {
#if _CONTAINER_DEBUG_LEVEL > 0
_STL_VERIFY(_Mysize != 0, "cannot call back on empty string_view");
#endif // _CONTAINER_DEBUG_LEVEL > 0
_STL_VERIFY(_Mysize != 0, "back() called on empty string_view");
#endif
return _Mydata[_Mysize - 1];
}

constexpr void remove_prefix(const size_type _Count) noexcept /* strengthened */ {
#if _CONTAINER_DEBUG_LEVEL > 0
_STL_VERIFY(_Mysize >= _Count, "cannot remove prefix longer than total size");
#endif // _CONTAINER_DEBUG_LEVEL > 0
_STL_VERIFY(_Mysize >= _Count, "cannot remove_prefix() larger than string_view size");
#endif
_Mydata += _Count;
_Mysize -= _Count;
}

constexpr void remove_suffix(const size_type _Count) noexcept /* strengthened */ {
#if _CONTAINER_DEBUG_LEVEL > 0
_STL_VERIFY(_Mysize >= _Count, "cannot remove suffix longer than total size");
#endif // _CONTAINER_DEBUG_LEVEL > 0
_STL_VERIFY(_Mysize >= _Count, "cannot remove_suffix() larger than string_view size");
#endif
_Mysize -= _Count;
}

Expand Down
4 changes: 1 addition & 3 deletions stl/inc/algorithm
Original file line number Diff line number Diff line change
Expand Up @@ -7157,9 +7157,7 @@ _CONSTEXPR20 void sort_heap(_RanIt _First, _RanIt _Last, _Pr _Pred) { // order h
const auto _ULast = _STD _Get_unwrapped(_Last);
#if _ITERATOR_DEBUG_LEVEL == 2
const auto _Counterexample = _STD _Is_heap_until_unchecked(_UFirst, _ULast, _STD _Pass_fn(_Pred));
if (_Counterexample != _ULast) {
_STL_REPORT_ERROR("invalid heap in sort_heap()");
}
_STL_VERIFY(_Counterexample == _ULast, "invalid heap in sort_heap()");
#endif // _ITERATOR_DEBUG_LEVEL == 2
_STD _Sort_heap_unchecked(_UFirst, _ULast, _STD _Pass_fn(_Pred));
}
Expand Down
Loading