Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toolset update: VS 2022 17.6 Preview 3 #3651

Merged
merged 28 commits into from
Apr 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
60ab5aa
Use PowerShell 7.3.3.
StephanTLavavej Mar 14, 2023
4560b69
Drop the Spectre libs.
StephanTLavavej Mar 15, 2023
9a220ed
Drop unused InstallPath and Nickname parameters.
StephanTLavavej Mar 15, 2023
3fd509a
Drop unused `$ReleaseInPath` and `$Sku` variables.
StephanTLavavej Mar 15, 2023
7f459a4
Use Update-AzConfig to silence breaking change warnings.
StephanTLavavej Mar 15, 2023
d9bb6e6
Enable trusted launch, supported as of 2023-03-20.
StephanTLavavej Oct 15, 2022
d483b83
Python 3.11.3.
StephanTLavavej Apr 11, 2023
8030937
New pool.
StephanTLavavej Apr 11, 2023
d8c99cb
VS 2022 17.6 Preview 3.
StephanTLavavej Apr 11, 2023
02e729a
Require CMake 3.26.0.
StephanTLavavej Apr 11, 2023
8ae0680
Pass my new `/quiet` option to `ml[64]`.
StephanTLavavej Apr 11, 2023
9ef4aa5
Remove workarounds for DevCom-10265322 "Equality comparison with reve…
StephanTLavavej Apr 11, 2023
cb52791
Remove workarounds for VSO-1734935 "Copy elision fails in permissive …
StephanTLavavej Apr 11, 2023
56ee170
Remove workaround for DevCom-10247495 "MSVC forces us to export some …
StephanTLavavej Apr 11, 2023
2da4ea7
Remove workaround for VSO-1582358 "Standard Library Modules: chrono f…
StephanTLavavej Apr 11, 2023
8b25452
Remove workarounds for VSO-1592329 "Standard Library Modules: Paralle…
StephanTLavavej Apr 11, 2023
7f6329f
Remove workaround for VSO-1705654 "Standard Library Modules: /analyze…
StephanTLavavej Apr 11, 2023
56fec84
Remove workaround for VSO-1726729 "REPORTED: EDG rejects constexpr ve…
StephanTLavavej Apr 11, 2023
cfc636e
Remove workarounds for VSO-1161663 "REPORTED: [Feedback] EDG constexp…
StephanTLavavej Apr 11, 2023
81716b8
Remove numerous workarounds for VSO-1726722 "REPORTED: EDG rejects co…
StephanTLavavej Apr 11, 2023
2e375b5
Fully remove workaround for VSO-1592409 "Standard Library Modules: so…
StephanTLavavej Apr 11, 2023
0c00f45
Simplify `<atomic>`: `intrin0.inl.h` has been updated to always defin…
StephanTLavavej Apr 11, 2023
13a5d0d
Keep 5 workarounds for VSO-1799670 "EDG rejects constexpr vector in d…
StephanTLavavej Apr 12, 2023
a763cda
Fix signed/unsigned mismatch warnings for ARM64 `__stlr`.
StephanTLavavej Apr 12, 2023
235e263
Fix signed/unsigned mismatch warnings for ARM64 `__load_acquire`.
StephanTLavavej Apr 12, 2023
2dd5060
`<atomic>`: Clang ARM64 lacks `__load_acquire`/`__stlr`.
StephanTLavavej Apr 12, 2023
5f94c30
Improve bug-report.md Markdown.
StephanTLavavej Apr 12, 2023
b4675c3
Update bug-report.md for VS 2022, add `/std:c++latest`.
StephanTLavavej Apr 12, 2023
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
33 changes: 19 additions & 14 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ assignees: ''

---

**Describe the bug**
# Describe the bug
A clear and concise description of what the bug is. Please check that you've
read the guidelines for submitting STL bug reports in `README.md`. If you are
having problems with any component that is not the STL, instructions to get
to the right place are there.

**Command-line test case**
# Command-line test case
```
C:\Temp>type repro.cpp
#include <iostream>
Expand All @@ -26,12 +26,18 @@ int main() {
std::cout << "test failure\n";
}

C:\Temp>cl /EHsc /W4 /WX .\repro.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.23.28019.1 for x64
C:\Temp>cl /EHsc /W4 /WX /std:c++latest .\repro.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.36.32522 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

/std:c++latest is provided as a preview of language features from the latest C++
working draft, and we're eager to hear about bugs and suggestions for improvements.
However, note that these features are provided as-is without support, and subject
to changes or removal as the working draft evolves. See
https://go.microsoft.com/fwlink/?linkid=2045807 for details.

repro.cpp
Microsoft (R) Incremental Linker Version 14.23.28019.1
Microsoft (R) Incremental Linker Version 14.36.32522.0
Copyright (C) Microsoft Corporation. All rights reserved.

/out:repro.exe
Expand All @@ -41,25 +47,24 @@ C:\Temp>.\repro.exe
test failure
```

**Expected behavior**
# Expected behavior
A clear and concise description of what you expected to happen.
Alternatively, include `static_assert` or `assert` lines in your
test case above whose failure clearly indicates the problem.

**STL version**
# STL version
* Option 1: Visual Studio version
* Displayed in Help > About Microsoft Visual Studio
* Example:
+ Help > About Microsoft Visual Studio > Copy Info, we need only the first two lines
+ Example:
```
Microsoft Visual Studio Community 2019 Preview
Version 16.5.0 Preview 5.0
Microsoft Visual Studio Community 2022
Version 17.6.0 Preview 3.0
```

* Option 2: git commit hash
* Example:
+ Example:
```
https://github.com/microsoft/STL/commit/2195148
```

**Additional context**
# Additional context
Add any other context about the problem here.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

cmake_minimum_required(VERSION 3.25.2)
cmake_minimum_required(VERSION 3.26.0)

set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
project(msvc_standard_libraries LANGUAGES CXX)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ 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.6 Preview 1 or later.
1. Install Visual Studio 2022 17.6 Preview 3 or later.
* Select "Windows 11 SDK (10.0.22000.0)" in the VS Installer.
* We recommend selecting "C++ CMake tools for Windows" in the VS Installer.
This will ensure that you're using supported versions of CMake and Ninja.
* Otherwise, install [CMake][] 3.25.2 or later, and [Ninja][] 1.11.0 or later.
* Otherwise, install [CMake][] 3.26.0 or later, and [Ninja][] 1.11.0 or later.
* We recommend selecting "Python 3 64-bit" in the VS Installer.
* Otherwise, make sure [Python][] 3.9 or later is available to CMake.
2. Open Visual Studio, and choose the "Clone or check out code" option. Enter the URL of this repository,
Expand All @@ -157,11 +157,11 @@ 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.6 Preview 1 or later.
1. Install Visual Studio 2022 17.6 Preview 3 or later.
* Select "Windows 11 SDK (10.0.22000.0)" in the VS Installer.
* We recommend selecting "C++ CMake tools for Windows" in the VS Installer.
This will ensure that you're using supported versions of CMake and Ninja.
* Otherwise, install [CMake][] 3.25.2 or later, and [Ninja][] 1.11.0 or later.
* Otherwise, install [CMake][] 3.26.0 or later, and [Ninja][] 1.11.0 or later.
* We recommend selecting "Python 3 64-bit" in the VS Installer.
* Otherwise, make sure [Python][] 3.9 or later is available to CMake.
2. Open a command prompt.
Expand Down
22 changes: 18 additions & 4 deletions azure-devops/create-1es-hosted-pool.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ See https://github.com/microsoft/STL/wiki/Checklist-for-Toolset-Updates for more

$ErrorActionPreference = 'Stop'

# https://aka.ms/azps-changewarnings
$Env:SuppressAzurePowerShellBreakingChangeWarnings = 'true'

$CurrentDate = Get-Date

$Location = 'eastus'
Expand All @@ -24,7 +21,7 @@ $ImageOffer = 'WindowsServer'
$ImageSku = '2022-datacenter-g2'

$ProgressActivity = 'Preparing STL CI pool'
$TotalProgress = 25
$TotalProgress = 26
$CurrentProgress = 1

<#
Expand Down Expand Up @@ -120,6 +117,13 @@ function Wait-Shutdown {
}
}

####################################################################################################
Display-ProgressBar -Status 'Silencing breaking change warnings'

# https://aka.ms/azps-changewarnings
Update-AzConfig `
-DisplayBreakingChangeWarning $false `
-Scope 'Process' | Out-Null

####################################################################################################
Display-ProgressBar -Status 'Setting the subscription context'
Expand Down Expand Up @@ -207,6 +211,15 @@ $VM = Set-AzVMBootDiagnostic `
-VM $VM `
-Disable

$VM = Set-AzVMSecurityProfile `
-VM $VM `
-SecurityType 'TrustedLaunch'

$VM = Set-AzVMUefi `
-VM $VM `
-EnableVtpm $true `
-EnableSecureBoot $true

New-AzVm `
-ResourceGroupName $ResourceGroupName `
-Location $Location `
Expand Down Expand Up @@ -305,6 +318,7 @@ New-AzGalleryImageDefinition `
-Publisher $ImagePublisher `
-Offer $ImageOffer `
-Sku $ImageSku `
-Feature @(@{ Name = 'SecurityType'; Value = 'TrustedLaunch'; }) `
-HyperVGeneration 'V2' | Out-Null

####################################################################################################
Expand Down
29 changes: 3 additions & 26 deletions azure-devops/provision-image.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ if ([string]::IsNullOrEmpty($AdminUserPassword)) {
$PsExecPath = Join-Path $ExtractedPsToolsPath 'PsExec64.exe'

# https://github.com/PowerShell/PowerShell/releases/latest
$PowerShellZipUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.3.2/PowerShell-7.3.2-win-x64.zip'
$PowerShellZipUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.3.3/PowerShell-7.3.3-win-x64.zip'
Write-Host "Downloading: $PowerShellZipUrl"
$ExtractedPowerShellPath = DownloadAndExtractZip -Url $PowerShellZipUrl
$PwshPath = Join-Path $ExtractedPowerShellPath 'pwsh.exe'
Expand Down Expand Up @@ -128,20 +128,15 @@ $Workloads = @(
'Microsoft.VisualStudio.Component.VC.CMake.Project',
'Microsoft.VisualStudio.Component.VC.CoreIde',
'Microsoft.VisualStudio.Component.VC.Llvm.Clang',
'Microsoft.VisualStudio.Component.VC.Runtimes.ARM.Spectre',
'Microsoft.VisualStudio.Component.VC.Runtimes.ARM64.Spectre',
'Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre',
'Microsoft.VisualStudio.Component.VC.Tools.ARM',
'Microsoft.VisualStudio.Component.VC.Tools.ARM64',
'Microsoft.VisualStudio.Component.VC.Tools.ARM64EC',
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
'Microsoft.VisualStudio.Component.Windows11SDK.22000'
)

$ReleaseInPath = 'Preview'
$Sku = 'Enterprise'
$VisualStudioBootstrapperUrl = 'https://aka.ms/vs/17/pre/vs_enterprise.exe'
$PythonUrl = 'https://www.python.org/ftp/python/3.11.2/python-3.11.2-amd64.exe'
$PythonUrl = 'https://www.python.org/ftp/python/3.11.3/python-3.11.3-amd64.exe'

$CudaUrl = 'https://developer.download.nvidia.com/compute/cuda/11.6.0/local_installers/cuda_11.6.0_511.23_windows.exe'

Expand Down Expand Up @@ -187,19 +182,11 @@ The set of VS workloads to install.

.PARAMETER BootstrapperUrl
The URL of the Visual Studio installer, i.e. one of vs_*.exe.

.PARAMETER InstallPath
The path to install Visual Studio at.

.PARAMETER Nickname
The nickname to give the installation.
#>
Function InstallVisualStudio {
Param(
[String[]]$Workloads,
[String]$BootstrapperUrl,
[String]$InstallPath = $null,
[String]$Nickname = $null
[String]$BootstrapperUrl
)

try {
Expand All @@ -213,16 +200,6 @@ Function InstallVisualStudio {
$args += $workload
}

if (-not ([String]::IsNullOrWhiteSpace($InstallPath))) {
$args += '--installpath'
$args += $InstallPath
}

if (-not ([String]::IsNullOrWhiteSpace($Nickname))) {
$args += '--nickname'
$args += $Nickname
}

$proc = Start-Process -FilePath cmd.exe -ArgumentList $args -Wait -PassThru
PrintMsiExitCodeMessage $proc.ExitCode
}
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ variables:
benchmarkBuildOutputLocation: 'D:\benchmark'

pool:
name: 'StlBuild-2023-02-21T1058-Pool'
name: 'StlBuild-2023-04-11T1428-Pool'
demands: EnableSpotVM -equals true

pr:
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

cmake_minimum_required(VERSION 3.25.2)
cmake_minimum_required(VERSION 3.26.0)
project(msvc_standard_libraries_benchmarks LANGUAGES CXX)

if(DEFINED STL_BINARY_DIR)
Expand Down
2 changes: 1 addition & 1 deletion stl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "Embedded")

add_compile_options(/WX /Gy
"$<$<COMPILE_LANGUAGE:CXX>:/diagnostics:caret;/W4;/w14265;/w15038;/fastfail;/guard:cf;/Zp8;/std:c++latest;/permissive-;/Zc:threadSafeInit-;/Zl>"
"$<$<COMPILE_LANGUAGE:ASM_MASM>:/W3;/nologo>"
"$<$<COMPILE_LANGUAGE:ASM_MASM>:/W3;/nologo;/quiet>"
)

include_directories(BEFORE
Expand Down
13 changes: 0 additions & 13 deletions stl/inc/array
Original file line number Diff line number Diff line change
Expand Up @@ -769,11 +769,7 @@ _CONSTEXPR20 void swap(array<_Ty, _Size>& _Left, array<_Ty, _Size>& _Right) noex

_EXPORT_STD template <class _Ty, size_t _Size>
_NODISCARD _CONSTEXPR20 bool operator==(const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) {
#ifdef __EDG__ // TRANSITION, VSO-1161663
return _STD equal(_Left.begin(), _Left.end(), _Right.begin());
#else // ^^^ workaround / no workaround vvv
return _STD equal(_Left._Unchecked_begin(), _Left._Unchecked_end(), _Right._Unchecked_begin());
#endif // ^^^ no workaround ^^^
}

#if !_HAS_CXX20
Expand All @@ -787,23 +783,14 @@ _NODISCARD bool operator!=(const array<_Ty, _Size>& _Left, const array<_Ty, _Siz
_EXPORT_STD template <class _Ty, size_t _Size>
_NODISCARD constexpr _Synth_three_way_result<_Ty> operator<=>(
const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) {
#ifdef __EDG__ // TRANSITION, VSO-1161663
return _STD lexicographical_compare_three_way(
_Left.begin(), _Left.end(), _Right.begin(), _Right.end(), _Synth_three_way{});
#else // ^^^ workaround / no workaround vvv
return _STD lexicographical_compare_three_way(_Left._Unchecked_begin(), _Left._Unchecked_end(),
_Right._Unchecked_begin(), _Right._Unchecked_end(), _Synth_three_way{});
#endif // ^^^ no workaround ^^^
}
#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv
template <class _Ty, size_t _Size>
_NODISCARD _CONSTEXPR20 bool operator<(const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) {
#ifdef __EDG__ // TRANSITION, VSO-1161663
return _STD lexicographical_compare(_Left.begin(), _Left.end(), _Right.begin(), _Right.end());
#else // ^^^ workaround / no workaround vvv
return _STD lexicographical_compare(
_Left._Unchecked_begin(), _Left._Unchecked_end(), _Right._Unchecked_begin(), _Right._Unchecked_end());
#endif // ^^^ no workaround ^^^
}

template <class _Ty, size_t _Size>
Expand Down
20 changes: 11 additions & 9 deletions stl/inc/atomic
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ extern "C" _NODISCARD char __stdcall __std_atomic_has_cmpxchg16b() noexcept;
// Controls whether ARM64 ldar/ldapr/stlr should be used
#ifndef _STD_ATOMIC_USE_ARM64_LDAR_STLR
#if defined(_M_ARM64) || defined(_M_ARM64EC)
#if defined(_HAS_ARM64_LOAD_ACQUIRE) && _HAS_ARM64_LOAD_ACQUIRE == 1 // TRANSITION, VS 2022 17.7 Preview 1
#define _STD_ATOMIC_USE_ARM64_LDAR_STLR 1
#else // ^^^ updated intrin0.inl.h is available / workaround vvv
#ifdef __clang__ // TRANSITION, LLVM-62103
#define _STD_ATOMIC_USE_ARM64_LDAR_STLR 0
#endif // ^^^ workaround ^^^
#else // ^^^ Clang doesn't support new intrinsics / __load_acquire/__stlr intrinsics are available vvv
#define _STD_ATOMIC_USE_ARM64_LDAR_STLR 1
#endif // ^^^ __load_acquire/__stlr intrinsics are available ^^^
#else // ^^^ ARM64/ARM64EC / Other architectures vvv
#define _STD_ATOMIC_USE_ARM64_LDAR_STLR 0
#endif // defined(_M_ARM64) || defined(_M_ARM64EC)
Expand Down Expand Up @@ -141,7 +141,7 @@ extern "C" inline void _Check_memory_order(const unsigned int _Order) noexcept {
#if _STD_ATOMIC_USE_ARM64_LDAR_STLR == 1

#define __LOAD_ACQUIRE_ARM64(_Width, _Ptr) \
__load_acquire##_Width(reinterpret_cast<const volatile unsigned __int##_Width*>(_Ptr))
static_cast<__int##_Width>(__load_acquire##_Width(reinterpret_cast<const volatile unsigned __int##_Width*>(_Ptr)))

#define _ATOMIC_LOAD_ARM64(_Result, _Width, _Ptr, _Order_var) \
switch (_Order_var) { \
Expand Down Expand Up @@ -184,7 +184,8 @@ extern "C" inline void _Check_memory_order(const unsigned int _Order) noexcept {

#define __STORE_RELEASE(_Width, _Ptr, _Desired) \
_Compiler_barrier(); \
__stlr##_Width(reinterpret_cast<volatile unsigned __int##_Width*>(_Ptr), (_Desired));
__stlr##_Width( \
reinterpret_cast<volatile unsigned __int##_Width*>(_Ptr), static_cast<unsigned __int##_Width>(_Desired));

#else // ^^^ _STD_ATOMIC_USE_ARM64_LDAR_STLR == 1 ^^^ / vvv _STD_ATOMIC_USE_ARM64_LDAR_STLR == 0 vvv

Expand Down Expand Up @@ -214,9 +215,10 @@ extern "C" inline void _Check_memory_order(const unsigned int _Order) noexcept {
_Memory_barrier();

#if _STD_ATOMIC_USE_ARM64_LDAR_STLR == 1
#define _ATOMIC_STORE_SEQ_CST_ARM64(_Width, _Ptr, _Desired) \
_Compiler_barrier(); \
__stlr##_Width(reinterpret_cast<volatile unsigned __int##_Width*>(_Ptr), (_Desired)); \
#define _ATOMIC_STORE_SEQ_CST_ARM64(_Width, _Ptr, _Desired) \
_Compiler_barrier(); \
__stlr##_Width( \
reinterpret_cast<volatile unsigned __int##_Width*>(_Ptr), static_cast<unsigned __int##_Width>(_Desired)); \
_Memory_barrier();
#else
#define _ATOMIC_STORE_SEQ_CST_ARM64 _ATOMIC_STORE_SEQ_CST_ARM
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/chrono
Original file line number Diff line number Diff line change
Expand Up @@ -4998,7 +4998,7 @@ namespace chrono {
_Write_seconds(_Os, _Hh_mm_ss_part_underflow_to_zero(_Val));
}

_EXPORT_STD /* TRANSITION, VSO-1582358 */ template <class _Ty>
template <class _Ty>
_NODISCARD tm _Fill_tm(const _Ty& _Val) {
unsigned int _Day = 0;
unsigned int _Month = 0;
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/execution
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ struct _Parallel_choose_max_chunk {
}
};

_EXPORT_STD /* TRANSITION, VSO-1592329 */ template <class _Ty>
template <class _Ty>
struct alignas(_Ty) alignas(size_t) alignas(_Atomic_counter_t) _Circular_buffer { // work stealing deque extent type
static_assert(is_trivial_v<_Ty>, "Work stealing deques work only with trivial operations");

Expand Down
Loading