From 7b546116fe06554f8bf03c8d5ac2436877eceeee Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Fri, 18 Dec 2020 17:34:04 -0800 Subject: [PATCH 01/14] Download and extract PSTools.zip. --- azure-devops/provision-image.ps1 | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/azure-devops/provision-image.ps1 b/azure-devops/provision-image.ps1 index ba9e940c575..77b2f24aaad 100644 --- a/azure-devops/provision-image.ps1 +++ b/azure-devops/provision-image.ps1 @@ -56,9 +56,18 @@ if ([string]::IsNullOrEmpty($AdminUserPassword)) { Start-Transcript -Path $TranscriptPath } else { Write-Host 'AdminUser password supplied; switching to AdminUser.' - $PsExecPath = Get-TempFilePath -Extension 'exe' - Write-Host "Downloading psexec to: $PsExecPath" - & curl.exe -L -o $PsExecPath -s -S https://live.sysinternals.com/PsExec64.exe + + # https://docs.microsoft.com/en-us/sysinternals/downloads/psexec + $PsToolsZipUrl = 'https://download.sysinternals.com/files/PSTools.zip' + $PsToolsZipPath = Get-TempFilePath -Extension 'PSTools.zip' + Write-Host "Downloading $PsToolsZipUrl to: $PsToolsZipPath" + & curl.exe -L -o $PsToolsZipPath -s -S $PsToolsZipUrl + + $TempSubdirPath = Get-TempFilePath -Extension 'dir' + Write-Host "Extracting $PsToolsZipPath to: $TempSubdirPath" + Expand-Archive -Path $PsToolsZipPath -DestinationPath $TempSubdirPath -Force + $PsExecPath = Join-Path $TempSubdirPath 'PsExec64.exe' + $PsExecArgs = @( '-u', 'AdminUser', From ee065353ef8a733b2c14510ecbea9d3064a04df2 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Fri, 18 Dec 2020 18:47:19 -0800 Subject: [PATCH 02/14] SuppressAzurePowerShellBreakingChangeWarnings. --- azure-devops/create-vmss.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/azure-devops/create-vmss.ps1 b/azure-devops/create-vmss.ps1 index 1434ce0ac48..963fb7f874a 100644 --- a/azure-devops/create-vmss.ps1 +++ b/azure-devops/create-vmss.ps1 @@ -17,6 +17,9 @@ or are running from Azure Cloud Shell. $ErrorActionPreference = 'Stop' +# https://aka.ms/azps-changewarnings +$Env:SuppressAzurePowerShellBreakingChangeWarnings = 'true' + $Location = 'westus2' $Prefix = 'StlBuild-' + (Get-Date -Format 'yyyy-MM-dd') $VMSize = 'Standard_D32as_v4' From 220ed547160325f37f7ea76a3642cd4ab2f130ed Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Fri, 18 Dec 2020 19:33:47 -0800 Subject: [PATCH 03/14] Refactor with DownloadAndExtractZip. --- azure-devops/provision-image.ps1 | 40 +++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/azure-devops/provision-image.ps1 b/azure-devops/provision-image.ps1 index 77b2f24aaad..308af7d7f65 100644 --- a/azure-devops/provision-image.ps1 +++ b/azure-devops/provision-image.ps1 @@ -50,6 +50,36 @@ Function Get-TempFilePath { return Join-Path $tempPath $tempName } +<# +.SYNOPSIS +Downloads and extracts a ZIP file to a newly created temporary subdirectory. + +.DESCRIPTION +DownloadAndExtractZip returns a path containing the extracted contents. + +.PARAMETER Url +The URL of the ZIP file to download. +#> +Function DownloadAndExtractZip { + Param( + [String]$Url + ) + + if ([String]::IsNullOrWhiteSpace($Url)) { + throw 'Missing Url' + } + + $ZipPath = Get-TempFilePath -Extension 'zip' + Write-Host "Downloading $Url to: $ZipPath" + & curl.exe -L -o $ZipPath -s -S $Url + + $TempSubdirPath = Get-TempFilePath -Extension 'dir' + Write-Host "Extracting $ZipPath to: $TempSubdirPath" + Expand-Archive -Path $ZipPath -DestinationPath $TempSubdirPath -Force + + return $TempSubdirPath +} + $TranscriptPath = 'C:\provision-image-transcript.txt' if ([string]::IsNullOrEmpty($AdminUserPassword)) { @@ -59,14 +89,8 @@ if ([string]::IsNullOrEmpty($AdminUserPassword)) { # https://docs.microsoft.com/en-us/sysinternals/downloads/psexec $PsToolsZipUrl = 'https://download.sysinternals.com/files/PSTools.zip' - $PsToolsZipPath = Get-TempFilePath -Extension 'PSTools.zip' - Write-Host "Downloading $PsToolsZipUrl to: $PsToolsZipPath" - & curl.exe -L -o $PsToolsZipPath -s -S $PsToolsZipUrl - - $TempSubdirPath = Get-TempFilePath -Extension 'dir' - Write-Host "Extracting $PsToolsZipPath to: $TempSubdirPath" - Expand-Archive -Path $PsToolsZipPath -DestinationPath $TempSubdirPath -Force - $PsExecPath = Join-Path $TempSubdirPath 'PsExec64.exe' + $ExtractedPsToolsPath = DownloadAndExtractZip -Url $PsToolsZipUrl + $PsExecPath = Join-Path $ExtractedPsToolsPath 'PsExec64.exe' $PsExecArgs = @( '-u', From 3ef1f355661290436d13b73f65553ce883ccb4f3 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Fri, 18 Dec 2020 20:00:19 -0800 Subject: [PATCH 04/14] Use PowerShell 7.1.0 for UseMinimalHeader, cleanup extracted directories. --- azure-devops/provision-image.ps1 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/azure-devops/provision-image.ps1 b/azure-devops/provision-image.ps1 index 308af7d7f65..448e056747a 100644 --- a/azure-devops/provision-image.ps1 +++ b/azure-devops/provision-image.ps1 @@ -83,7 +83,7 @@ Function DownloadAndExtractZip { $TranscriptPath = 'C:\provision-image-transcript.txt' if ([string]::IsNullOrEmpty($AdminUserPassword)) { - Start-Transcript -Path $TranscriptPath + Start-Transcript -Path $TranscriptPath -UseMinimalHeader } else { Write-Host 'AdminUser password supplied; switching to AdminUser.' @@ -92,6 +92,11 @@ if ([string]::IsNullOrEmpty($AdminUserPassword)) { $ExtractedPsToolsPath = DownloadAndExtractZip -Url $PsToolsZipUrl $PsExecPath = Join-Path $ExtractedPsToolsPath 'PsExec64.exe' + # https://github.com/PowerShell/PowerShell/releases/latest + $PowerShellZipUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.1.0/PowerShell-7.1.0-win-x64.zip' + $ExtractedPowerShellPath = DownloadAndExtractZip -Url $PowerShellZipUrl + $PwshPath = Join-Path $ExtractedPowerShellPath 'pwsh.exe' + $PsExecArgs = @( '-u', 'AdminUser', @@ -99,7 +104,7 @@ if ([string]::IsNullOrEmpty($AdminUserPassword)) { $AdminUserPassword, '-accepteula', '-h', - 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe', + $PwshPath, '-ExecutionPolicy', 'Unrestricted', '-File', @@ -112,7 +117,8 @@ if ([string]::IsNullOrEmpty($AdminUserPassword)) { Write-Host 'Reading transcript...' Get-Content -Path $TranscriptPath Write-Host 'Cleaning up...' - Remove-Item $PsExecPath + Remove-Item -Recurse -Path $ExtractedPsToolsPath + Remove-Item -Recurse -Path $ExtractedPowerShellPath exit $proc.ExitCode } From 2dbe859c8e2acbff94561a2fbbc39a262696fbf0 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Fri, 18 Dec 2020 20:26:08 -0800 Subject: [PATCH 05/14] Redact the AdminUserPassword. --- azure-devops/provision-image.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-devops/provision-image.ps1 b/azure-devops/provision-image.ps1 index 448e056747a..38bce3a5262 100644 --- a/azure-devops/provision-image.ps1 +++ b/azure-devops/provision-image.ps1 @@ -101,7 +101,7 @@ if ([string]::IsNullOrEmpty($AdminUserPassword)) { '-u', 'AdminUser', '-p', - $AdminUserPassword, + 'AdminUserPassword_REDACTED', '-accepteula', '-h', $PwshPath, @@ -110,8 +110,8 @@ if ([string]::IsNullOrEmpty($AdminUserPassword)) { '-File', $PSCommandPath ) - Write-Host "Executing: $PsExecPath $PsExecArgs" + $PsExecArgs[3] = $AdminUserPassword $proc = Start-Process -FilePath $PsExecPath -ArgumentList $PsExecArgs -Wait -PassThru Write-Host 'Reading transcript...' From 19c4e34c082cdacfba269f44143bbc50b8e08f2a Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Fri, 18 Dec 2020 20:28:39 -0800 Subject: [PATCH 06/14] Simplify download logging. --- azure-devops/provision-image.ps1 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/azure-devops/provision-image.ps1 b/azure-devops/provision-image.ps1 index 38bce3a5262..a28c8d48f3f 100644 --- a/azure-devops/provision-image.ps1 +++ b/azure-devops/provision-image.ps1 @@ -70,11 +70,8 @@ Function DownloadAndExtractZip { } $ZipPath = Get-TempFilePath -Extension 'zip' - Write-Host "Downloading $Url to: $ZipPath" & curl.exe -L -o $ZipPath -s -S $Url - $TempSubdirPath = Get-TempFilePath -Extension 'dir' - Write-Host "Extracting $ZipPath to: $TempSubdirPath" Expand-Archive -Path $ZipPath -DestinationPath $TempSubdirPath -Force return $TempSubdirPath @@ -89,11 +86,13 @@ if ([string]::IsNullOrEmpty($AdminUserPassword)) { # https://docs.microsoft.com/en-us/sysinternals/downloads/psexec $PsToolsZipUrl = 'https://download.sysinternals.com/files/PSTools.zip' + Write-Host "Downloading: $PsToolsZipUrl" $ExtractedPsToolsPath = DownloadAndExtractZip -Url $PsToolsZipUrl $PsExecPath = Join-Path $ExtractedPsToolsPath 'PsExec64.exe' # https://github.com/PowerShell/PowerShell/releases/latest $PowerShellZipUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.1.0/PowerShell-7.1.0-win-x64.zip' + Write-Host "Downloading: $PowerShellZipUrl" $ExtractedPowerShellPath = DownloadAndExtractZip -Url $PowerShellZipUrl $PwshPath = Join-Path $ExtractedPowerShellPath 'pwsh.exe' From 59c75e7e772abc1d0f1714dd0e83d8af2413b176 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 5 Jan 2021 17:55:48 -0800 Subject: [PATCH 07/14] Python 3.9.1. --- azure-devops/provision-image.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-devops/provision-image.ps1 b/azure-devops/provision-image.ps1 index a28c8d48f3f..2ef68ebda9b 100644 --- a/azure-devops/provision-image.ps1 +++ b/azure-devops/provision-image.ps1 @@ -138,7 +138,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.0/python-3.9.0-amd64.exe' +$PythonUrl = 'https://www.python.org/ftp/python/3.9.1/python-3.9.1-amd64.exe' # https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk $WindowsDriverKitUrl = 'https://go.microsoft.com/fwlink/?linkid=2128854' From 5d8c059b8a46c415ea8d1e81e85c82470b2440c2 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 20 Jan 2021 16:12:16 -0800 Subject: [PATCH 08/14] PowerShell 7.1.1. --- azure-devops/provision-image.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-devops/provision-image.ps1 b/azure-devops/provision-image.ps1 index 2ef68ebda9b..240a875291b 100644 --- a/azure-devops/provision-image.ps1 +++ b/azure-devops/provision-image.ps1 @@ -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.0/PowerShell-7.1.0-win-x64.zip' + $PowerShellZipUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.1.1/PowerShell-7.1.1-win-x64.zip' Write-Host "Downloading: $PowerShellZipUrl" $ExtractedPowerShellPath = DownloadAndExtractZip -Url $PowerShellZipUrl $PwshPath = Join-Path $ExtractedPowerShellPath 'pwsh.exe' From 858829950512c6af9f2dc41b81d9e0e7990618d5 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 20 Jan 2021 16:39:38 -0800 Subject: [PATCH 09/14] Enable test-signed kernel-mode drivers. --- azure-devops/provision-image.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/azure-devops/provision-image.ps1 b/azure-devops/provision-image.ps1 index 240a875291b..7bd53a0ece7 100644 --- a/azure-devops/provision-image.ps1 +++ b/azure-devops/provision-image.ps1 @@ -396,3 +396,9 @@ Write-Host 'Finished updating PATH!' PipInstall pip PipInstall psutil + +# https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/bcdedit--set#verification-settings +Write-Host 'Enabling test-signed kernel-mode drivers...' +bcdedit /set testsigning on + +Write-Host 'Done!' From fecd705dfece519b8fb43c3a3f911e9aaa8a7f4b Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 20 Jan 2021 17:37:05 -0800 Subject: [PATCH 10/14] Work around VSO-1268140. VSO-1268140 "EDG: weirdness evaluating rvalue-qualified constexpr member function" --- tests/std/tests/P0220R1_optional/test.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/std/tests/P0220R1_optional/test.cpp b/tests/std/tests/P0220R1_optional/test.cpp index a7bb292e541..ec0b2904315 100644 --- a/tests/std/tests/P0220R1_optional/test.cpp +++ b/tests/std/tests/P0220R1_optional/test.cpp @@ -5495,13 +5495,17 @@ constexpr int test() { optional opt(in_place, 2); Y y(3); +#ifndef __EDG__ // TRANSITION, VSO-1268140 assert(std::move(opt).value_or(y) == 2); assert(*opt == 0); +#endif // ^^^ no workaround ^^^ } { optional opt(in_place, 2); +#ifndef __EDG__ // TRANSITION, VSO-1268140 assert(std::move(opt).value_or(Y(3)) == 2); assert(*opt == 0); +#endif // ^^^ no workaround ^^^ } { optional opt; From 166cfbf04e5f1c808c149d3d65fd1c532c882803 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 20 Jan 2021 19:44:32 -0800 Subject: [PATCH 11/14] PsExec now requires `-i` when using `-h`. --- azure-devops/provision-image.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-devops/provision-image.ps1 b/azure-devops/provision-image.ps1 index 7bd53a0ece7..238f6effecf 100644 --- a/azure-devops/provision-image.ps1 +++ b/azure-devops/provision-image.ps1 @@ -102,6 +102,7 @@ if ([string]::IsNullOrEmpty($AdminUserPassword)) { '-p', 'AdminUserPassword_REDACTED', '-accepteula', + '-i', '-h', $PwshPath, '-ExecutionPolicy', From 94a9a5c5e89c75738dae5b17cf506519657cb476 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 20 Jan 2021 21:18:34 -0800 Subject: [PATCH 12/14] Run `pip install` with `--progress-bar off`. --- azure-devops/provision-image.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-devops/provision-image.ps1 b/azure-devops/provision-image.ps1 index 238f6effecf..8468b850ad6 100644 --- a/azure-devops/provision-image.ps1 +++ b/azure-devops/provision-image.ps1 @@ -354,7 +354,7 @@ Function PipInstall { try { Write-Host "Installing or upgrading $Package..." - python.exe -m pip install --upgrade $Package + python.exe -m pip install --progress-bar off --upgrade $Package Write-Host "Done installing or upgrading $Package." } catch { From d0dbb21e95a05174aeae49c9d2aa9e6b0ccd1cf0 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 20 Jan 2021 21:35:21 -0800 Subject: [PATCH 13/14] Use the new VMSS pool. --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3fa907668b9..f342d73784b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,7 +6,7 @@ variables: tmpDir: 'D:\Temp' -pool: 'StlBuild-2020-12-08-1' +pool: 'StlBuild-2021-01-20-2' stages: - stage: Code_Format From a23f19ff3fc31a87898c95408e2fb5198af295c3 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 20 Jan 2021 21:35:51 -0800 Subject: [PATCH 14/14] Update VS, CMake, Ninja, Python versions. --- CMakeLists.txt | 2 +- README.md | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e712f36ad8..8b166a3d5a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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.18) +cmake_minimum_required(VERSION 3.19) set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) project(msvc_standard_libraries LANGUAGES CXX) diff --git a/README.md b/README.md index 570e9cedcf9..40546698950 100644 --- a/README.md +++ b/README.md @@ -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.9 Preview 2 or later. +1. Install Visual Studio 2019 16.9 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.18 or later, and [Ninja][] 1.8.2 or later. + * Otherwise, install [CMake][] 3.19 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". @@ -158,10 +158,10 @@ acquire this dependency. # How To Build With A Native Tools Command Prompt -1. Install Visual Studio 2019 16.9 Preview 2 or later. +1. Install Visual Studio 2019 16.9 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.18 or later, and [Ninja][] 1.8.2 or later. + * Otherwise, install [CMake][] 3.19 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` @@ -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 or newer and have it on the `PATH` (or run it directly using its absolute or relative path). +2. Acquire [Python][] 3.9.1 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.