Skip to content

Commit

Permalink
Merge branch 'main' into SSO_string
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco committed Jul 20, 2021
2 parents 4f4e782 + bd7adb4 commit 30720f4
Show file tree
Hide file tree
Showing 449 changed files with 5,704 additions and 3,757 deletions.
32 changes: 25 additions & 7 deletions .clang-format
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

# https://releases.llvm.org/11.0.0/tools/clang/docs/ClangFormatStyleOptions.html
# https://releases.llvm.org/12.0.0/tools/clang/docs/ClangFormatStyleOptions.html

---
# Language: Cpp
Expand All @@ -10,12 +10,12 @@ BasedOnStyle: LLVM
AccessModifierOffset: -4
# AlignAfterOpenBracket: Align
AlignAfterOpenBracket: DontAlign
# AlignConsecutiveMacros: false
AlignConsecutiveMacros: true
# AlignConsecutiveAssignments: false
AlignConsecutiveAssignments: true
# AlignConsecutiveBitFields: false
# AlignConsecutiveDeclarations: false
# AlignConsecutiveMacros: None
AlignConsecutiveMacros: Consecutive
# AlignConsecutiveAssignments: None
AlignConsecutiveAssignments: Consecutive
# AlignConsecutiveBitFields: None
# AlignConsecutiveDeclarations: None
# AlignEscapedNewlines: Right
AlignEscapedNewlines: Left
# AlignOperands: Align
Expand All @@ -38,6 +38,8 @@ AllowShortFunctionsOnASingleLine: Empty
# AlwaysBreakBeforeMultilineStrings: false
# AlwaysBreakTemplateDeclarations: MultiLine
AlwaysBreakTemplateDeclarations: Yes
# AttributeMacros:
# - __capability
# BinPackArguments: true
# BinPackParameters: true
# BraceWrapping:
Expand All @@ -61,6 +63,7 @@ AlwaysBreakTemplateDeclarations: Yes
# SplitEmptyNamespace: true
# BreakBeforeBinaryOperators: None
BreakBeforeBinaryOperators: NonAssignment
# BreakBeforeConceptDeclarations: true
# BreakBeforeBraces: Attach
# BreakBeforeInheritanceComma: false
# BreakInheritanceList: BeforeColon
Expand All @@ -81,24 +84,30 @@ ColumnLimit: 120
DeriveLineEnding: false
# DerivePointerAlignment: false
# DisableFormat: false
# EmptyLineBeforeAccessModifier: LogicalBlock
# ExperimentalAutoDetectBinPacking: false
# FixNamespaceComments: true
# ForEachMacros:
# - foreach
# - Q_FOREACH
# - BOOST_FOREACH
# StatementAttributeLikeMacros:
# - Q_EMIT
# IncludeBlocks: Preserve
IncludeBlocks: Regroup
# IncludeCategories:
# - Regex: '^"(llvm|llvm-c|clang|clang-c)/'
# Priority: 2
# SortPriority: 0
# CaseSensitive: false
# - Regex: '^(<|"(gtest|gmock|isl|json)/)'
# Priority: 3
# SortPriority: 0
# CaseSensitive: false
# - Regex: '.*'
# Priority: 1
# SortPriority: 0
# CaseSensitive: false
IncludeCategories:
- Regex: '^<yvals(_core)?\.h>$'
Priority: 1
Expand All @@ -122,6 +131,8 @@ IndentCaseBlocks: true
# IndentGotoLabels: true
# IndentPPDirectives: None
# IndentExternBlock: AfterExternBlock
# IndentRequires: false
IndentRequires: true
# IndentWidth: 2
IndentWidth: 4
# IndentWrappedFunctionNames: false
Expand Down Expand Up @@ -150,20 +161,24 @@ NamespaceIndentation: All
# PenaltyBreakTemplateDeclaration: 10
# PenaltyExcessCharacter: 1000000
# PenaltyReturnTypeOnItsOwnLine: 60
# PenaltyIndentedWhitespace: 0
# PointerAlignment: Right
PointerAlignment: Left
# ReflowComments: true
# SortIncludes: true
# SortJavaStaticImport: Before
# SortUsingDeclarations: true
# SpaceAfterCStyleCast: false
SpaceAfterCStyleCast: true
# SpaceAfterLogicalNot: false
# SpaceAfterTemplateKeyword: true
# SpaceBeforeAssignmentOperators: true
# SpaceBeforeCaseColon: false
# SpaceBeforeCpp11BracedList: false
# SpaceBeforeCtorInitializerColon: true
# SpaceBeforeInheritanceColon: true
# SpaceBeforeParens: ControlStatements
# SpaceAroundPointerQualifiers: Default
# SpaceBeforeRangeBasedForLoopColon: true
# SpaceInEmptyBlock: false
# SpaceInEmptyParentheses: false
Expand All @@ -175,6 +190,7 @@ SpaceAfterCStyleCast: true
# SpacesInParentheses: false
# SpacesInSquareBrackets: false
# SpaceBeforeSquareBrackets: false
# BitFieldColonSpacing: Both
# Standard: Latest
# StatementMacros:
# - Q_UNUSED
Expand All @@ -198,4 +214,6 @@ UseCRLF: true
# - STRINGIZE
# - PP_STRINGIZE
# - BOOST_PP_STRINGIZE
# - NS_SWIFT_NAME
# - CF_SWIFT_NAME
...
3 changes: 2 additions & 1 deletion .github/workflows/update-status-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
workflow_dispatch:
jobs:
build:
if: ${{ github.repository == 'microsoft/STL' }}
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages
Expand All @@ -17,7 +18,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ">=15.12.0"
node-version: ">=16.0.0"
- name: Run gather_stats.js
run: |
npm ci
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
__pycache__/
.vs/
.vscode/
/azure-devops/vmss-config.json
/azure-devops/vmss-protected.json
/build/
/out/
/tools/out/
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if (NOT DEFINED CMAKE_TOOLCHAIN_FILE AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/vcpkg
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake")
endif()

cmake_minimum_required(VERSION 3.19)
cmake_minimum_required(VERSION 3.20)
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
project(msvc_standard_libraries LANGUAGES CXX)

Expand Down Expand Up @@ -67,7 +67,7 @@ add_compile_definitions(
_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH WIN32_LEAN_AND_MEAN STRICT _CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS
_CRT_DECLARE_NONSTDC_NAMES=1 )

add_compile_options(/diagnostics:caret /W4 /WX /w14265 /w15038 /d1FastFail /guard:cf /Z7 /Gm- /Gy /Zp8 /std:c++latest /permissive- /Zc:threadSafeInit- /Zl)
add_compile_options(/diagnostics:caret /W4 /WX /w14265 /w15038 /d1FastFail /guard:cf /Z7 /Gm- /Gy /Zp8 /std:c++latest /permissive- /Zc:threadSafeInit- /Zl /ZH:SHA_256)

set(VCLIBS_DEBUG_OPTIONS "/Od")
set(VCLIBS_RELEASE_OPTIONS "/O2;/Os") # TRANSITION: Potentially remove /Os
Expand Down
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ issue. The [bug tag][] and [enhancement tag][] are being populated.

# Goals

We're implementing the latest C++ Working Draft, currently [N4885][], which will eventually become the next C++
We're implementing the latest C++ Working Draft, currently [N4892][], which will eventually become the next C++
International Standard. The terms Working Draft (WD) and Working Paper (WP) are interchangeable; we often
informally refer to these drafts as "the Standard" while being aware of the difference. (There are other relevant
Standards; for example, supporting `/std:c++14` and `/std:c++17` involves understanding how the C++14 and C++17
Standards differ from the Working Paper, and we often need to refer to the C Standard Library and ECMAScript regular
expression specifications.) We're currently prioritizing C++20 features before starting any work on C++23.
expression specifications.)

Our primary goals are conformance, performance, usability, and compatibility.

Expand All @@ -79,8 +79,8 @@ significantly more complicated and fragile. That is, there's a "complexity budge
debugging checks. For example, we've extensively marked the STL with `[[nodiscard]]` attributes because this helps
programmers avoid bugs.

* Compatibility: This includes binary compatibility and source compatibility. We're keeping VS 2019 binary-compatible
with VS 2017 and VS 2015, which restricts what we can change in VS 2019 updates. (We've found that significant changes
* Compatibility: This includes binary compatibility and source compatibility. We're keeping VS 2022 binary-compatible
with VS 2015/2017/2019, which restricts what we can change in VS 2022 updates. (We've found that significant changes
are possible even though other changes are impossible, which we'll be documenting in our Contribution Guidelines soon.)
While there are a few exceptions to this rule (e.g. if a feature is added to the Working Paper, we implement it, and
then the feature is significantly changed before the International Standard is finalized, we reserve the right to break
Expand Down Expand Up @@ -143,10 +143,10 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem
The STL uses boost-math headers to provide P0226R1 Mathematical Special Functions. We recommend using [vcpkg][] to
acquire this dependency.

1. Install Visual Studio 2019 16.10 Preview 1 or later.
1. Install Visual Studio 2022 17.0 Preview 2 or later.
* 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.19 or later, and [Ninja][] 1.10.2 or later.
* Otherwise, install [CMake][] 3.20 or later, and [Ninja][] 1.10.2 or later.
2. Open Visual Studio, and choose the "Clone or check out code" option. Enter the URL of this repository,
`https://github.com/microsoft/STL`.
3. Open a terminal in the IDE with `` Ctrl + ` `` (by default) or press on "View" in the top bar, and then "Terminal".
Expand All @@ -158,10 +158,10 @@ acquire this dependency.

# How To Build With A Native Tools Command Prompt

1. Install Visual Studio 2019 16.10 Preview 1 or later.
1. Install Visual Studio 2022 17.0 Preview 2 or later.
* 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.19 or later, and [Ninja][] 1.10.2 or later.
* Otherwise, install [CMake][] 3.20 or later, and [Ninja][] 1.10.2 or later.
2. Open a command prompt.
3. Change directories to a location where you'd like a clone of this STL repository.
4. `git clone https://github.com/microsoft/STL`
Expand All @@ -172,14 +172,14 @@ acquire this dependency.

To build the x86 target:

1. Open an "x86 Native Tools Command Prompt for VS 2019 Preview".
1. Open an "x86 Native Tools Command Prompt for VS 2022 Preview".
2. Change directories to the previously cloned `STL` directory.
3. `cmake -G Ninja -S . -B out\build\x86`
4. `ninja -C out\build\x86`

To build the x64 target:
To build the x64 target (recommended):

1. Open an "x64 Native Tools Command Prompt for VS 2019 Preview".
1. Open an "x64 Native Tools Command Prompt for VS 2022 Preview".
2. Change directories to the previously cloned `STL` directory.
3. `cmake -G Ninja -S . -B out\build\x64`
4. `ninja -C out\build\x64`
Expand All @@ -205,7 +205,7 @@ your .exe would "win" over the versions in System32.
The compiler looks for include directories according to the `INCLUDE` environment variable, and the linker looks for
import library directories according to the `LIB` environment variable, and the Windows loader will (eventually) look
for DLL dependencies according to directories in the `PATH` environment variable. From an
"x64 Native Tools Command Prompt for VS 2019 Preview":
"x64 Native Tools Command Prompt for VS 2022 Preview":

```
C:\Users\username\Desktop>set INCLUDE=C:\Dev\STL\out\build\x64\out\inc;%INCLUDE%
Expand Down Expand Up @@ -234,7 +234,7 @@ C:\Users\username\Desktop>dumpbin /IMPORTS .\example.exe | findstr msvcp
# How To Run The Tests With A Native Tools Command Prompt

1. Follow either [How To Build With A Native Tools Command Prompt][] or [How To Build With The Visual Studio IDE][].
2. Acquire [Python][] 3.9.2 or newer and have it on the `PATH` (or run it directly using its absolute or relative path).
2. Acquire [Python][] 3.9.6 or newer and have it on the `PATH` (or run it directly using its absolute or relative path).
3. Have LLVM's `bin` directory on the `PATH` (so `clang-cl.exe` is available).
* We recommend selecting "C++ Clang tools for Windows" in the VS Installer. This will automatically add LLVM to the
`PATH` of the x86 and x64 Native Tools Command Prompts, and will ensure that you're using a supported version.
Expand Down Expand Up @@ -354,7 +354,7 @@ those features first the tests will begin passing unexpectedly for us and return
this it is necessary to add a `PASS` entry to the `expected_results.txt` of the testsuite in question.

The `UNSUPPORTED` result code means that the requirements for a test are not met and so it will not be run. Currently
all tests which use the `/clr` or `/clr:pure` options are unsupported. Also, the `/BE` option is unsupported for x64.
all tests which use the `/clr` or `/clr:pure` options are unsupported. Also, the `/BE` option is unsupported for x86.

The `SKIPPED` result code indicates that a given test was explicitly skipped by adding a `SKIPPED` entry to the
`expected_results.txt`. A test may be skipped for a number of reasons, which include, but are not limited to:
Expand Down Expand Up @@ -404,8 +404,8 @@ set PATH=C:\STL\out\build\x64\out\bin\amd64;%PATH%

### Modify The Visualizer

To modify how components are visualized in the debugger edit the file `stl\debugger\STL.natvis`. For more information on
how to modify this file check the [natvis documentation][].
To modify how components are visualized in the debugger, edit the file `stl\debugger\STL.natvis`. For more information
on how to modify this file, check the [natvis documentation][].

### Test Your Changes

Expand Down Expand Up @@ -456,7 +456,7 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
[LWG issues]: https://cplusplus.github.io/LWG/lwg-toc.html
[LWG tag]: https://github.com/microsoft/STL/issues?q=is%3Aopen+is%3Aissue+label%3ALWG
[Microsoft Open Source Code of Conduct]: https://opensource.microsoft.com/codeofconduct/
[N4885]: https://wg21.link/n4885
[N4892]: https://wg21.link/n4892
[NOTICE.txt]: NOTICE.txt
[Ninja]: https://ninja-build.org
[Pipelines]: https://dev.azure.com/vclibs/STL/_build/latest?definitionId=4&branchName=main
Expand Down
4 changes: 2 additions & 2 deletions azure-devops/cmake-configure-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ steps:
if exist "$(${{ parameters.buildOutputLocationVar }})" (
rmdir /S /Q "$(${{ parameters.buildOutputLocationVar }})"
)
call "%PROGRAMFILES(X86)%\Microsoft Visual Studio\2019\Preview\Common7\Tools\VsDevCmd.bat" ^
call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^
-host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo
cmake ${{ parameters.cmakeAdditionalFlags}} -G Ninja ^
-DCMAKE_TOOLCHAIN_FILE=$(${{ parameters.vcpkgLocationVar }})\scripts\buildsystems\vcpkg.cmake ^
Expand All @@ -44,7 +44,7 @@ steps:
timeoutInMinutes: 2
env: { TMP: $(tmpDir), TEMP: $(tmpDir) }
- script: |
call "%PROGRAMFILES(X86)%\Microsoft Visual Studio\2019\Preview\Common7\Tools\VsDevCmd.bat" ^
call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^
-host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo
cmake --build $(${{ parameters.buildOutputLocationVar }})
displayName: 'Build the STL'
Expand Down
27 changes: 25 additions & 2 deletions azure-devops/create-vmss.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ $ProtoVMName = 'PROTOTYPE'
$LiveVMPrefix = 'BUILD'
$ImagePublisher = 'MicrosoftWindowsDesktop'
$ImageOffer = 'Windows-10'
$ImageSku = '20h2-ent-g2'
$ImageSku = '21h1-ent-g2'

$ProgressActivity = 'Creating Scale Set'
$TotalProgress = 12
$TotalProgress = 14
$CurrentProgress = 1

<#
Expand Down Expand Up @@ -304,6 +304,16 @@ Write-Progress `

Restart-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName

####################################################################################################
Write-Progress `
-Activity $ProgressActivity `
-Status 'Sleeping after restart' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++)

# The VM appears to be busy immediately after restarting.
# This workaround waits for a minute before attempting to run sysprep.ps1.
Start-Sleep -Seconds 60

####################################################################################################
Write-Progress `
-Activity $ProgressActivity `
Expand Down Expand Up @@ -400,6 +410,19 @@ New-AzVmss `
-Name $VmssName `
-VirtualMachineScaleSet $Vmss

####################################################################################################
Write-Progress `
-Activity $ProgressActivity `
-Status 'Enabling VMSS diagnostic logs' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++)

az vmss diagnostics set `
--resource-group $ResourceGroupName `
--vmss-name $VmssName `
--settings "$PSScriptRoot\vmss-config.json" `
--protected-settings "$PSScriptRoot\vmss-protected.json" `
--output none

####################################################################################################
Write-Progress -Activity $ProgressActivity -Completed
Write-Host "Location: $Location"
Expand Down
2 changes: 1 addition & 1 deletion azure-devops/enforce-clang-format.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:: Copyright (c) Microsoft Corporation.
:: SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
call "%PROGRAMFILES(X86)%\Microsoft Visual Studio\2019\Preview\Common7\Tools\VsDevCmd.bat" ^
call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^
-host_arch=amd64 -arch=amd64 -no_logo
"%1" "clang-format.exe -style=file -i" ^
stl/inc ^
Expand Down
7 changes: 4 additions & 3 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.1.2/PowerShell-7.1.2-win-x64.zip'
$PowerShellZipUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.1.3/PowerShell-7.1.3-win-x64.zip'
Write-Host "Downloading: $PowerShellZipUrl"
$ExtractedPowerShellPath = DownloadAndExtractZip -Url $PowerShellZipUrl
$PwshPath = Join-Path $ExtractedPowerShellPath 'pwsh.exe'
Expand Down Expand Up @@ -133,13 +133,14 @@ $Workloads = @(
'Microsoft.VisualStudio.Component.VC.Tools.ARM',
'Microsoft.VisualStudio.Component.VC.Tools.ARM64',
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
# TRANSITION, LLVM-51128 (Clang 12 targeting ARM64 is incompatible with WinSDK 10.0.20348.0)
'Microsoft.VisualStudio.Component.Windows10SDK.19041'
)

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

# https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk
$WindowsDriverKitUrl = 'https://go.microsoft.com/fwlink/?linkid=2128854'
Expand Down
2 changes: 1 addition & 1 deletion azure-devops/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ steps:
inputs:
workingDirectory: $(${{ parameters.buildOutputLocationVar }})
script: |
call "%PROGRAMFILES(X86)%\Microsoft Visual Studio\2019\Preview\Common7\Tools\VsDevCmd.bat" ^
call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^
-host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo
ctest -V
env: { TMP: $(tmpDir), TEMP: $(tmpDir) }
Expand Down
Loading

0 comments on commit 30720f4

Please sign in to comment.