Skip to content

Commit

Permalink
Toolset update: VS 2019 16.10 Preview 2 (#1884)
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanTLavavej committed May 1, 2021
1 parent 4946c74 commit 65eb507
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 44 deletions.
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/
2 changes: 1 addition & 1 deletion 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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
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 2019 16.10 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 2019 16.10 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 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.4 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
15 changes: 14 additions & 1 deletion azure-devops/create-vmss.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $ImageOffer = 'Windows-10'
$ImageSku = '20h2-ent-g2'

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

<#
Expand Down Expand Up @@ -400,6 +400,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
4 changes: 2 additions & 2 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 @@ -139,7 +139,7 @@ $Workloads = @(
$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'
$PythonUrl = 'https://www.python.org/ftp/python/3.9.4/python-3.9.4-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-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ variables:
buildOutputLocation: 'D:\build'
vcpkgLocation: '$(Build.SourcesDirectory)/vcpkg'

pool: 'StlBuild-2021-03-09-win10'
pool: 'StlBuild-2021-04-23'

stages:
- stage: Code_Format
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,13 @@ def getBuildSteps(self, test, litConfig, shared):
compileTestCppWithEdg = True
test.compileFlags.remove('/BE')

exportHeaderOptions = ['/exportHeader', '/Fo', '/MP']
exportHeaderOptions = ['/exportHeader', '/headerName:angle', '/Fo', '/MP']
headerUnitOptions = []
for header in stlHeaders:
headerAbsolutePath = os.path.join(litConfig.cxx_headers, header)
exportHeaderOptions.append(header)

exportHeaderOptions.append(headerAbsolutePath)

headerUnitOptions.append('/headerUnit')
headerUnitOptions.append('{0}={1}.ifc'.format(headerAbsolutePath, header))
headerUnitOptions.append('/headerUnit:angle')
headerUnitOptions.append('{0}={0}.ifc'.format(header))

if not compileTestCppWithEdg:
headerUnitOptions.append(os.path.join(outputDir, header + '.obj'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
sub CustomBuildHook()
{
my $cwd = Run::GetCWDName();
my $stl_include_dir = $ENV{STL_INCLUDE_DIR};

my @stl_headers = (
"algorithm",
Expand Down Expand Up @@ -88,14 +87,14 @@ ()
"version",
);

my $export_header_options = "/exportHeader /Fo /MP";
my $export_header_options = "/exportHeader /headerName:angle /Fo /MP";
my $header_unit_options = "";

foreach (@stl_headers) {
$export_header_options .= " $stl_include_dir/$_";
$export_header_options .= " $_";

$header_unit_options .= " /headerUnit";
$header_unit_options .= " $stl_include_dir/$_=$_.ifc";
$header_unit_options .= " /headerUnit:angle";
$header_unit_options .= " $_=$_.ifc";
$header_unit_options .= " $_.obj";
}

Expand Down
54 changes: 33 additions & 21 deletions tests/std/tests/P1614R2_spaceship/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ template <>
inline constexpr bool has_synth_ordered<SynthOrdered> = true;

template <class Container>
void ordered_containers_test(const Container& smaller, const Container& smaller_equal, const Container& larger) {
constexpr void ordered_containers_test(
const Container& smaller, const Container& smaller_equal, const Container& larger) {
using Elem = typename Container::value_type;

if constexpr (has_synth_ordered<Elem>) {
Expand All @@ -197,7 +198,7 @@ void unordered_containers_test(
}

template <class Iter, class ConstIter>
void ordered_iterator_test(const Iter& smaller, const Iter& smaller_equal, const Iter& larger,
constexpr void ordered_iterator_test(const Iter& smaller, const Iter& smaller_equal, const Iter& larger,
const ConstIter& const_smaller, const ConstIter& const_smaller_equal, const ConstIter& const_larger) {
spaceship_test<std::strong_ordering>(smaller, smaller_equal, larger);
spaceship_test<std::strong_ordering>(const_smaller, const_smaller_equal, const_larger);
Expand Down Expand Up @@ -356,6 +357,31 @@ bool operator==(const basic_compare_allocator<T, Ignored>&, const basic_compare_
template <bool Equal>
using compare_allocator = basic_compare_allocator<int, Equal>;

_CONSTEXPR20_CONTAINER bool test_vector() {
{ // vector
std::vector<int> a1(3, 100);
std::vector<int> a2(3, 100);
std::vector<int> b1(2, 200);
ordered_containers_test(a1, a2, b1);
ordered_iterator_test(a1.begin(), a1.begin(), a1.end(), a1.cbegin(), a1.cbegin(), a1.cend());
}
{ // vector SynthOrdered
std::vector<SynthOrdered> a = {10, 20, 30};
std::vector<SynthOrdered> b = {10, 20, 40};
ordered_containers_test(a, a, b);
ordered_iterator_test(a.begin(), a.begin(), a.end(), a.cbegin(), a.cbegin(), a.cend());
}
{ // vector<bool>
std::vector<bool> c1 = {false, true, false};
std::vector<bool> c2 = {false, true, false};
std::vector<bool> d1 = {true, false};
ordered_containers_test(c1, c2, d1);
ordered_iterator_test(c1.begin(), c1.begin(), c1.end(), c1.cbegin(), c1.cbegin(), c1.cend());
}

return true;
}

void ordering_test_cases() {
{ // constexpr array
constexpr std::array<int, 5> a0{{2, 8, 9, 1, 9}};
Expand Down Expand Up @@ -414,25 +440,11 @@ void ordering_test_cases() {
ordered_containers_test(a, a, b);
unordered_iterator_test(a.begin(), a.begin(), a.end(), a.cbegin(), a.cbegin(), a.cend());
}
{ // vector
std::vector<int> a1(3, 100);
std::vector<int> a2(3, 100);
std::vector<int> b1(2, 200);
ordered_containers_test(a1, a2, b1);
ordered_iterator_test(a1.begin(), a1.begin(), a1.end(), a1.cbegin(), a1.cbegin(), a1.cend());
}
{ // vector SynthOrdered
std::vector<SynthOrdered> a = {10, 20, 30};
std::vector<SynthOrdered> b = {10, 20, 40};
ordered_containers_test(a, a, b);
ordered_iterator_test(a.begin(), a.begin(), a.end(), a.cbegin(), a.cbegin(), a.cend());
}
{ // vector<bool>
std::vector<bool> c1 = {false, true, false};
std::vector<bool> c2 = {false, true, false};
std::vector<bool> d1 = {true, false};
ordered_containers_test(c1, c2, d1);
ordered_iterator_test(c1.begin(), c1.begin(), c1.end(), c1.cbegin(), c1.cbegin(), c1.cend());
{ // vector, vector SynthOrdered, vector<bool>
test_vector();
#ifdef __cpp_lib_constexpr_vector
static_assert(test_vector());
#endif // __cpp_lib_constexpr_vector
}
{ // forward_list
std::forward_list<int> a1(3, 100);
Expand Down
2 changes: 1 addition & 1 deletion tools/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.19)
cmake_minimum_required(VERSION 3.20)
project(msvc_standard_libraries_tools LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)
Expand Down

0 comments on commit 65eb507

Please sign in to comment.