Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toolset update: VS 2022 17.11 Preview 1 #4687

Merged
merged 29 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6402fd9
Detect provision-image.ps1 failure. [tested]
StephanTLavavej Apr 28, 2024
2632a76
Permanently install PowerShell 7.4.2. [tested]
StephanTLavavej Apr 28, 2024
08328dc
Download installers to `D:\installerTemp`. [tested]
StephanTLavavej Apr 29, 2024
0c4ed3a
Guard against locally running provision-image.ps1. [tested]
StephanTLavavej May 6, 2024
1722de0
Skip a blank line emitted by `cmd /c ver`. [tested]
StephanTLavavej May 6, 2024
bc1e348
Set `pwsh: true`. [tested]
StephanTLavavej Apr 28, 2024
c1c61c8
GH 4632 Submodule checkout failure should short-circuit checks [tested]
StephanTLavavej Apr 28, 2024
86b9599
Retry submodule checkout up to 4 times. [tested]
StephanTLavavej Apr 28, 2024
9d84558
checkout-submodule.yml: Use case-sensitive `-creplace` and `-ceq`. [t…
StephanTLavavej May 6, 2024
8c38eb2
Style: Wrap Restart-AzVM arguments. [tested]
StephanTLavavej Apr 28, 2024
a58d72e
Move `Get-AzVM` up so we can use `$VM.ID` earlier. [tested]
StephanTLavavej Apr 28, 2024
578d523
Inline away the `Wait-Shutdown` function. [tested]
StephanTLavavej Apr 28, 2024
d6bb0bc
Consistently use `$VM.ID`. [tested]
StephanTLavavej Apr 28, 2024
85f3811
Run sysprep with `-ScriptString`. [tested]
StephanTLavavej Apr 29, 2024
6c2dbfc
Style: For `New-AzVMConfig`, use `-VMName` instead of the alias `-Nam…
StephanTLavavej Apr 29, 2024
0a8f3d8
`New-AzVm` defaults to Trusted Launch as of Azure PowerShell 11.0.0 (…
StephanTLavavej Apr 29, 2024
c05e773
Give `validationBuildOutputLocation` a dedicated name, and clean it. …
StephanTLavavej Apr 29, 2024
3ca0599
Inline create-prdiff.ps1, part 1. [tested]
StephanTLavavej May 1, 2024
0efc9fa
Inline create-prdiff.ps1, part 2. [tested]
StephanTLavavej May 1, 2024
0309468
Inline create-prdiff.ps1, part 3. [tested]
StephanTLavavej May 1, 2024
dbc9096
Inline create-prdiff.ps1, part 4. [tested]
StephanTLavavej May 1, 2024
58d93d1
Inline create-prdiff.ps1, part 5. [tested]
StephanTLavavej May 1, 2024
4a3ac81
Inline create-prdiff.ps1, part 6. [tested]
StephanTLavavej May 6, 2024
c87c0d2
Improve provision-image.ps1's synopsis/description. [comment only]
StephanTLavavej May 6, 2024
3c8db26
Require Node.js 22.2.0.
StephanTLavavej Apr 29, 2024
659aeae
New pool.
StephanTLavavej May 22, 2024
9c345ae
VS 2022 17.11 Preview 1.
StephanTLavavej May 22, 2024
b779f79
Remove compiler warning suppressions.
StephanTLavavej May 22, 2024
f0852aa
Work around VSO-2064546 "EDG ICE when deriving from std::num_get".
StephanTLavavej May 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/update-status-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ">=21.7.1"
node-version: ">=22.2.0"
- 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 @@ -141,7 +141,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.10 Preview 4 or later.
1. Install Visual Studio 2022 17.11 Preview 1 or later.
* Select "Windows 11 SDK (10.0.22621.0)" in the VS Installer.
* 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.
Expand All @@ -156,7 +156,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.10 Preview 4 or later.
1. Install Visual Studio 2022 17.11 Preview 1 or later.
* Select "Windows 11 SDK (10.0.22621.0)" in the VS Installer.
* 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.
Expand Down
7 changes: 5 additions & 2 deletions azure-devops/checkout-submodule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,22 @@ steps:
- task: PowerShell@2
displayName: 'Checkout ${{ parameters.path }} Submodule'
condition: and(succeeded(), ${{ parameters.enabled }})
retryCountOnTaskFailure: 4
inputs:
pwsh: true
targetType: inline
script: |
$PSNativeCommandUseErrorActionPreference = $true
$submodule = '${{ parameters.path }}'
$rawStatus = git submodule status --cached $submodule
$sha = $rawStatus -replace '^[ \-+]([0-9a-f]+) .*$', '$1'
$sha = $rawStatus -creplace '^[ \-+]([0-9a-f]+) .*$', '$1'
cd $submodule
git init
if ((git remote) -eq $null) {
git remote add submodule-upstream ${{ parameters.url }}
}
git fetch --filter=tree:0 --depth=1 submodule-upstream $sha
if ($submodule -eq 'llvm-project') {
if ($submodule -ceq 'llvm-project') {
git sparse-checkout set --sparse-index libcxx/test libcxx/utils/libcxx llvm/utils/lit
}
git reset --quiet --hard FETCH_HEAD
Expand Down
5 changes: 4 additions & 1 deletion azure-devops/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

variables:
- name: poolName
value: 'StlBuild-2024-04-17T1257-Pool'
value: 'StlBuild-2024-05-21T1719-Pool'
readonly: true
- name: poolDemands
value: 'EnableSpotVM -equals false'
Expand All @@ -19,6 +19,9 @@ variables:
- name: benchmarkBuildOutputLocation
value: 'D:\benchmark'
readonly: true
- name: validationBuildOutputLocation
value: 'D:\validation'
readonly: true
- name: Codeql.SkipTaskAutoInjection
value: true
readonly: true
Expand Down
88 changes: 29 additions & 59 deletions azure-devops/create-1es-hosted-pool.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -70,36 +70,6 @@ function New-Password {
return $result
}

<#
.SYNOPSIS
Waits for the shutdown of the specified resource.

.DESCRIPTION
Wait-Shutdown takes a VM, and checks if there's a 'PowerState/stopped'
code; if there is, it returns. If there isn't, it waits 10 seconds and
tries again.

.PARAMETER ResourceGroupName
The name of the resource group to look up the VM in.

.PARAMETER Name
The name of the virtual machine to wait on.
#>
function Wait-Shutdown {
[CmdletBinding(PositionalBinding=$false)]
Param(
[Parameter(Mandatory)][string]$ResourceGroupName,
[Parameter(Mandatory)][string]$Name
)

Write-Host "Waiting for $Name to stop..."
$StoppedCode = 'PowerState/stopped'
while ($StoppedCode -notin (Get-AzVM -ResourceGroupName $ResourceGroupName -Name $Name -Status).Statuses.Code) {
Write-Host '... not stopped yet, sleeping for 10 seconds'
Start-Sleep -Seconds 10
}
}

####################################################################################################
Display-ProgressBar -Status 'Silencing breaking change warnings'

Expand Down Expand Up @@ -169,7 +139,7 @@ Display-ProgressBar -Status 'Creating prototype VM'

# Previously: -Priority 'Spot'
$VM = New-AzVMConfig `
-Name $ProtoVMName `
-VMName $ProtoVMName `
-VMSize $VMSize `
-Priority 'Regular'

Expand All @@ -195,79 +165,79 @@ $VM = Set-AzVMBootDiagnostic `
-VM $VM `
-Disable

$VM = Set-AzVMSecurityProfile `
-VM $VM `
-SecurityType 'TrustedLaunch'

$VM = Set-AzVMUefi `
-VM $VM `
-EnableVtpm $true `
-EnableSecureBoot $true

New-AzVm `
-ResourceGroupName $ResourceGroupName `
-Location $Location `
-VM $VM | Out-Null

$VM = Get-AzVM `
-ResourceGroupName $ResourceGroupName `
-Name $ProtoVMName

$PrototypeOSDiskName = $VM.StorageProfile.OsDisk.Name

####################################################################################################
Display-ProgressBar -Status 'Running provision-image.ps1 in VM'

$ProvisionImageResult = Invoke-AzVMRunCommand `
-ResourceGroupName $ResourceGroupName `
-VMName $ProtoVMName `
-ResourceId $VM.ID `
-CommandId 'RunPowerShellScript' `
-ScriptPath "$PSScriptRoot\provision-image.ps1"

Write-Host $ProvisionImageResult.value.Message

if ($ProvisionImageResult.value.Message -cnotmatch 'PROVISION_IMAGE_SUCCEEDED') {
Write-Host 'provision-image.ps1 failed, stopping VM...'

Stop-AzVM `
-Id $VM.ID `
-Force | Out-Null

Write-Error "VM stopped. Remember to delete unusable resource group: $ResourceGroupName"
}

####################################################################################################
Display-ProgressBar -Status 'Restarting VM'

Restart-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName | Out-Null
Restart-AzVM `
-Id $VM.ID | Out-Null

####################################################################################################
Display-ProgressBar -Status 'Sleeping after restart'

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

####################################################################################################
Display-ProgressBar -Status 'Running sysprep.ps1 in VM'
Display-ProgressBar -Status 'Running sysprep in VM'

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

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

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

####################################################################################################
Display-ProgressBar -Status 'Stopping VM'

Stop-AzVM `
-ResourceGroupName $ResourceGroupName `
-Name $ProtoVMName `
-Id $VM.ID `
-Force | Out-Null

####################################################################################################
Display-ProgressBar -Status 'Generalizing VM'

Set-AzVM `
-ResourceGroupName $ResourceGroupName `
-Name $ProtoVMName `
-Id $VM.ID `
-Generalized | Out-Null

$VM = Get-AzVM `
-ResourceGroupName $ResourceGroupName `
-Name $ProtoVMName

$PrototypeOSDiskName = $VM.StorageProfile.OsDisk.Name

####################################################################################################
Display-ProgressBar -Status 'Creating gallery'

Expand Down
37 changes: 0 additions & 37 deletions azure-devops/create-prdiff.ps1

This file was deleted.

47 changes: 42 additions & 5 deletions azure-devops/format-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,67 @@ jobs:
steps:
- template: checkout-self.yml
- script: |
if exist "$(validationBuildOutputLocation)" (
rmdir /S /Q "$(validationBuildOutputLocation)"
)
call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^
-host_arch=x64 -arch=x64 -no_logo
cmake -G Ninja -S $(Build.SourcesDirectory)/tools -B $(tmpDir)/format-validate-build
cmake --build $(tmpDir)/format-validate-build
cmake -G Ninja -S $(Build.SourcesDirectory)/tools -B "$(validationBuildOutputLocation)"
cmake --build "$(validationBuildOutputLocation)"
displayName: 'Build format and validation'
timeoutInMinutes: 5
env: { TMP: $(tmpDir), TEMP: $(tmpDir) }
- script: |
call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^
-host_arch=x64 -arch=x64 -no_logo
cmake --build $(tmpDir)/format-validate-build --target run-format
cmake --build "$(validationBuildOutputLocation)" --target run-format
displayName: 'clang-format Files'
timeoutInMinutes: 5
env: { TMP: $(tmpDir), TEMP: $(tmpDir) }
- script: |
call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^
-host_arch=x64 -arch=x64 -no_logo
cmake --build $(tmpDir)/format-validate-build --target run-validate
cmake --build "$(validationBuildOutputLocation)" --target run-validate
displayName: 'Validate Files'
timeoutInMinutes: 2
env: { TMP: $(tmpDir), TEMP: $(tmpDir) }
- task: PowerShell@2
displayName: 'Create Diff'
inputs:
filePath: azure-devops/create-prdiff.ps1
pwsh: true
targetType: inline
script: |
$TempSubDir = Join-Path ([System.IO.Path]::GetTempPath()) ([System.IO.Path]::GetRandomFileName())
mkdir $TempSubDir -Force | Out-Null
$DiffFile = Join-Path $TempSubDir 'format.diff'
git diff --ignore-submodules > $DiffFile
if ((Get-Item -LiteralPath $DiffFile).Length -ne 0) {
$message = @(
'##vso[task.logissue type=error]The files in the repo need to be properly formatted.'
''
'##[section]To fix this, you can clang-format the entire repo with:'
' cmake --preset x64'
' cmake --build --preset x64 --target format'
''
'##[section]Please avoid this in the future by configuring your editor to format-on-save.'
''
'##[section]View expected formatting:'
'##[group] >>>>> Click this line to expand the diff: <<<<<'
Get-Content -LiteralPath $DiffFile -Raw
'##[endgroup]'
''
'##[section]You can also download this as format.diff and apply it with `git apply`:'
' 1. Click the failed Validation job (upper left, marked with a red X)'
' 2. Click "1 artifact produced"'
' 3. Click the ">" chevron to the left of "format-artifact"'
' 4. Hover over "format.diff"'
' 5. Click the three dots that appear on the right'
' 6. Click "Download artifacts"'
''
"##vso[artifact.upload artifactname=format-artifact]$DiffFile"
'##vso[task.complete result=Failed]'
)
Write-Host ($message -join "`n")
}
condition: succeededOrFailed()
env: { TMP: $(tmpDir), TEMP: $(tmpDir) }
Loading