Improved the reliability of the submodule checkout task.
Improved how clang-format diffs are uploaded and logged.
Updated dependencies.
Updated build compiler to VS 2022 17.11 Preview 1.
:gear: Azure Pipelines Commits
Followup to #4594. I manually tested all of the success and failure scenarios for these commits.
Detect provision-image.ps1 failure.
This fixes a major headache in the toolset update process. Previously, if provision-image.ps1 failed while downloading and installing components on the VM, it would stop, but create-1es-hosted-pool.ps1 would keep going on the maintainer's machine, creating a totally doomed pool. When failure occurs, Invoke-AzVMRunCommand doesn't indicate that, so I have a simple strategy - have the VM script print a special message for success, then have the maintainer script search for that message.
Use case-sensitive matching for 'PROVISION_IMAGE_SUCCEEDED'.
Permanently install PowerShell 7.4.2.
We'll need this for the following commits.
We need to preserve the original filename 'PowerShell-7.4.2-win-x64.msi' instead of generating 'RANDOM.exe', otherwise we won't be able to run it.
This means that provision-image.ps1 no longer attempts an "in-place upgrade" of the PowerShell version that's running it. This significantly simplifies the script, and we don't need any PowerShell 7.x features here.
Download installers to D:\installerTemp.
CUDA is 3 GB, so this may be helpful to make the script run faster.
On the VM, D: is fast temporary storage.
Guard against locally running provision-image.ps1.
I've never made this mistake, but let's make sure it never happens for any maintainers or contributors. (Obviously, checking for the computer being named 'PROTOTYPE' isn't absolutely perfect, but it's the simplest way to recognize the VM.)
This uses a case-sensitive comparison; the default is case-insensitive.
Skip a blank line emitted by cmd /c ver.
Set pwsh: true.
Needed for the following commit. I'm changing the 'Create Diff' task for consistency.
This should essentially fix one of the biggest remaining causes of sporadic PR/CI failure.
The release notes said "The failing task is retried immediately" but I now observe quadratic backoff, waiting 1, 4, 9 seconds (which is better than immediate).
checkout-submodule.yml: Use case-sensitive -creplace and -ceq.
git submodule status emits lowercase hexits, and we pass lowercase 'llvm-project'.
Although PowerShell defaults to case-insensitive, choosing case-sensitive for string operations should align with C++ expectations and avoid surprises.
Style: Wrap Restart-AzVM arguments.
Move Get-AzVM up so we can use $VM.ID earlier.
$VM.ID and $VM.StorageProfile.OsDisk.Name are unchanged between these locations.
Calling Get-AzVM is necessary; the return value of New-AzVm isn't useful.
Inline away the Wait-Shutdown function.
The progress bar message makes the Write-Host messages unnecessary.
-ResourceId $VM.ID is much shorter than -ResourceGroupName $ResourceGroupName -Name $Name, allowing us to directly say 'PowerState/stopped' without wrapping.
The original implementation in #633 (named Start-WaitForShutdown) was verbose, justifying a separate function, but now a direct loop is clearer.
Consistently use $VM.ID.
Run sysprep with -ScriptString.
$ErrorActionPreference wasn't useful because sysprep is a native command.
Write-Host wasn't useful because we aren't printing the message returned by Invoke-AzVMRunCommand.
The PowerShell call operator & wasn't useful because we aren't expanding any variables here.
In addition to being slightly simpler, this avoids having a script file that someone might try to run.
Style: For New-AzVMConfig, use -VMName instead of the alias -Name.
:scroll: Changelog
:gear: Azure Pipelines Commits
Followup to #4594. I manually tested all of the success and failure scenarios for these commits.
Invoke-AzVMRunCommand
doesn't indicate that, so I have a simple strategy - have the VM script print a special message for success, then have the maintainer script search for that message.'PROVISION_IMAGE_SUCCEEDED'
.'PowerShell-7.4.2-win-x64.msi'
instead of generating'RANDOM.exe'
, otherwise we won't be able to run it.D:\installerTemp
.D:
is fast temporary storage.'PROTOTYPE'
isn't absolutely perfect, but it's the simplest way to recognize the VM.)cmd /c ver
.pwsh: true
.$PSNativeCommandUseErrorActionPreference
: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-7.4#psnativecommanduseerroractionpreference-creplace
and-ceq
.git submodule status
emits lowercase hexits, and we pass lowercase'llvm-project'
.Restart-AzVM
arguments.Get-AzVM
up so we can use$VM.ID
earlier.$VM.ID
and$VM.StorageProfile.OsDisk.Name
are unchanged between these locations.Get-AzVM
is necessary; the return value ofNew-AzVm
isn't useful.Wait-Shutdown
function.Write-Host
messages unnecessary.-ResourceId $VM.ID
is much shorter than-ResourceGroupName $ResourceGroupName -Name $Name
, allowing us to directly say'PowerState/stopped'
without wrapping.Start-WaitForShutdown
) was verbose, justifying a separate function, but now a direct loop is clearer.$VM.ID
.-ScriptString
.$ErrorActionPreference
wasn't useful because sysprep is a native command.Write-Host
wasn't useful because we aren't printing the message returned byInvoke-AzVMRunCommand
.&
wasn't useful because we aren't expanding any variables here.New-AzVMConfig
, use-VMName
instead of the alias-Name
.New-AzVm
defaults to Trusted Launch as of Azure PowerShell 11.0.0 (November 2023).validationBuildOutputLocation
a dedicated name, and clean it.$DiffFile
was never passed as an argument, so set it as an ordinary variable.>
instead ofStart-Process
.git diff
output.:toolbox: Toolset Update Commits
std::num_get
".STL-ASan-CI passed.