Skip to content

Commit e21d834

Browse files
Add ARM64 runtime test coverage (#5815)
1 parent e91e27b commit e21d834

File tree

5 files changed

+77
-34
lines changed

5 files changed

+77
-34
lines changed

azure-devops/config.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ variables:
77
- name: poolName
88
value: 'Stl-2025-10-14T1635-x64-Pool'
99
readonly: true
10+
- name: arm64PoolName
11+
value: 'Stl-2025-10-27T1519-arm64-Pool'
12+
readonly: true
1013
- name: poolDemands
1114
value: 'EnableSpotVM -equals false'
1215
readonly: true
1316
- name: vsDevCmdBat
14-
value: '%ProgramFiles%\Microsoft Visual Studio\18\Insiders\Common7\Tools\VsDevCmd.bat'
17+
value: 'C:\Program Files\Microsoft Visual Studio\18\Insiders\Common7\Tools\VsDevCmd.bat'
1518
readonly: true
1619
- name: tmpDir
1720
value: 'C:\stlTemp'

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

Lines changed: 56 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,35 @@ Creates a 1ES Hosted Pool, set up for the STL's CI.
77
88
.DESCRIPTION
99
See https://github.com/microsoft/STL/wiki/Checklist-for-Toolset-Updates for more information.
10+
11+
.PARAMETER Arch
12+
The architecture can be either x64 or arm64.
1013
#>
14+
[CmdletBinding(PositionalBinding=$false)]
15+
Param(
16+
[Parameter(Mandatory)][ValidateSet('x64', 'arm64')][String]$Arch
17+
)
1118

1219
$ErrorActionPreference = 'Stop'
1320

1421
$CurrentDate = Get-Date
1522
$Timestamp = $CurrentDate.ToString('yyyy-MM-ddTHHmm')
16-
$Arch = 'x64'
1723

1824
$Location = 'eastus2'
19-
$VMSize = 'Standard_F32as_v6'
20-
$PoolSize = 64
25+
26+
if ($Arch -ieq 'x64') {
27+
$VMSize = 'Standard_F32as_v6'
28+
$PoolSize = 64
29+
$ImagePublisher = 'MicrosoftWindowsServer'
30+
$ImageOffer = 'WindowsServer'
31+
$ImageSku = '2025-datacenter-azure-edition'
32+
} else {
33+
$VMSize = 'Standard_D32ps_v6'
34+
$PoolSize = 32
35+
$ImageId = '/SharedGalleries/WindowsServer.1P/Images/2025-datacenter-azure-edition-arm64/Versions/latest'
36+
}
37+
2138
$ProtoVMName = 'PROTOTYPE'
22-
$ImagePublisher = 'MicrosoftWindowsServer'
23-
$ImageOffer = 'WindowsServer'
24-
$ImageSku = '2025-datacenter-azure-edition'
2539

2640
$LogFile = "1es-hosted-pool-$Timestamp-$Arch.log"
2741
$ProgressActivity = 'Preparing STL CI pool'
@@ -178,12 +192,21 @@ $Nic = New-AzNetworkInterface `
178192
####################################################################################################
179193
Display-ProgressBar -Status 'Creating prototype VM config'
180194

181-
# Previously: -Priority 'Spot'
182-
$VM = New-AzVMConfig `
183-
-VMName $ProtoVMName `
184-
-VMSize $VMSize `
185-
-DiskControllerType 'NVMe' `
186-
-Priority 'Regular'
195+
if ($Arch -ieq 'x64') {
196+
$VM = New-AzVMConfig `
197+
-VMName $ProtoVMName `
198+
-VMSize $VMSize `
199+
-DiskControllerType 'NVMe' `
200+
-Priority 'Regular'
201+
} else {
202+
$VM = New-AzVMConfig `
203+
-VMName $ProtoVMName `
204+
-VMSize $VMSize `
205+
-DiskControllerType 'SCSI' `
206+
-Priority 'Regular' `
207+
-SecurityType 'TrustedLaunch' `
208+
-SharedGalleryImageId $ImageId
209+
}
187210

188211
####################################################################################################
189212
Display-ProgressBar -Status 'Setting prototype VM OS'
@@ -205,12 +228,16 @@ $VM = Add-AzVMNetworkInterface `
205228
####################################################################################################
206229
Display-ProgressBar -Status 'Setting prototype VM source image'
207230

208-
$VM = Set-AzVMSourceImage `
209-
-VM $VM `
210-
-PublisherName $ImagePublisher `
211-
-Offer $ImageOffer `
212-
-Skus $ImageSku `
213-
-Version 'latest'
231+
if ($Arch -ieq 'x64') {
232+
$VM = Set-AzVMSourceImage `
233+
-VM $VM `
234+
-PublisherName $ImagePublisher `
235+
-Offer $ImageOffer `
236+
-Skus $ImageSku `
237+
-Version 'latest'
238+
} else {
239+
# We passed -SharedGalleryImageId to New-AzVMConfig above.
240+
}
214241

215242
####################################################################################################
216243
Display-ProgressBar -Status 'Setting prototype VM boot diagnostic'
@@ -242,7 +269,8 @@ Display-ProgressBar -Status 'Running provision-image.ps1 in VM'
242269
$ProvisionImageResult = Invoke-AzVMRunCommand `
243270
-ResourceId $VM.ID `
244271
-CommandId 'RunPowerShellScript' `
245-
-ScriptPath "$PSScriptRoot\provision-image.ps1"
272+
-ScriptPath "$PSScriptRoot\provision-image.ps1" `
273+
-Parameter @{ 'Arch' = $Arch; }
246274

247275
Write-Host $ProvisionImageResult.value.Message
248276

@@ -322,7 +350,11 @@ Display-ProgressBar -Status 'Creating image definition'
322350

323351
$ImageDefinitionName = "$ResourceGroupName-ImageDefinition"
324352
$FeatureTrustedLaunch = @{ Name = 'SecurityType'; Value = 'TrustedLaunch'; }
325-
$FeatureNVMe = @{ Name = 'DiskControllerTypes'; Value = 'SCSI, NVMe'; }
353+
if ($Arch -ieq 'x64') {
354+
$FeatureNVMe = @{ Name = 'DiskControllerTypes'; Value = 'SCSI, NVMe'; }
355+
} else {
356+
$FeatureNVMe = @{ Name = 'DiskControllerTypes'; Value = 'SCSI'; }
357+
}
326358
$ImageDefinitionFeatures = @($FeatureTrustedLaunch, $FeatureNVMe)
327359
New-AzGalleryImageDefinition `
328360
-Location $Location `
@@ -331,9 +363,10 @@ New-AzGalleryImageDefinition `
331363
-Name $ImageDefinitionName `
332364
-OsState 'Generalized' `
333365
-OsType 'Windows' `
334-
-Publisher $ImagePublisher `
335-
-Offer $ImageOffer `
336-
-Sku $ImageSku `
366+
-Publisher 'StlPublisher' `
367+
-Offer 'StlOffer' `
368+
-Sku 'StlSku' `
369+
-Architecture $Arch `
337370
-Feature $ImageDefinitionFeatures `
338371
-HyperVGeneration 'V2' >> $LogFile
339372

azure-devops/provision-image.ps1

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@ create-1es-hosted-pool.ps1 (running on an STL maintainer's machine) creates a "p
1010
then runs provision-image.ps1 on that VM. This gives us full control over what we install for building and testing
1111
the STL. After provision-image.ps1 is done, create-1es-hosted-pool.ps1 makes an image of the prototype VM,
1212
creates a 1ES Hosted Pool that will spin up copies of the image as worker VMs, and finally deletes the prototype VM.
13+
14+
.PARAMETER Arch
15+
The architecture can be either x64 or arm64.
1316
#>
17+
[CmdletBinding(PositionalBinding=$false)]
18+
Param(
19+
[Parameter(Mandatory)][ValidateSet('x64', 'arm64')][String]$Arch
20+
)
1421

1522
$ErrorActionPreference = 'Stop'
1623
$ProgressPreference = 'SilentlyContinue'
@@ -19,14 +26,12 @@ if ($Env:COMPUTERNAME -cne 'PROTOTYPE') {
1926
Write-Error 'You should not run provision-image.ps1 on your local machine.'
2027
}
2128

22-
if ($Env:PROCESSOR_ARCHITECTURE -ceq 'AMD64') {
29+
if ($Arch -ieq 'x64') {
2330
Write-Host 'Provisioning x64.'
2431
$Provisioning_x64 = $true
25-
} elseif ($Env:PROCESSOR_ARCHITECTURE -ceq 'ARM64') {
32+
} else {
2633
Write-Host 'Provisioning ARM64.'
2734
$Provisioning_x64 = $false
28-
} else {
29-
Write-Error "Unrecognized PROCESSOR_ARCHITECTURE: '$Env:PROCESSOR_ARCHITECTURE'"
3035
}
3136

3237
$VisualStudioWorkloads = @(
@@ -54,9 +59,9 @@ foreach ($workload in $VisualStudioWorkloads) {
5459

5560
# https://github.com/PowerShell/PowerShell/releases/latest
5661
if ($Provisioning_x64) {
57-
$PowerShellUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.5.3/PowerShell-7.5.3-win-x64.msi'
62+
$PowerShellUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.5.4/PowerShell-7.5.4-win-x64.msi'
5863
} else {
59-
$PowerShellUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.5.3/PowerShell-7.5.3-win-arm64.msi'
64+
$PowerShellUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.5.4/PowerShell-7.5.4-win-arm64.msi'
6065
}
6166
$PowerShellArgs = @('/quiet', '/norestart')
6267

azure-pipelines.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,15 @@ stages:
121121
dependsOn: Build_And_Test_x64
122122
displayName: 'Build and Test ARM64'
123123
pool:
124-
name: ${{ variables.poolName }}
124+
name: ${{ variables.arm64PoolName }}
125125
demands: ${{ variables.poolDemands }}
126126
jobs:
127127
- template: azure-devops/build-and-test.yml
128128
parameters:
129-
hostArch: x64
129+
hostArch: arm64
130130
targetArch: arm64
131131
targetPlatform: arm64
132-
testsBuildOnly: true
132+
numShards: 10
133133

134134
- stage: Build_And_Test_ARM64EC
135135
dependsOn: Build_And_Test_x64

tests/libcxx/expected_results.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,9 @@ std/depr/depr.c.headers/tgmath_h.pass.cpp:2 FAIL
734734

735735
# *** CLANG ISSUES, NOT YET ANALYZED ***
736736
# Not analyzed. Clang apparently defines platform macros differently from C1XX.
737-
std/language.support/support.limits/limits/numeric.limits.members/traps.pass.cpp:2 FAIL
737+
# The test inspects `__x86_64__` and `__i386__`, which MSVC doesn't define.
738+
# SKIPPED because this fails for x64/x86 and passes for ARM64.
739+
std/language.support/support.limits/limits/numeric.limits.members/traps.pass.cpp:2 SKIPPED
738740

739741
# Not analyzed. Possibly C++20 equality operator rewrite issues.
740742
std/utilities/expected/expected.expected/equality/equality.other_expected.pass.cpp:2 FAIL

0 commit comments

Comments
 (0)