Skip to content

Commit

Permalink
Merge branch 'main' into fix155 and fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
fsb4000 committed May 7, 2022
2 parents 5706ab2 + e86c643 commit 54785fb
Show file tree
Hide file tree
Showing 319 changed files with 15,387 additions and 7,010 deletions.
9 changes: 3 additions & 6 deletions .github/ISSUE_TEMPLATE/cxx23-feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ and the publication of the papers. When the papers are available,
the https://wg21.link redirector will start working.

Feature-test macro:
`#define MACRO_NAME MACRO_VALUE`

Note: We're still working on finishing C++20. Until we're done
with that (and the compiler implements distinct `/std:c++20` and
`/std:c++latest` options), we won't be able to review PRs for
C++23 features.
```cpp
#define MACRO_NAME MACRO_VALUE
```
16 changes: 8 additions & 8 deletions .github/workflows/update-status-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: gh-pages
- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ">=17.3.1"
node-version: ">=17.8.0"
- name: Install Packages
run: |
npm ci
- name: Compile gather_stats.ts
- name: Compile And Run gather_stats.ts
run: |
npx tsc
- name: Run gather_stats.js
SECRET_GITHUB_PERSONAL_ACCESS_TOKEN="${{ github.token }}" npm run gather
- name: Compile And Bundle status_chart.ts
run: |
SECRET_GITHUB_PERSONAL_ACCESS_TOKEN="${{ github.token }}" node built/gather_stats.js
npm run make
- name: Commit Changes
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add daily_table.js monthly_table.js
git add src/daily_table.ts src/monthly_table.ts built/status_chart.mjs
git diff-index --quiet HEAD || git commit -m "Automated update."
git push origin gh-pages
27 changes: 24 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

cmake_minimum_required(VERSION 3.21)
cmake_minimum_required(VERSION 3.22)
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
project(msvc_standard_libraries LANGUAGES CXX)

# add the tools subdirectory _before_ we change all the flags
add_subdirectory(tools EXCLUDE_FROM_ALL)
# these allow the targets to show up in the top-level
# (as opposed to under the tools subdirectory)
if(TARGET run-format)
add_custom_target(format)
add_dependencies(format run-format)
endif()
if(TARGET run-validate)
add_custom_target(validate)
add_dependencies(validate run-validate)
endif()

option(BUILD_TESTING "Enable testing" ON)
set(VCLIBS_SUFFIX "_oss" CACHE STRING "suffix for built DLL names to avoid conflicts with distributed DLLs")

Expand Down Expand Up @@ -56,10 +69,18 @@ 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 /ZH:SHA_256)
add_compile_options(/diagnostics:caret /W4 /WX /w14265 /w15038 /d1FastFail /guard:cf /Z7 /Gy /Zp8 /std:c++latest /permissive- /Zc:threadSafeInit- /Zl)

set(VCLIBS_DEBUG_OPTIONS "/Od")
set(VCLIBS_RELEASE_OPTIONS "/O2;/Os") # TRANSITION: Potentially remove /Os

# TRANSITION: Potentially remove `/Os` if it results in speed improvements.
# This requires benchmarking!
# Note that in MSVC version 19.32.31328,
# `/Os` results in a binary size difference of 102K
# in the release DLL (a gain of 18.4%).
# So, make certain that that tradeoff is considered when or if `/Os` is removed.
# See GH-2108 for more info.
set(VCLIBS_RELEASE_OPTIONS /O2 /Os)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/out/lib/${VCLIBS_I386_OR_AMD64}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/out/lib/${VCLIBS_I386_OR_AMD64}")
Expand Down
49 changes: 49 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,52 @@ In addition, certain files include the notices provided below.
// of this Software are embedded into a machine-executable object form of such
// source code, you may redistribute such embedded portions in such object form
// without including the above copyright and permission notices.

----------------------

// UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
//
// See Terms of Use <https://www.unicode.org/copyright.html>
// for definitions of Unicode Inc.'s Data Files and Software.
//
// NOTICE TO USER: Carefully read the following legal agreement.
// BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
// DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
// YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
// TERMS AND CONDITIONS OF THIS AGREEMENT.
// IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
// THE DATA FILES OR SOFTWARE.
//
// COPYRIGHT AND PERMISSION NOTICE
//
// Copyright (c) 1991-2022 Unicode, Inc. All rights reserved.
// Distributed under the Terms of Use in https://www.unicode.org/copyright.html.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of the Unicode data files and any associated documentation
// (the "Data Files") or Unicode software and any associated documentation
// (the "Software") to deal in the Data Files or Software
// without restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, and/or sell copies of
// the Data Files or Software, and to permit persons to whom the Data Files
// or Software are furnished to do so, provided that either
// (a) this copyright and permission notice appear with all copies
// of the Data Files or Software, or
// (b) this copyright and permission notice appear in associated
// Documentation.
//
// THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
// ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT OF THIRD PARTY RIGHTS.
// IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
// NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
// DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
// TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THE DATA FILES OR SOFTWARE.
//
// Except as contained in this notice, the name of a copyright holder
// shall not be used in advertising or otherwise to promote the sale,
// use or other dealings in these Data Files or Software without prior
// written authorization of the copyright holder.
50 changes: 41 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ issue. The [bug tag][] and [enhancement tag][] are being populated.

# Goals

We're implementing the latest C++ Working Draft, currently [N4901][], which will eventually become the next C++
We're implementing the latest C++ Working Draft, currently [N4910][], 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
Expand Down Expand Up @@ -121,7 +121,7 @@ reproducing the bug.

* You should be reasonably confident that you're looking at an actual implementation bug, instead of undefined behavior
or surprising-yet-Standard behavior. Comparing against other implementations can help (but remember that implementations
can differ while conforming to the Standard); try Godbolt's [Compiler Explorer][] and [Wandbox][]. If you still aren't
can differ while conforming to the Standard); try Godbolt's [Compiler Explorer][]. If you still aren't
sure, ask the nearest C++ expert.

* You should prepare a self-contained command-line test case, ideally as small as possible. We need a source file, a
Expand All @@ -140,10 +140,10 @@ 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.1 Preview 4 or later.
1. Install Visual Studio 2022 17.2 Preview 3 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.21 or later, and [Ninja][] 1.10.2 or later.
* Otherwise, install [CMake][] 3.22 or later, and [Ninja][] 1.10.2 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 @@ -155,10 +155,10 @@ 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.1 Preview 4 or later.
1. Install Visual Studio 2022 17.2 Preview 3 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.21 or later, and [Ninja][] 1.10.2 or later.
* Otherwise, install [CMake][] 3.22 or later, and [Ninja][] 1.10.2 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 Expand Up @@ -414,7 +414,40 @@ The STL is built atop other compiler support libraries that ship with Windows an
VCRuntime, and VCStartup. The following diagram describes the dependencies between those components and their ship
vehicles.

![MSVC Libraries Block Diagram](docs/msvc_libraries.plantuml.svg)
```mermaid
flowchart TB
classDef default text-align:left
subgraph VisualStudioSubgraph[Visual Studio]
direction TB
STLNode("<b>STL</b>
This repo; provides C++ Standard Library headers, separately
compiled implementations of most of the iostreams functionality,
and a few runtime support components like std::exception_ptr.")
subgraph VCRuntimeSubgraph[VCRuntime]
direction TB
VCStartupNode("<b>VCStartup</b>
Provides compiler support mechanisms that
live in each binary; such as machinery to
call constructors and destructors for global
variables, the entry point, and the /GS cookie.
Merged into static and import libraries of VCRuntime.")
VCRuntimeNode("<b>VCRuntime</b>
Provides compiler support mechanisms that can be
shared between binaries; code that the compiler calls
on your behalf, such as the C++ exception handling
runtime, string.h intrinsics, math intrinsics, and
declarations for CPU-vendor-specific intrinsics.")
end
end
subgraph WindowsSDKSubgraph[Windows SDK]
UniversalCRTNode("<b>Universal CRT</b>
Windows component that provides C library support, such as printf,
C locales, and some POSIX-like shims for the Windows API, like _stat.")
end
STLNode ==> VCRuntimeSubgraph & UniversalCRTNode
VCStartupNode ==> VCRuntimeNode ==> UniversalCRTNode
```

# Contributing

Expand Down Expand Up @@ -451,14 +484,13 @@ 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/
[N4901]: https://wg21.link/n4901
[N4910]: https://wg21.link/n4910
[NOTICE.txt]: NOTICE.txt
[Ninja]: https://ninja-build.org
[Pipelines]: https://dev.azure.com/vclibs/STL/_build/latest?definitionId=4&branchName=main
[Python]: https://www.python.org/downloads/windows/
[Roadmap]: https://github.com/microsoft/STL/wiki/Roadmap
[Status Chart]: https://microsoft.github.io/STL/
[Wandbox]: https://wandbox.org
[bug tag]: https://github.com/microsoft/STL/issues?q=is%3Aopen+is%3Aissue+label%3Abug
[cxx20 tag]: https://github.com/microsoft/STL/issues?q=is%3Aopen+is%3Aissue+label%3Acxx20
[enhancement tag]: https://github.com/microsoft/STL/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement
Expand Down
5 changes: 1 addition & 4 deletions azure-devops/checkout-sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,10 @@ steps:
git remote get-url llvm
if errorlevel 1 (
git remote add llvm https://github.com/llvm/llvm-project.git
git config --local extensions.partialClone llvm
)
git fetch --filter=tree:0 --depth=1 llvm $(${{ parameters.llvmSHAVar }})
git sparse-checkout init --cone
git sparse-checkout set libcxx/test libcxx/utils/libcxx llvm/utils/lit
git sparse-checkout set --cone --sparse-index libcxx/test libcxx/utils/libcxx llvm/utils/lit
git reset --quiet --hard FETCH_HEAD
git clean --quiet -x -d -f
displayName: "Checkout LLVM source"
Expand All @@ -63,7 +61,6 @@ steps:
git remote get-url boostorg
if errorlevel 1 (
git remote add boostorg https://github.com/boostorg/math.git
git config --local extensions.partialClone boostorg
)
git fetch --filter=tree:0 --depth=1 boostorg $(${{ parameters.boostMathSHAVar }})
Expand Down
2 changes: 1 addition & 1 deletion azure-devops/cmake-configure-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ steps:
inputs:
targetType: inline
script: |
$testParallelism = $env:NUMBER_OF_PROCESSORS - 2
$testParallelism = $env:NUMBER_OF_PROCESSORS
Write-Host "##vso[task.setvariable variable=testParallelism;]$testParallelism"
- script: |
if exist "$(${{ parameters.buildOutputLocationVar }})" (
Expand Down
33 changes: 33 additions & 0 deletions azure-devops/create-prdiff.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

[CmdletBinding(PositionalBinding = $False)]
Param(
[Parameter()]
[String]$DiffFile
)

if ([string]::IsNullOrEmpty($DiffFile)) {
$DiffFile = [System.IO.Path]::GetTempFileName()
}

Start-Process -FilePath 'git' -ArgumentList 'diff' `
-NoNewWindow -Wait `
-RedirectStandardOutput $DiffFile
if (0 -ne (Get-Item -LiteralPath $DiffFile).Length) {
$message = @(
'##vso[task.logissue type=error]The formatting of the files in the repo was not what we expected.'
'Please access the diff from format.diff in the build artifacts'
'(you can download it by clicking the three dots at the right)'
'and apply it with `git apply`.'
'Alternatively, you can run the `format` CMake target:'
' cmake --build <builddir> --target format'
''
'##[group]Expected formatting - click to expand diff'
Get-Content -LiteralPath $DiffFile -Raw
'##[endgroup]'
"##vso[artifact.upload artifactname=format.diff]$DiffFile"
'##vso[task.complete result=Failed]DONE'
)
Write-Host ($message -join "`n")
}
1 change: 0 additions & 1 deletion azure-devops/cross-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,3 @@ jobs:
targetPlatform: ${{ parameters.targetPlatform }}
targetArch: ${{ parameters.vsDevCmdArch }}
displayName: 'Build Tests'
publishArtifact: false # disabled due to GH-1653
14 changes: 0 additions & 14 deletions azure-devops/enforce-clang-format.cmd

This file was deleted.

7 changes: 3 additions & 4 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.2.1/PowerShell-7.2.1-win-x64.zip'
$PowerShellZipUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.2.2/PowerShell-7.2.2-win-x64.zip'
Write-Host "Downloading: $PowerShellZipUrl"
$ExtractedPowerShellPath = DownloadAndExtractZip -Url $PowerShellZipUrl
$PwshPath = Join-Path $ExtractedPowerShellPath 'pwsh.exe'
Expand Down Expand Up @@ -135,14 +135,13 @@ $Workloads = @(
'Microsoft.VisualStudio.Component.VC.Tools.ARM64',
'Microsoft.VisualStudio.Component.VC.Tools.ARM64EC',
'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'
'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.10.2/python-3.10.2-amd64.exe'
$PythonUrl = 'https://www.python.org/ftp/python/3.10.4/python-3.10.4-amd64.exe'

$CudaUrl = `
'https://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.243_426.00_win10.exe'
Expand Down
15 changes: 4 additions & 11 deletions azure-devops/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ parameters:
- name: displayName
type: string
default: 'Run Tests'
- name: publishArtifact
type: boolean
default: false
steps:
- task: CmdLine@2
displayName: ${{ parameters.displayName }}
Expand All @@ -38,11 +35,7 @@ steps:
testResultsFormat: JUnit
testResultsFiles: '**/test-results.xml'
testRunTitle: 'test-${{ parameters.targetPlatform }}-$(System.JobPositionInPhase)'
- publish: $(${{ parameters.buildOutPutLocationVar }})/out
artifact: '${{ parameters.targetPlatform }}-$(System.JobPositionInPhase)-libs-$(System.JobId)'
condition: ${{ parameters.publishArtifact }}
displayName: 'Publish Libs and Headers Artifact'
- publish: $(${{ parameters.buildOutPutLocationVar }})/tests
artifact: '${{ parameters.targetPlatform }}-$(System.JobPositionInPhase)-tests-$(System.JobId)'
condition: ${{ parameters.publishArtifact }}
displayName: 'Publish Tests Artifact'
- publish: $(${{ parameters.buildOutputLocationVar }})/test-results.xml
artifact: '${{ parameters.targetPlatform }}-$(System.JobPositionInPhase)-xml-$(System.JobId)'
condition: failed()
displayName: 'Publish XML Artifact'
4 changes: 0 additions & 4 deletions azure-devops/validate-files.cmd

This file was deleted.

Loading

0 comments on commit 54785fb

Please sign in to comment.