Skip to content

Commit

Permalink
Toolset update: VS 2022 17.1 Preview 2, Clang 13 (#2474)
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanTLavavej authored Jan 20, 2022
1 parent 086b072 commit 33007ac
Show file tree
Hide file tree
Showing 64 changed files with 281 additions and 324 deletions.
23 changes: 18 additions & 5 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/12.0.0/tools/clang/docs/ClangFormatStyleOptions.html
# https://releases.llvm.org/13.0.0/tools/clang/docs/ClangFormatStyleOptions.html

---
# Language: Cpp
Expand All @@ -10,6 +10,8 @@ BasedOnStyle: LLVM
AccessModifierOffset: -4
# AlignAfterOpenBracket: Align
AlignAfterOpenBracket: DontAlign
# AlignArrayOfStructures: None
# TRANSITION, LLVM-51935 (try using AlignArrayOfStructures after this crash is fixed)
# AlignConsecutiveMacros: None
AlignConsecutiveMacros: Consecutive
# AlignConsecutiveAssignments: None
Expand Down Expand Up @@ -84,15 +86,16 @@ ColumnLimit: 120
DeriveLineEnding: false
# DerivePointerAlignment: false
# DisableFormat: false
# EmptyLineAfterAccessModifier: Never
# EmptyLineBeforeAccessModifier: LogicalBlock
# ExperimentalAutoDetectBinPacking: false
# FixNamespaceComments: true
# ForEachMacros:
# - foreach
# - Q_FOREACH
# - BOOST_FOREACH
# StatementAttributeLikeMacros:
# - Q_EMIT
# IfMacros:
# - KJ_IF_MAYBE
# IncludeBlocks: Preserve
IncludeBlocks: Regroup
# IncludeCategories:
Expand Down Expand Up @@ -125,6 +128,7 @@ IncludeCategories:
Priority: 2
# IncludeIsMainRegex: '(Test)?$'
# IncludeIsMainSourceRegex: ''
# IndentAccessModifiers: false
# IndentCaseLabels: false
# IndentCaseBlocks: false
IndentCaseBlocks: true
Expand All @@ -141,6 +145,7 @@ IndentWrappedFunctionNames: true
# JavaScriptQuotes: Leave
# JavaScriptWrapImports: true
# KeepEmptyLinesAtTheStartOfBlocks: true
# LambdaBodyIndentation: Signature
# NOTE: MacroBlockBegin/MacroBlockEnd don't work with _CATCH_ALL.
# MacroBlockBegin: ''
# MacroBlockEnd: ''
Expand All @@ -164,8 +169,11 @@ NamespaceIndentation: All
# PenaltyIndentedWhitespace: 0
# PointerAlignment: Right
PointerAlignment: Left
# PPIndentWidth: -1
# ReferenceAlignment: Pointer
# ReflowComments: true
# SortIncludes: true
# ShortNamespaceLines: 1
# SortIncludes: CaseSensitive
# SortJavaStaticImport: Before
# SortUsingDeclarations: true
# SpaceAfterCStyleCast: false
Expand All @@ -183,15 +191,20 @@ SpaceAfterCStyleCast: true
# SpaceInEmptyBlock: false
# SpaceInEmptyParentheses: false
# SpacesBeforeTrailingComments: 1
# SpacesInAngles: false
# SpacesInAngles: Never
# SpacesInConditionalStatement: false
# SpacesInContainerLiterals: true
# SpacesInCStyleCastParentheses: false
# SpacesInLineCommentPrefix:
# Minimum: 1
# Maximum: -1
# SpacesInParentheses: false
# SpacesInSquareBrackets: false
# SpaceBeforeSquareBrackets: false
# BitFieldColonSpacing: Both
# Standard: Latest
# StatementAttributeLikeMacros:
# - Q_EMIT
# StatementMacros:
# - Q_UNUSED
# - QT_REQUIRE_VERSION
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-status-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ">=16.0.0"
node-version: ">=17.3.1"
- name: Install Packages
run: |
npm ci
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 1 or later.
1. Install Visual Studio 2022 17.1 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.21 or later, and [Ninja][] 1.10.2 or later.
Expand All @@ -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 1 or later.
1. Install Visual Studio 2022 17.1 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.21 or later, and [Ninja][] 1.10.2 or later.
Expand Down
38 changes: 21 additions & 17 deletions azure-devops/create-vmss.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $Env:SuppressAzurePowerShellBreakingChangeWarnings = 'true'

$Location = 'westus2'
$Prefix = 'StlBuild-' + (Get-Date -Format 'yyyy-MM-dd')
$VMSize = 'Standard_D32as_v4'
$VMSize = 'Standard_D32ads_v5'
$ProtoVMName = 'PROTOTYPE'
$LiveVMPrefix = 'BUILD'
$ImagePublisher = 'MicrosoftWindowsDesktop'
Expand Down Expand Up @@ -103,7 +103,7 @@ function New-Password {

# This 64-character alphabet generates 6 bits of entropy per character.
# The power-of-2 alphabet size allows us to select a character by masking a random Byte with bitwise-AND.
$alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-"
$alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-'
$mask = 63
if ($alphabet.Length -ne 64) {
throw 'Bad alphabet length'
Expand Down Expand Up @@ -158,7 +158,7 @@ function Wait-Shutdown {
}
}

Write-Host "... not stopped yet, sleeping for 10 seconds"
Write-Host '... not stopped yet, sleeping for 10 seconds'
Start-Sleep -Seconds 10
}
}
Expand All @@ -170,7 +170,7 @@ Write-Progress `
-Status 'Setting the subscription context' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++)

Set-AzContext -SubscriptionName CPP_STL_GitHub
$IgnoredAzureContext = Set-AzContext -SubscriptionName CPP_STL_GitHub

####################################################################################################
Write-Progress `
Expand All @@ -180,9 +180,9 @@ Write-Progress `

$ResourceGroupName = Find-ResourceGroupName $Prefix
$AdminPW = New-Password
New-AzResourceGroup -Name $ResourceGroupName -Location $Location
$IgnoredResourceGroup = New-AzResourceGroup -Name $ResourceGroupName -Location $Location
$AdminPWSecure = ConvertTo-SecureString $AdminPW -AsPlainText -Force
$Credential = New-Object System.Management.Automation.PSCredential ("AdminUser", $AdminPWSecure)
$Credential = New-Object System.Management.Automation.PSCredential ('AdminUser', $AdminPWSecure)

####################################################################################################
Write-Progress `
Expand Down Expand Up @@ -236,20 +236,21 @@ $NetworkSecurityGroup = New-AzNetworkSecurityGroup `
$SubnetName = $ResourceGroupName + '-Subnet'
$Subnet = New-AzVirtualNetworkSubnetConfig `
-Name $SubnetName `
-AddressPrefix "10.0.0.0/16" `
-AddressPrefix '10.0.0.0/16' `
-NetworkSecurityGroup $NetworkSecurityGroup

$VirtualNetworkName = $ResourceGroupName + '-Network'
$VirtualNetwork = New-AzVirtualNetwork `
-Name $VirtualNetworkName `
-ResourceGroupName $ResourceGroupName `
-Location $Location `
-AddressPrefix "10.0.0.0/16" `
-AddressPrefix '10.0.0.0/16' `
-Subnet $Subnet

####################################################################################################
Write-Progress `
-Activity 'Creating prototype VM' `
-Activity $ProgressActivity `
-Status 'Creating prototype VM' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++)

$NicName = $ResourceGroupName + '-NIC'
Expand All @@ -276,7 +277,7 @@ $VM = Set-AzVMSourceImage `
-Version latest

$VM = Set-AzVMBootDiagnostic -VM $VM -Disable
New-AzVm `
$IgnoredAzureOperationResponse = New-AzVm `
-ResourceGroupName $ResourceGroupName `
-Location $Location `
-VM $VM
Expand All @@ -302,7 +303,7 @@ Write-Progress `
-Status 'Restarting VM' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++)

Restart-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName
$IgnoredComputeLongRunningOperation = Restart-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName

####################################################################################################
Write-Progress `
Expand All @@ -320,7 +321,7 @@ Write-Progress `
-Status 'Running provisioning script sysprep.ps1 in VM' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++)

Invoke-AzVMRunCommand `
$IgnoredRunCommandResult = Invoke-AzVMRunCommand `
-ResourceGroupName $ResourceGroupName `
-VMName $ProtoVMName `
-CommandId 'RunPowerShellScript' `
Expand All @@ -340,12 +341,12 @@ Write-Progress `
-Status 'Converting VM to Image' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++)

Stop-AzVM `
$IgnoredComputeLongRunningOperation = Stop-AzVM `
-ResourceGroupName $ResourceGroupName `
-Name $ProtoVMName `
-Force

Set-AzVM `
$IgnoredComputeLongRunningOperation = Set-AzVM `
-ResourceGroupName $ResourceGroupName `
-Name $ProtoVMName `
-Generalized
Expand All @@ -361,8 +362,11 @@ Write-Progress `
-Status 'Deleting unused VM and disk' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++)

Remove-AzVM -Id $VM.ID -Force
Remove-AzDisk -ResourceGroupName $ResourceGroupName -DiskName $PrototypeOSDiskName -Force
$IgnoredComputeLongRunningOperation = Remove-AzVM -Id $VM.ID -Force
$IgnoredOperationStatusResponse = Remove-AzDisk `
-ResourceGroupName $ResourceGroupName `
-DiskName $PrototypeOSDiskName `
-Force

####################################################################################################
Write-Progress `
Expand Down Expand Up @@ -405,7 +409,7 @@ $Vmss = Set-AzVmssStorageProfile `
-OsDiskCaching ReadWrite `
-ImageReferenceId $Image.Id

New-AzVmss `
$Vmss = New-AzVmss `
-ResourceGroupName $ResourceGroupName `
-Name $VmssName `
-VirtualMachineScaleSet $Vmss
Expand Down
13 changes: 8 additions & 5 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.0/PowerShell-7.2.0-win-x64.zip'
$PowerShellZipUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.2.1/PowerShell-7.2.1-win-x64.zip'
Write-Host "Downloading: $PowerShellZipUrl"
$ExtractedPowerShellPath = DownloadAndExtractZip -Url $PowerShellZipUrl
$PwshPath = Join-Path $ExtractedPowerShellPath 'pwsh.exe'
Expand Down Expand Up @@ -141,7 +141,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.0/python-3.10.0-amd64.exe'
$PythonUrl = 'https://www.python.org/ftp/python/3.10.1/python-3.10.1-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 Expand Up @@ -333,6 +333,9 @@ Function PipInstall {

Write-Host 'AdminUser password not supplied; assuming already running as AdminUser.'

# Print the Windows version, so we can verify whether Patch Tuesday has been picked up.
cmd /c ver

Write-Host 'Configuring AntiVirus exclusions...'
Add-MpPreference -ExclusionPath C:\agent
Add-MpPreference -ExclusionPath D:\
Expand All @@ -349,15 +352,15 @@ InstallCuda -Url $CudaUrl -Features $CudaFeatures
Write-Host 'Updating PATH...'

# Step 1: Read the system path, which was just updated by installing Python.
$currentSystemPath = [Environment]::GetEnvironmentVariable("Path", "Machine")
$currentSystemPath = [Environment]::GetEnvironmentVariable('Path', 'Machine')

# Step 2: Update the local path (for this running script), so PipInstall can run python.exe.
# Additional directories can be added here (e.g. if we extracted a zip file
# or installed something that didn't update the system path).
$Env:PATH="$($currentSystemPath)"

# Step 3: Update the system path, permanently recording any additional directories that were added in the previous step.
[Environment]::SetEnvironmentVariable("Path", "$Env:PATH", "Machine")
[Environment]::SetEnvironmentVariable('Path', "$Env:PATH", 'Machine')

Write-Host 'Finished updating PATH!'

Expand All @@ -371,7 +374,7 @@ Write-Host 'Finished running PipInstall!'
Write-Host 'Setting other environment variables...'

# The STL's PR/CI builds are totally unrepresentative of customer usage.
[Environment]::SetEnvironmentVariable("VSCMD_SKIP_SENDTELEMETRY", "1", "Machine")
[Environment]::SetEnvironmentVariable('VSCMD_SKIP_SENDTELEMETRY', '1', 'Machine')

Write-Host 'Finished setting other environment variables!'

Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ variables:
tmpDir: 'D:\Temp'
buildOutputLocation: 'D:\build'

pool: 'StlBuild-2021-11-09'
pool: 'StlBuild-2022-01-13-2'

stages:
- stage: Code_Format
Expand Down
Loading

0 comments on commit 33007ac

Please sign in to comment.