Skip to content

Commit 37b793c

Browse files
Toolset update: VS 2022 17.11 Preview 1 (#4687)
1 parent 63354c3 commit 37b793c

File tree

15 files changed

+121
-195
lines changed

15 files changed

+121
-195
lines changed

.github/workflows/update-status-chart.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Setup Node.js
2121
uses: actions/setup-node@v4
2222
with:
23-
node-version: ">=21.7.1"
23+
node-version: ">=22.2.0"
2424
- name: Install Packages
2525
run: |
2626
npm ci

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem
141141

142142
# How To Build With The Visual Studio IDE
143143

144-
1. Install Visual Studio 2022 17.10 Preview 4 or later.
144+
1. Install Visual Studio 2022 17.11 Preview 1 or later.
145145
* Select "Windows 11 SDK (10.0.22621.0)" in the VS Installer.
146146
* We recommend selecting "C++ CMake tools for Windows" in the VS Installer.
147147
This will ensure that you're using supported versions of CMake and Ninja.
@@ -156,7 +156,7 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem
156156

157157
# How To Build With A Native Tools Command Prompt
158158

159-
1. Install Visual Studio 2022 17.10 Preview 4 or later.
159+
1. Install Visual Studio 2022 17.11 Preview 1 or later.
160160
* Select "Windows 11 SDK (10.0.22621.0)" in the VS Installer.
161161
* We recommend selecting "C++ CMake tools for Windows" in the VS Installer.
162162
This will ensure that you're using supported versions of CMake and Ninja.

azure-devops/checkout-submodule.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,22 @@ steps:
1212
- task: PowerShell@2
1313
displayName: 'Checkout ${{ parameters.path }} Submodule'
1414
condition: and(succeeded(), ${{ parameters.enabled }})
15+
retryCountOnTaskFailure: 4
1516
inputs:
17+
pwsh: true
1618
targetType: inline
1719
script: |
20+
$PSNativeCommandUseErrorActionPreference = $true
1821
$submodule = '${{ parameters.path }}'
1922
$rawStatus = git submodule status --cached $submodule
20-
$sha = $rawStatus -replace '^[ \-+]([0-9a-f]+) .*$', '$1'
23+
$sha = $rawStatus -creplace '^[ \-+]([0-9a-f]+) .*$', '$1'
2124
cd $submodule
2225
git init
2326
if ((git remote) -eq $null) {
2427
git remote add submodule-upstream ${{ parameters.url }}
2528
}
2629
git fetch --filter=tree:0 --depth=1 submodule-upstream $sha
27-
if ($submodule -eq 'llvm-project') {
30+
if ($submodule -ceq 'llvm-project') {
2831
git sparse-checkout set --sparse-index libcxx/test libcxx/utils/libcxx llvm/utils/lit
2932
}
3033
git reset --quiet --hard FETCH_HEAD

azure-devops/config.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
variables:
77
- name: poolName
8-
value: 'StlBuild-2024-04-17T1257-Pool'
8+
value: 'StlBuild-2024-05-21T1719-Pool'
99
readonly: true
1010
- name: poolDemands
1111
value: 'EnableSpotVM -equals false'
@@ -19,6 +19,9 @@ variables:
1919
- name: benchmarkBuildOutputLocation
2020
value: 'D:\benchmark'
2121
readonly: true
22+
- name: validationBuildOutputLocation
23+
value: 'D:\validation'
24+
readonly: true
2225
- name: Codeql.SkipTaskAutoInjection
2326
value: true
2427
readonly: true

azure-devops/create-1es-hosted-pool.ps1

Lines changed: 29 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -70,36 +70,6 @@ function New-Password {
7070
return $result
7171
}
7272

73-
<#
74-
.SYNOPSIS
75-
Waits for the shutdown of the specified resource.
76-
77-
.DESCRIPTION
78-
Wait-Shutdown takes a VM, and checks if there's a 'PowerState/stopped'
79-
code; if there is, it returns. If there isn't, it waits 10 seconds and
80-
tries again.
81-
82-
.PARAMETER ResourceGroupName
83-
The name of the resource group to look up the VM in.
84-
85-
.PARAMETER Name
86-
The name of the virtual machine to wait on.
87-
#>
88-
function Wait-Shutdown {
89-
[CmdletBinding(PositionalBinding=$false)]
90-
Param(
91-
[Parameter(Mandatory)][string]$ResourceGroupName,
92-
[Parameter(Mandatory)][string]$Name
93-
)
94-
95-
Write-Host "Waiting for $Name to stop..."
96-
$StoppedCode = 'PowerState/stopped'
97-
while ($StoppedCode -notin (Get-AzVM -ResourceGroupName $ResourceGroupName -Name $Name -Status).Statuses.Code) {
98-
Write-Host '... not stopped yet, sleeping for 10 seconds'
99-
Start-Sleep -Seconds 10
100-
}
101-
}
102-
10373
####################################################################################################
10474
Display-ProgressBar -Status 'Silencing breaking change warnings'
10575

@@ -169,7 +139,7 @@ Display-ProgressBar -Status 'Creating prototype VM'
169139

170140
# Previously: -Priority 'Spot'
171141
$VM = New-AzVMConfig `
172-
-Name $ProtoVMName `
142+
-VMName $ProtoVMName `
173143
-VMSize $VMSize `
174144
-Priority 'Regular'
175145

@@ -195,79 +165,79 @@ $VM = Set-AzVMBootDiagnostic `
195165
-VM $VM `
196166
-Disable
197167

198-
$VM = Set-AzVMSecurityProfile `
199-
-VM $VM `
200-
-SecurityType 'TrustedLaunch'
201-
202-
$VM = Set-AzVMUefi `
203-
-VM $VM `
204-
-EnableVtpm $true `
205-
-EnableSecureBoot $true
206-
207168
New-AzVm `
208169
-ResourceGroupName $ResourceGroupName `
209170
-Location $Location `
210171
-VM $VM | Out-Null
211172

173+
$VM = Get-AzVM `
174+
-ResourceGroupName $ResourceGroupName `
175+
-Name $ProtoVMName
176+
177+
$PrototypeOSDiskName = $VM.StorageProfile.OsDisk.Name
178+
212179
####################################################################################################
213180
Display-ProgressBar -Status 'Running provision-image.ps1 in VM'
214181

215182
$ProvisionImageResult = Invoke-AzVMRunCommand `
216-
-ResourceGroupName $ResourceGroupName `
217-
-VMName $ProtoVMName `
183+
-ResourceId $VM.ID `
218184
-CommandId 'RunPowerShellScript' `
219185
-ScriptPath "$PSScriptRoot\provision-image.ps1"
220186

221187
Write-Host $ProvisionImageResult.value.Message
222188

189+
if ($ProvisionImageResult.value.Message -cnotmatch 'PROVISION_IMAGE_SUCCEEDED') {
190+
Write-Host 'provision-image.ps1 failed, stopping VM...'
191+
192+
Stop-AzVM `
193+
-Id $VM.ID `
194+
-Force | Out-Null
195+
196+
Write-Error "VM stopped. Remember to delete unusable resource group: $ResourceGroupName"
197+
}
198+
223199
####################################################################################################
224200
Display-ProgressBar -Status 'Restarting VM'
225201

226-
Restart-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName | Out-Null
202+
Restart-AzVM `
203+
-Id $VM.ID | Out-Null
227204

228205
####################################################################################################
229206
Display-ProgressBar -Status 'Sleeping after restart'
230207

231208
# The VM appears to be busy immediately after restarting.
232-
# This workaround waits for a minute before attempting to run sysprep.ps1.
209+
# This workaround waits for a minute before attempting to run sysprep.
233210
Start-Sleep -Seconds 60
234211

235212
####################################################################################################
236-
Display-ProgressBar -Status 'Running sysprep.ps1 in VM'
213+
Display-ProgressBar -Status 'Running sysprep in VM'
237214

238215
Invoke-AzVMRunCommand `
239-
-ResourceGroupName $ResourceGroupName `
240-
-VMName $ProtoVMName `
216+
-ResourceId $VM.ID `
241217
-CommandId 'RunPowerShellScript' `
242-
-ScriptPath "$PSScriptRoot\sysprep.ps1" | Out-Null
218+
-ScriptString 'C:\Windows\system32\sysprep\sysprep.exe /oobe /generalize /mode:vm /shutdown' | Out-Null
243219

244220
####################################################################################################
245221
Display-ProgressBar -Status 'Waiting for VM to shut down'
246222

247-
Wait-Shutdown -ResourceGroupName $ResourceGroupName -Name $ProtoVMName
223+
while ('PowerState/stopped' -notin (Get-AzVM -ResourceId $VM.ID -Status).Statuses.Code) {
224+
Start-Sleep -Seconds 10
225+
}
248226

249227
####################################################################################################
250228
Display-ProgressBar -Status 'Stopping VM'
251229

252230
Stop-AzVM `
253-
-ResourceGroupName $ResourceGroupName `
254-
-Name $ProtoVMName `
231+
-Id $VM.ID `
255232
-Force | Out-Null
256233

257234
####################################################################################################
258235
Display-ProgressBar -Status 'Generalizing VM'
259236

260237
Set-AzVM `
261-
-ResourceGroupName $ResourceGroupName `
262-
-Name $ProtoVMName `
238+
-Id $VM.ID `
263239
-Generalized | Out-Null
264240

265-
$VM = Get-AzVM `
266-
-ResourceGroupName $ResourceGroupName `
267-
-Name $ProtoVMName
268-
269-
$PrototypeOSDiskName = $VM.StorageProfile.OsDisk.Name
270-
271241
####################################################################################################
272242
Display-ProgressBar -Status 'Creating gallery'
273243

azure-devops/create-prdiff.ps1

Lines changed: 0 additions & 37 deletions
This file was deleted.

azure-devops/format-validation.yml

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,67 @@ jobs:
1010
steps:
1111
- template: checkout-self.yml
1212
- script: |
13+
if exist "$(validationBuildOutputLocation)" (
14+
rmdir /S /Q "$(validationBuildOutputLocation)"
15+
)
1316
call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^
1417
-host_arch=x64 -arch=x64 -no_logo
15-
cmake -G Ninja -S $(Build.SourcesDirectory)/tools -B $(tmpDir)/format-validate-build
16-
cmake --build $(tmpDir)/format-validate-build
18+
cmake -G Ninja -S $(Build.SourcesDirectory)/tools -B "$(validationBuildOutputLocation)"
19+
cmake --build "$(validationBuildOutputLocation)"
1720
displayName: 'Build format and validation'
1821
timeoutInMinutes: 5
1922
env: { TMP: $(tmpDir), TEMP: $(tmpDir) }
2023
- script: |
2124
call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^
2225
-host_arch=x64 -arch=x64 -no_logo
23-
cmake --build $(tmpDir)/format-validate-build --target run-format
26+
cmake --build "$(validationBuildOutputLocation)" --target run-format
2427
displayName: 'clang-format Files'
2528
timeoutInMinutes: 5
2629
env: { TMP: $(tmpDir), TEMP: $(tmpDir) }
2730
- script: |
2831
call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^
2932
-host_arch=x64 -arch=x64 -no_logo
30-
cmake --build $(tmpDir)/format-validate-build --target run-validate
33+
cmake --build "$(validationBuildOutputLocation)" --target run-validate
3134
displayName: 'Validate Files'
3235
timeoutInMinutes: 2
3336
env: { TMP: $(tmpDir), TEMP: $(tmpDir) }
3437
- task: PowerShell@2
3538
displayName: 'Create Diff'
3639
inputs:
37-
filePath: azure-devops/create-prdiff.ps1
40+
pwsh: true
41+
targetType: inline
42+
script: |
43+
$TempSubDir = Join-Path ([System.IO.Path]::GetTempPath()) ([System.IO.Path]::GetRandomFileName())
44+
mkdir $TempSubDir -Force | Out-Null
45+
$DiffFile = Join-Path $TempSubDir 'format.diff'
46+
git diff --ignore-submodules > $DiffFile
47+
if ((Get-Item -LiteralPath $DiffFile).Length -ne 0) {
48+
$message = @(
49+
'##vso[task.logissue type=error]The files in the repo need to be properly formatted.'
50+
''
51+
'##[section]To fix this, you can clang-format the entire repo with:'
52+
' cmake --preset x64'
53+
' cmake --build --preset x64 --target format'
54+
''
55+
'##[section]Please avoid this in the future by configuring your editor to format-on-save.'
56+
''
57+
'##[section]View expected formatting:'
58+
'##[group] >>>>> Click this line to expand the diff: <<<<<'
59+
Get-Content -LiteralPath $DiffFile -Raw
60+
'##[endgroup]'
61+
''
62+
'##[section]You can also download this as format.diff and apply it with `git apply`:'
63+
' 1. Click the failed Validation job (upper left, marked with a red X)'
64+
' 2. Click "1 artifact produced"'
65+
' 3. Click the ">" chevron to the left of "format-artifact"'
66+
' 4. Hover over "format.diff"'
67+
' 5. Click the three dots that appear on the right'
68+
' 6. Click "Download artifacts"'
69+
''
70+
"##vso[artifact.upload artifactname=format-artifact]$DiffFile"
71+
'##vso[task.complete result=Failed]'
72+
)
73+
Write-Host ($message -join "`n")
74+
}
3875
condition: succeededOrFailed()
3976
env: { TMP: $(tmpDir), TEMP: $(tmpDir) }

0 commit comments

Comments
 (0)