From ce48d2aca25e96efb7831323be92ca6ec28decf7 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 20 Jan 2022 15:54:53 -0800 Subject: [PATCH 01/19] Rename to tools/scripts, comment what move_only_function_specializations.py does. --- stl/inc/functional | 2 +- .../move_only_function_specializations.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) rename tools/{move_only_function_specializations => scripts}/move_only_function_specializations.py (91%) diff --git a/stl/inc/functional b/stl/inc/functional index 096bce99dd4..ec0fc788a1d 100644 --- a/stl/inc/functional +++ b/stl/inc/functional @@ -1532,7 +1532,7 @@ class _Move_only_function_call { }; // A script to generate the specializations is at -// /tools/move_only_function_specializations/move_only_function_specializations.py +// /tools/scripts/move_only_function_specializations.py // (Avoiding C++ preprocessor for better IDE navigation and debugging experience) template diff --git a/tools/move_only_function_specializations/move_only_function_specializations.py b/tools/scripts/move_only_function_specializations.py similarity index 91% rename from tools/move_only_function_specializations/move_only_function_specializations.py rename to tools/scripts/move_only_function_specializations.py index be60da2b3ad..a49b64e2f5b 100644 --- a/tools/move_only_function_specializations/move_only_function_specializations.py +++ b/tools/scripts/move_only_function_specializations.py @@ -1,6 +1,8 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# This script generates the partial specializations of _Move_only_function_call in . + def specialization(cv, ref, ref_inv, noex, noex_val, callable): return f"""template class _Move_only_function_call<_Rx(_Types...) {cv} {ref} {noex}> From 8f46da6a787e6a2a27d6686207d4475445e8c236 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 20 Jan 2022 16:09:19 -0800 Subject: [PATCH 02/19] Add tools/scripts/print_failures.py. --- tools/scripts/print_failures.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tools/scripts/print_failures.py diff --git a/tools/scripts/print_failures.py b/tools/scripts/print_failures.py new file mode 100644 index 00000000000..d4120d81090 --- /dev/null +++ b/tools/scripts/print_failures.py @@ -0,0 +1,23 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +# This script prints the output of test failures that were recorded by `stl-lit.py -o TEST_LOG_FILENAME`. + +import json +import sys + +if len(sys.argv) != 2: + sys.exit(f"Usage: python {sys.argv[0]} TEST_LOG_FILENAME") + +test_log = json.load(open(sys.argv[1])) + +for result in test_log["tests"]: + if not result["code"] in ["PASS", "UNSUPPORTED", "XFAIL"]: + print("code: {}".format(result["code"])) + # Ignore result["elapsed"]. + print("name: {}".format(result["name"])) + # The JSON contains embedded CRLFs (which aren't affected by opening the file in text mode). + # If we don't replace these CRLFs with LFs here, this script will appear to be okay in the console, + # but redirecting it to a file will result in ugly double newlines. + print("output: {}".format(result["output"].replace("\r\n", "\n"))) + print("==================================================") From 67639a9e5b3daf1161961259727a7d4daa9ba75f Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 20 Jan 2022 13:32:21 -0800 Subject: [PATCH 03/19] Remove workaround for VSO-1460046. This was "EDG rejects `hash>` called with `optional`". --- tests/std/tests/P0220R1_optional/test.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/std/tests/P0220R1_optional/test.cpp b/tests/std/tests/P0220R1_optional/test.cpp index c3de0db97e7..ad7ea5f3fdc 100644 --- a/tests/std/tests/P0220R1_optional/test.cpp +++ b/tests/std/tests/P0220R1_optional/test.cpp @@ -696,9 +696,7 @@ int run_test() { optional opt; ASSERT_NOT_NOEXCEPT(std::hash>()(opt)); -#ifndef __EDG__ // TRANSITION, DevCom-1633478 / VSO-1460046 ASSERT_NOT_NOEXCEPT(std::hash>()(opt)); -#endif // ^^^ no workaround ^^^ } { From 17f36929ee33fc5663c808e7ca67ea06a83a41a8 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 20 Jan 2022 13:34:27 -0800 Subject: [PATCH 04/19] Remove compiler workaround in `subrange`. --- stl/inc/xutility | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/stl/inc/xutility b/stl/inc/xutility index b1e218a0312..4a674f4a01d 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -3331,16 +3331,6 @@ namespace ranges { // clang-format off subrange() requires default_initializable<_It> = default; -#if !defined(_MSVC_INTERNAL_TESTING) && !defined(__clang__) && !defined(__EDG__) // TRANSITION, VS 17.1p3 - // This was originally annotated as a workaround for DevCom-1331017, but the problem it corrects continued to - // manifest after that bug was fixed. We reduced a repro to file an additional bug, but the underlying issue had - // already been fixed in the internal compiler (see GH-2326). - constexpr subrange(const subrange&) = default; - constexpr subrange(subrange&&) = default; - constexpr subrange& operator=(const subrange&) = default; - constexpr subrange& operator=(subrange&&) = default; -#endif // ^^^ workaround ^^^ - template <_Convertible_to_non_slicing<_It> _It2> constexpr subrange(_It2 _First_, _Se _Last_) requires (!_Store_size) : _First(_STD move(_First_)), _Last(_STD move(_Last_)) {} From c8cd10bbfed83ff8e23093223aca4c6fc071e28b Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 20 Jan 2022 13:38:34 -0800 Subject: [PATCH 05/19] Remove VSO-1433873 workaround. This was "Standard Library Header Units: Adding `template ` to `vformat()` emits warnings C4265 and C4365". --- stl/inc/format | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/stl/inc/format b/stl/inc/format index 09d71a7a8db..86e1fb07f52 100644 --- a/stl/inc/format +++ b/stl/inc/format @@ -3033,48 +3033,38 @@ _OutputIt format_to(_OutputIt _Out, const locale& _Loc, const _Fmt_wstring<_Type return _STD vformat_to(_STD move(_Out), _Loc, _Fmt._Str, _STD make_wformat_args(_Args...)); } -#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-1433873 -#define _TEMPLATE_INT_0_NODISCARD \ - template /* improves throughput, see GH-2329 */ \ - _NODISCARD -#else // ^^^ no workaround / workaround vvv -#define _TEMPLATE_INT_0_NODISCARD _NODISCARD inline -#endif // ^^^ workaround ^^^ - -_TEMPLATE_INT_0_NODISCARD -string vformat(const string_view _Fmt, const format_args _Args) { +template // improves throughput, see GH-2329 +_NODISCARD string vformat(const string_view _Fmt, const format_args _Args) { string _Str; _Str.reserve(_Fmt.size() + _Args._Estimate_required_capacity()); _STD vformat_to(back_insert_iterator{_Str}, _Fmt, _Args); return _Str; } -_TEMPLATE_INT_0_NODISCARD -wstring vformat(const wstring_view _Fmt, const wformat_args _Args) { +template // improves throughput, see GH-2329 +_NODISCARD wstring vformat(const wstring_view _Fmt, const wformat_args _Args) { wstring _Str; _Str.reserve(_Fmt.size() + _Args._Estimate_required_capacity()); _STD vformat_to(back_insert_iterator{_Str}, _Fmt, _Args); return _Str; } -_TEMPLATE_INT_0_NODISCARD -string vformat(const locale& _Loc, const string_view _Fmt, const format_args _Args) { +template // improves throughput, see GH-2329 +_NODISCARD string vformat(const locale& _Loc, const string_view _Fmt, const format_args _Args) { string _Str; _Str.reserve(_Fmt.size() + _Args._Estimate_required_capacity()); _STD vformat_to(back_insert_iterator{_Str}, _Loc, _Fmt, _Args); return _Str; } -_TEMPLATE_INT_0_NODISCARD -wstring vformat(const locale& _Loc, const wstring_view _Fmt, const wformat_args _Args) { +template // improves throughput, see GH-2329 +_NODISCARD wstring vformat(const locale& _Loc, const wstring_view _Fmt, const wformat_args _Args) { wstring _Str; _Str.reserve(_Fmt.size() + _Args._Estimate_required_capacity()); _STD vformat_to(back_insert_iterator{_Str}, _Loc, _Fmt, _Args); return _Str; } -#undef _TEMPLATE_INT_0_NODISCARD // TRANSITION, VSO-1433873 - template _NODISCARD string format(const _Fmt_string<_Types...> _Fmt, const _Types&... _Args) { return _STD vformat(_Fmt._Str, _STD make_format_args(_Args...)); From f1d7ab6b19d0012418e387d133de1493a6ff9f1b Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 20 Jan 2022 17:40:54 -0800 Subject: [PATCH 06/19] Fix C4365 sign conversion warnings in format's use of fill_n. --- stl/inc/format | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stl/inc/format b/stl/inc/format index 86e1fb07f52..5bfe0590797 100644 --- a/stl/inc/format +++ b/stl/inc/format @@ -2304,7 +2304,7 @@ _NODISCARD _OutputIt _Write_integral( #pragma warning(pop) _Out = _RANGES _Copy_unchecked(_Prefix.begin(), _Prefix.end(), _STD move(_Out)).out; if (_Write_leading_zeroes && _Width < _Specs._Width) { - _Out = _RANGES fill_n(_STD move(_Out), _Specs._Width - _Width, '0'); + _Out = _RANGES fill_n(_STD move(_Out), _Specs._Width - _Width, _CharT{'0'}); } if (_Separators > 0) { @@ -2558,7 +2558,7 @@ _NODISCARD _OutputIt _Fmt_write( _Out = _Write_sign(_STD move(_Out), _Sgn, _Is_negative); if (_Write_leading_zeroes && _Width < _Specs._Width) { - _Out = _RANGES fill_n(_STD move(_Out), _Specs._Width - _Width, '0'); + _Out = _RANGES fill_n(_STD move(_Out), _Specs._Width - _Width, _CharT{'0'}); } if (_Specs._Localized) { From 02212b195d21d1bead916c070c5f7040c3c735a4 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 20 Jan 2022 18:17:13 -0800 Subject: [PATCH 07/19] Perma-workaround VSO-1464637 C4365 sign conversion warnings in format. This is "Standard Library Header Units: #pragma warning doesn't always suppress warnings in templates". --- stl/inc/format | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/stl/inc/format b/stl/inc/format index 5bfe0590797..074c1b47177 100644 --- a/stl/inc/format +++ b/stl/inc/format @@ -44,6 +44,7 @@ #pragma message("see https://github.com/microsoft/STL/issues/1814 for details.") #else // ^^^ !defined(__cpp_lib_format) / defined(__cpp_lib_format) vvv +#include #include #include #include @@ -1967,8 +1968,13 @@ _NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, const _CharT* _Value); template _NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, basic_string_view<_CharT> _Value); -#pragma warning(push) -#pragma warning(disable : 4365) // 'argument': conversion from 'char' to 'const wchar_t', signed/unsigned mismatch +template +struct _Widen_char { + _NODISCARD _CharT operator()(const char _Ch) const noexcept { + return static_cast<_CharT>(_Ch); + } +}; + // clang-format off template requires (is_arithmetic_v<_Arithmetic> && !_CharT_or_bool<_Arithmetic, _CharT>) @@ -1978,9 +1984,8 @@ _NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, const _Arithmetic _Value) { char _Buffer[_Format_min_buffer_length]; const auto [_End, _Ec] = _STD to_chars(_Buffer, _STD end(_Buffer), _Value); _STL_ASSERT(_Ec == errc{}, "to_chars failed"); - return _RANGES _Copy_unchecked(_Buffer, _End, _STD move(_Out)).out; + return _RANGES transform(_Buffer, _End, _STD move(_Out), _Widen_char<_CharT>{}).out; } -#pragma warning(pop) template _NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, const bool _Value) { @@ -1997,8 +2002,6 @@ _NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, const _CharT _Value) { return _Out; } -#pragma warning(push) -#pragma warning(disable : 4365) // 'argument': conversion from 'char' to 'const wchar_t', signed/unsigned mismatch template _NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, const void* const _Value) { // TRANSITION, Reusable buffer @@ -2007,9 +2010,8 @@ _NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, const void* const _Value) { _STL_ASSERT(_Ec == errc{}, "to_chars failed"); *_Out++ = '0'; *_Out++ = 'x'; - return _RANGES _Copy_unchecked(_Buffer, _End, _STD move(_Out)).out; + return _RANGES transform(_Buffer, _End, _STD move(_Out), _Widen_char<_CharT>{}).out; } -#pragma warning(pop) template _NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, const _CharT* _Value) { @@ -2161,7 +2163,7 @@ _NODISCARD _OutputIt _Write_separated_integer(const char* _First, const char* co ++_Repeats; } } - _Out = _RANGES _Copy_unchecked(_First, _Last - _Grouped, _STD move(_Out)).out; + _Out = _RANGES transform(_First, _Last - _Grouped, _STD move(_Out), _Widen_char<_CharT>{}).out; _First = _Last - _Grouped; for (; _Separators > 0; --_Separators) { @@ -2172,7 +2174,7 @@ _NODISCARD _OutputIt _Write_separated_integer(const char* _First, const char* co } *_Out++ = _Separator; - _Out = _RANGES _Copy_unchecked(_First, _First + *_Group_it, _STD move(_Out)).out; + _Out = _RANGES transform(_First, _First + *_Group_it, _STD move(_Out), _Widen_char<_CharT>{}).out; _First += *_Group_it; } _STL_INTERNAL_CHECK(_First == _Last); @@ -2220,8 +2222,6 @@ template _NODISCARD _OutputIt _Fmt_write( _OutputIt _Out, basic_string_view<_CharT> _Value, const _Basic_format_specs<_CharT>& _Specs, _Lazy_locale); -#pragma warning(push) -#pragma warning(disable : 4365) // 'argument': conversion from 'char' to 'const wchar_t', signed/unsigned mismatch template _NODISCARD _OutputIt _Write_integral( _OutputIt _Out, const _Integral _Value, _Basic_format_specs<_CharT> _Specs, _Lazy_locale _Locale) { @@ -2302,7 +2302,7 @@ _NODISCARD _OutputIt _Write_integral( #pragma warning(disable : 4296) // '<': expression is always false _Out = _Write_sign(_STD move(_Out), _Specs._Sgn, _Value < _Integral{0}); #pragma warning(pop) - _Out = _RANGES _Copy_unchecked(_Prefix.begin(), _Prefix.end(), _STD move(_Out)).out; + _Out = _RANGES transform(_Prefix.begin(), _Prefix.end(), _STD move(_Out), _Widen_char<_CharT>{}).out; if (_Write_leading_zeroes && _Width < _Specs._Width) { _Out = _RANGES fill_n(_STD move(_Out), _Specs._Width - _Width, _CharT{'0'}); } @@ -2312,7 +2312,7 @@ _NODISCARD _OutputIt _Write_integral( _STD use_facet>(_Locale._Get()).thousands_sep(), // _Separators, _STD move(_Out)); } - return _RANGES _Copy_unchecked(_Buffer_start, _End, _STD move(_Out)).out; + return _RANGES transform(_Buffer_start, _End, _STD move(_Out), _Widen_char<_CharT>{}).out; }; if (_Write_leading_zeroes) { @@ -2321,7 +2321,6 @@ _NODISCARD _OutputIt _Write_integral( return _Write_aligned(_STD move(_Out), _Width, _Specs, _Fmt_align::_Right, _Writer); } -#pragma warning(pop) // clang-format off template @@ -2371,8 +2370,6 @@ _NODISCARD _OutputIt _Fmt_write( return _Fmt_write(_STD move(_Out), basic_string_view<_CharT>{&_Value, 1}, _Specs, _Locale); } -#pragma warning(push) -#pragma warning(disable : 4365) // 'argument': conversion from 'char' to 'const wchar_t', signed/unsigned mismatch template _NODISCARD _OutputIt _Fmt_write( _OutputIt _Out, const _Float _Value, const _Basic_format_specs<_CharT>& _Specs, _Lazy_locale _Locale) { @@ -2576,7 +2573,7 @@ _NODISCARD _OutputIt _Fmt_write( } } - _Out = _RANGES _Copy_unchecked(_Buffer_start, _Exponent_start, _STD move(_Out)).out; + _Out = _RANGES transform(_Buffer_start, _Exponent_start, _STD move(_Out), _Widen_char<_CharT>{}).out; if (_Specs._Alt && _Append_decimal) { *_Out++ = '.'; } @@ -2585,7 +2582,7 @@ _NODISCARD _OutputIt _Fmt_write( *_Out++ = '0'; } - return _RANGES _Copy_unchecked(_Exponent_start, _Result.ptr, _STD move(_Out)).out; + return _RANGES transform(_Exponent_start, _Result.ptr, _STD move(_Out), _Widen_char<_CharT>{}).out; }; if (_Write_leading_zeroes) { @@ -2594,7 +2591,6 @@ _NODISCARD _OutputIt _Fmt_write( return _Write_aligned(_STD move(_Out), _Width, _Specs, _Fmt_align::_Right, _Writer); } -#pragma warning(pop) template _NODISCARD _OutputIt _Fmt_write( From c0c93beaa5d145e3bb98c9f3ce38f3bfb3bc8be2 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 20 Jan 2022 18:20:13 -0800 Subject: [PATCH 08/19] ranges::transform() can directly take string_view. --- stl/inc/format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/inc/format b/stl/inc/format index 074c1b47177..c3dbc982c47 100644 --- a/stl/inc/format +++ b/stl/inc/format @@ -2302,7 +2302,7 @@ _NODISCARD _OutputIt _Write_integral( #pragma warning(disable : 4296) // '<': expression is always false _Out = _Write_sign(_STD move(_Out), _Specs._Sgn, _Value < _Integral{0}); #pragma warning(pop) - _Out = _RANGES transform(_Prefix.begin(), _Prefix.end(), _STD move(_Out), _Widen_char<_CharT>{}).out; + _Out = _RANGES transform(_Prefix, _STD move(_Out), _Widen_char<_CharT>{}).out; if (_Write_leading_zeroes && _Width < _Specs._Width) { _Out = _RANGES fill_n(_STD move(_Out), _Specs._Width - _Width, _CharT{'0'}); } From 5b551611a12558a721ecd9b9582474d025eddcdd Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 20 Jan 2022 18:58:37 -0800 Subject: [PATCH 09/19] Allow QUIC, renumber priorities. --- azure-devops/create-vmss.ps1 | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/azure-devops/create-vmss.ps1 b/azure-devops/create-vmss.ps1 index 1327a15755f..b04d8b8ee2e 100644 --- a/azure-devops/create-vmss.ps1 +++ b/azure-devops/create-vmss.ps1 @@ -196,19 +196,31 @@ $allowHttp = New-AzNetworkSecurityRuleConfig ` -Access Allow ` -Protocol Tcp ` -Direction Outbound ` - -Priority 1008 ` + -Priority 1000 ` -SourceAddressPrefix * ` -SourcePortRange * ` -DestinationAddressPrefix * ` -DestinationPortRange @(80, 443) +$allowQuic = New-AzNetworkSecurityRuleConfig ` + -Name AllowQUIC ` + -Description 'Allow QUIC' ` + -Access Allow ` + -Protocol Udp ` + -Direction Outbound ` + -Priority 1010 ` + -SourceAddressPrefix * ` + -SourcePortRange * ` + -DestinationAddressPrefix * ` + -DestinationPortRange 443 + $allowDns = New-AzNetworkSecurityRuleConfig ` -Name AllowDNS ` -Description 'Allow DNS' ` -Access Allow ` -Protocol * ` -Direction Outbound ` - -Priority 1009 ` + -Priority 1020 ` -SourceAddressPrefix * ` -SourcePortRange * ` -DestinationAddressPrefix * ` @@ -220,7 +232,7 @@ $denyEverythingElse = New-AzNetworkSecurityRuleConfig ` -Access Deny ` -Protocol * ` -Direction Outbound ` - -Priority 1010 ` + -Priority 2000 ` -SourceAddressPrefix * ` -SourcePortRange * ` -DestinationAddressPrefix * ` @@ -231,7 +243,7 @@ $NetworkSecurityGroup = New-AzNetworkSecurityGroup ` -Name $NetworkSecurityGroupName ` -ResourceGroupName $ResourceGroupName ` -Location $Location ` - -SecurityRules @($allowHttp, $allowDns, $denyEverythingElse) + -SecurityRules @($allowHttp, $allowQuic, $allowDns, $denyEverythingElse) $SubnetName = $ResourceGroupName + '-Subnet' $Subnet = New-AzVirtualNetworkSubnetConfig ` From 89a3cb4293aa27d52f23756b52cb8f136dc5f9c9 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 20 Jan 2022 18:59:21 -0800 Subject: [PATCH 10/19] Add 'Microsoft.VisualStudio.Component.VC.Tools.ARM64EC'. --- 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 3f965d466ce..13061b09f19 100644 --- a/azure-devops/provision-image.ps1 +++ b/azure-devops/provision-image.ps1 @@ -133,6 +133,7 @@ $Workloads = @( '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', # TRANSITION, LLVM-51128 (Clang 12 targeting ARM64 is incompatible with WinSDK 10.0.20348.0) 'Microsoft.VisualStudio.Component.Windows10SDK.19041' From b8c1a8963c8fab61bb76e4e6c29e31d83f2533d5 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 20 Jan 2022 18:59:40 -0800 Subject: [PATCH 11/19] Python 3.10.2. --- 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 13061b09f19..cf878e2f1b7 100644 --- a/azure-devops/provision-image.ps1 +++ b/azure-devops/provision-image.ps1 @@ -142,7 +142,7 @@ $Workloads = @( $ReleaseInPath = 'Preview' $Sku = 'Enterprise' $VisualStudioBootstrapperUrl = 'https://aka.ms/vs/17/pre/vs_enterprise.exe' -$PythonUrl = 'https://www.python.org/ftp/python/3.10.1/python-3.10.1-amd64.exe' +$PythonUrl = 'https://www.python.org/ftp/python/3.10.2/python-3.10.2-amd64.exe' $CudaUrl = ` 'https://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.243_426.00_win10.exe' From 36dc27443191096878109ba10701dd7bf00c4304 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 20 Jan 2022 19:33:05 -0800 Subject: [PATCH 12/19] Also set the Azure CLI subscription. --- azure-devops/create-vmss.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-devops/create-vmss.ps1 b/azure-devops/create-vmss.ps1 index b04d8b8ee2e..a7a22500995 100644 --- a/azure-devops/create-vmss.ps1 +++ b/azure-devops/create-vmss.ps1 @@ -171,6 +171,7 @@ Write-Progress ` -PercentComplete (100 / $TotalProgress * $CurrentProgress++) $IgnoredAzureContext = Set-AzContext -SubscriptionName CPP_STL_GitHub +az account set --subscription CPP_STL_GitHub #################################################################################################### Write-Progress ` From 50ee1089f6dd5a45a5ea4d3792d8311471146f33 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Fri, 21 Jan 2022 19:14:45 -0800 Subject: [PATCH 13/19] Use member enumeration and the `-in` containment operator. https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_arrays?view=powershell-7.2#member-enumeration https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comparison_operators?view=powershell-7.2 --- azure-devops/create-vmss.ps1 | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/azure-devops/create-vmss.ps1 b/azure-devops/create-vmss.ps1 index a7a22500995..cdf9621e426 100644 --- a/azure-devops/create-vmss.ps1 +++ b/azure-devops/create-vmss.ps1 @@ -33,33 +33,6 @@ $ProgressActivity = 'Creating Scale Set' $TotalProgress = 14 $CurrentProgress = 1 -<# -.SYNOPSIS -Returns whether there's a name collision in the resource group. - -.DESCRIPTION -Find-ResourceGroupNameCollision takes a list of resources, and checks if $Test -collides names with any of the resources. - -.PARAMETER Test -The name to test. - -.PARAMETER Resources -The list of resources. -#> -function Find-ResourceGroupNameCollision { - [CmdletBinding()] - Param([string]$Test, $Resources) - - foreach ($resource in $Resources) { - if ($resource.ResourceGroupName -eq $Test) { - return $true - } - } - - return $false -} - <# .SYNOPSIS Attempts to find a name that does not collide with any resources in the resource group. @@ -76,10 +49,10 @@ function Find-ResourceGroupName { [CmdletBinding()] Param([string] $Prefix) - $resources = Get-AzResourceGroup + $existingNames = (Get-AzResourceGroup).ResourceGroupName $result = $Prefix $suffix = 0 - while (Find-ResourceGroupNameCollision -Test $result -Resources $resources) { + while ($result -in $existingNames) { $suffix++ $result = "$Prefix-$suffix" } From e9fb2db237401e590ae699338439fae022be4786 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Sun, 23 Jan 2022 14:37:20 -0800 Subject: [PATCH 14/19] Add 'THHmm' to VMSS names. --- azure-devops/create-vmss.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-devops/create-vmss.ps1 b/azure-devops/create-vmss.ps1 index cdf9621e426..ef48367de2d 100644 --- a/azure-devops/create-vmss.ps1 +++ b/azure-devops/create-vmss.ps1 @@ -21,7 +21,7 @@ $ErrorActionPreference = 'Stop' $Env:SuppressAzurePowerShellBreakingChangeWarnings = 'true' $Location = 'westus2' -$Prefix = 'StlBuild-' + (Get-Date -Format 'yyyy-MM-dd') +$Prefix = 'StlBuild-' + (Get-Date -Format 'yyyy-MM-dd-THHmm') $VMSize = 'Standard_D32ads_v5' $ProtoVMName = 'PROTOTYPE' $LiveVMPrefix = 'BUILD' From 3e58ff3360878a7c58df342d7e5ba971903bc4d3 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Sun, 23 Jan 2022 16:29:48 -0800 Subject: [PATCH 15/19] Fix VMSS diagnostics. (Need to update wiki.) --- azure-devops/create-vmss.ps1 | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/azure-devops/create-vmss.ps1 b/azure-devops/create-vmss.ps1 index ef48367de2d..5015d00f23b 100644 --- a/azure-devops/create-vmss.ps1 +++ b/azure-devops/create-vmss.ps1 @@ -406,11 +406,34 @@ Write-Progress ` -Status 'Enabling VMSS diagnostic logs' ` -PercentComplete (100 / $TotalProgress * $CurrentProgress++) +$StorageAccountName = 'stlvmssdiaglogssa' + +$ExpirationDate = (Get-Date -AsUTC).AddYears(1).ToString('yyyy-MM-ddTHH:mmZ') + +$StorageAccountSASToken = $(az storage account generate-sas ` + --account-name $StorageAccountName ` + --expiry $ExpirationDate ` + --permissions acuw ` + --resource-types co ` + --services bt ` + --https-only ` + --output tsv ` + 2> $null) + +$DiagnosticsDefaultConfig = $(az vmss diagnostics get-default-config --is-windows-os 2> $null). ` + Replace('__DIAGNOSTIC_STORAGE_ACCOUNT__', $StorageAccountName). ` + Replace('__VM_OR_VMSS_RESOURCE_ID__', $Vmss.Id) + +Out-File -FilePath "$PSScriptRoot\vmss-config.json" -InputObject $DiagnosticsDefaultConfig + +$DiagnosticsProtectedSettings = "{'storageAccountName': '$StorageAccountName', " +$DiagnosticsProtectedSettings += "'storageAccountSasToken': '?$StorageAccountSASToken'}" + az vmss diagnostics set ` --resource-group $ResourceGroupName ` --vmss-name $VmssName ` --settings "$PSScriptRoot\vmss-config.json" ` - --protected-settings "$PSScriptRoot\vmss-protected.json" ` + --protected-settings "$DiagnosticsProtectedSettings" ` --output none #################################################################################################### From 15f8d0edb5be4482e9101d79dc0b681fe006a81a Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 24 Jan 2022 20:51:07 -0800 Subject: [PATCH 16/19] Use Out-Null. --- azure-devops/create-vmss.ps1 | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/azure-devops/create-vmss.ps1 b/azure-devops/create-vmss.ps1 index 5015d00f23b..1e0aaffc5c5 100644 --- a/azure-devops/create-vmss.ps1 +++ b/azure-devops/create-vmss.ps1 @@ -143,7 +143,7 @@ Write-Progress ` -Status 'Setting the subscription context' ` -PercentComplete (100 / $TotalProgress * $CurrentProgress++) -$IgnoredAzureContext = Set-AzContext -SubscriptionName CPP_STL_GitHub +Set-AzContext -SubscriptionName CPP_STL_GitHub | Out-Null az account set --subscription CPP_STL_GitHub #################################################################################################### @@ -154,7 +154,7 @@ Write-Progress ` $ResourceGroupName = Find-ResourceGroupName $Prefix $AdminPW = New-Password -$IgnoredResourceGroup = New-AzResourceGroup -Name $ResourceGroupName -Location $Location +New-AzResourceGroup -Name $ResourceGroupName -Location $Location | Out-Null $AdminPWSecure = ConvertTo-SecureString $AdminPW -AsPlainText -Force $Credential = New-Object System.Management.Automation.PSCredential ('AdminUser', $AdminPWSecure) @@ -263,10 +263,10 @@ $VM = Set-AzVMSourceImage ` -Version latest $VM = Set-AzVMBootDiagnostic -VM $VM -Disable -$IgnoredAzureOperationResponse = New-AzVm ` +New-AzVm ` -ResourceGroupName $ResourceGroupName ` -Location $Location ` - -VM $VM + -VM $VM | Out-Null #################################################################################################### Write-Progress ` @@ -289,7 +289,7 @@ Write-Progress ` -Status 'Restarting VM' ` -PercentComplete (100 / $TotalProgress * $CurrentProgress++) -$IgnoredComputeLongRunningOperation = Restart-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName +Restart-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName | Out-Null #################################################################################################### Write-Progress ` @@ -307,11 +307,11 @@ Write-Progress ` -Status 'Running provisioning script sysprep.ps1 in VM' ` -PercentComplete (100 / $TotalProgress * $CurrentProgress++) -$IgnoredRunCommandResult = Invoke-AzVMRunCommand ` +Invoke-AzVMRunCommand ` -ResourceGroupName $ResourceGroupName ` -VMName $ProtoVMName ` -CommandId 'RunPowerShellScript' ` - -ScriptPath "$PSScriptRoot\sysprep.ps1" + -ScriptPath "$PSScriptRoot\sysprep.ps1" | Out-Null #################################################################################################### Write-Progress ` @@ -327,15 +327,15 @@ Write-Progress ` -Status 'Converting VM to Image' ` -PercentComplete (100 / $TotalProgress * $CurrentProgress++) -$IgnoredComputeLongRunningOperation = Stop-AzVM ` +Stop-AzVM ` -ResourceGroupName $ResourceGroupName ` -Name $ProtoVMName ` - -Force + -Force | Out-Null -$IgnoredComputeLongRunningOperation = Set-AzVM ` +Set-AzVM ` -ResourceGroupName $ResourceGroupName ` -Name $ProtoVMName ` - -Generalized + -Generalized | Out-Null $VM = Get-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName $PrototypeOSDiskName = $VM.StorageProfile.OsDisk.Name @@ -348,11 +348,11 @@ Write-Progress ` -Status 'Deleting unused VM and disk' ` -PercentComplete (100 / $TotalProgress * $CurrentProgress++) -$IgnoredComputeLongRunningOperation = Remove-AzVM -Id $VM.ID -Force -$IgnoredOperationStatusResponse = Remove-AzDisk ` +Remove-AzVM -Id $VM.ID -Force | Out-Null +Remove-AzDisk ` -ResourceGroupName $ResourceGroupName ` -DiskName $PrototypeOSDiskName ` - -Force + -Force | Out-Null #################################################################################################### Write-Progress ` From fbdf59b0d9fded77fa0e24c193ebdec8a0e670ac Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 25 Jan 2022 02:03:31 -0800 Subject: [PATCH 17/19] Use 2022-datacenter-g2. (Need to update wiki.) --- azure-devops/create-vmss.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-devops/create-vmss.ps1 b/azure-devops/create-vmss.ps1 index 1e0aaffc5c5..09bc73963fa 100644 --- a/azure-devops/create-vmss.ps1 +++ b/azure-devops/create-vmss.ps1 @@ -25,9 +25,9 @@ $Prefix = 'StlBuild-' + (Get-Date -Format 'yyyy-MM-dd-THHmm') $VMSize = 'Standard_D32ads_v5' $ProtoVMName = 'PROTOTYPE' $LiveVMPrefix = 'BUILD' -$ImagePublisher = 'MicrosoftWindowsDesktop' -$ImageOffer = 'windows-11' -$ImageSku = 'win11-21h2-ent' +$ImagePublisher = 'MicrosoftWindowsServer' +$ImageOffer = 'WindowsServer' +$ImageSku = '2022-datacenter-g2' $ProgressActivity = 'Creating Scale Set' $TotalProgress = 14 From bce87642ad3115effcd0bc7a042282f69a1d6f8a Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 25 Jan 2022 04:05:27 -0800 Subject: [PATCH 18/19] New pool: VS 2022 17.1 Preview 4, ARM64EC, Server. --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e0ee23116a3..bc5c06b347e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,7 +7,7 @@ variables: tmpDir: 'D:\Temp' buildOutputLocation: 'D:\build' -pool: 'StlBuild-2022-01-13-2' +pool: 'StlBuild-2022-01-25-T1318' stages: - stage: Code_Format From bdb6c2b848c18da6a4fe94ee61b0e1c803d03551 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Fri, 21 Jan 2022 17:30:56 -0800 Subject: [PATCH 19/19] Mention VS 2022 17.1 Preview 4 in README.md. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 80f4e6ab5d3..feda8a8ba04 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,7 @@ 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 2 or later. +1. Install Visual Studio 2022 17.1 Preview 4 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. @@ -155,7 +155,7 @@ 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 2 or later. +1. Install Visual Studio 2022 17.1 Preview 4 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.