Skip to content

Commit 7076842

Browse files
[NativeAOT-LLVM] Add linux-arm64 build and testing (#3115)
* Reorganize how the testing is switched on The goal is to get rid of switches on specific platforms. * Add linux-arm64 build and testing * Delete a leftover file
1 parent 1d31363 commit 7076842

19 files changed

+136
-103
lines changed

eng/liveBuilds.targets

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
does not scale for local development because it requires you to build the same host tools for each target configuration.
3333
E. g. you need to build the same Debug compiler 3 times if you want to compile code in Debug, Checked and Release. -->
3434
<IlcConfig Condition="'$(IlcConfig)' == ''">$(CoreCLRConfiguration)</IlcConfig>
35-
<CoreCLRCrossILCompilerDir Condition="'$(CoreCLRCrossILCompilerDir)' != '' and '$(TargetsWasm)' == 'true'">$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts', 'bin', 'coreclr', '$(HostOS).$(BuildArchitecture).$(IlcConfig)', 'ilc'))</CoreCLRCrossILCompilerDir>
35+
<IlcHostArch Condition="'$(IlcHostArch)' == ''">$(BuildArchitecture)</IlcHostArch>
36+
<CoreCLRCrossILCompilerDir Condition="'$(CoreCLRCrossILCompilerDir)' != '' and '$(TargetsWasm)' == 'true'">$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts', 'bin', 'coreclr', '$(HostOS).$(IlcHostArch).$(IlcConfig)', 'ilc'))</CoreCLRCrossILCompilerDir>
3637

3738
<Crossgen2Dir>$([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'crossgen2-published'))</Crossgen2Dir>
3839
<Crossgen2InBuildDir>$([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', '$(BuildArchitecture)', 'crossgen2'))</Crossgen2InBuildDir>

eng/native/gen-buildsys.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ fi
9797
cmake_extra_defines_wasm=()
9898
if [[ "$host_arch" == "wasm" ]]; then
9999
if [[ "$target_os" == "browser" ]]; then
100+
export EMSDK_QUIET=1 && source $EMSDK/emsdk_env.sh
100101
cmake_command="emcmake $cmake_command"
101102
elif [[ "$target_os" == "wasi" ]]; then
102103
if [[ -z $WASI_SDK_PATH ]]; then

eng/pipelines/common/global-build-job.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,19 +207,19 @@ jobs:
207207
- ${{ if ne(parameters.hostedOs, 'windows') }}:
208208
- script: /tmp/docker exec -t -u 0 naot-llvm-ci-container sh -c "tdnf install -y sudo"
209209
displayName: Install sudo
210-
- script: $(Build.SourcesDirectory)/eng/pipelines/runtimelab/install-build-and-test-tools.sh $(Build.SourcesDirectory)/wasm-tools
210+
- script: $(Build.SourcesDirectory)/eng/pipelines/runtimelab/install-build-and-test-tools.sh
211211
displayName: Install NativeAOT-LLVM build and test tools
212212
- script: pwsh $(Build.SourcesDirectory)/eng/pipelines/runtimelab/install-emscripten.ps1 $(Build.SourcesDirectory)/wasm-tools -CI
213213
displayName: Install/activate emscripten
214214
- ${{ if eq(parameters.hostedOs, 'windows') }}:
215215
- script: call $(Build.SourcesDirectory)/eng/pipelines/runtimelab/set-cmake-path.cmd
216216
displayName: Set CMake path
217-
- script: pwsh $(Build.SourcesDirectory)/eng/pipelines/runtimelab/install-llvm.ps1 -CloneDir $(Build.SourcesDirectory)/wasm-tools -Configs ${{ parameters.buildConfig }} -CI
217+
- script: pwsh $(Build.SourcesDirectory)/eng/pipelines/runtimelab/install-llvm.ps1 -CloneDir $(Build.SourcesDirectory)/wasm-tools -Configs $(_BuildConfig) -Arch $(hostedTargetArch) -CI
218218
displayName: Install/build LLVM
219219
- script: pwsh $(Build.SourcesDirectory)/eng/pipelines/runtimelab/install-nodejs.ps1 $(Build.SourcesDirectory)/wasm-tools
220220
displayName: Install NodeJS
221221

222-
- ${{ if and(eq(parameters.runtimeFlavor, 'coreclr'), or(eq(parameters.platform, 'wasi_wasm_win'), eq(parameters.platform, 'wasi_wasm_linux_x64_naot_llvm'))) }}:
222+
- ${{ if and(eq(parameters.runtimeFlavor, 'coreclr'), eq(parameters.osGroup, 'wasi')) }}:
223223
# Install Wasi Wasm dependencies: wasi-sdk, wasmtime
224224
- script: pwsh $(Build.SourcesDirectory)/eng/pipelines/runtimelab/install-wasi-sdk.ps1 -CI -InstallDir $(Build.SourcesDirectory)/wasm-tools
225225
displayName: Install wasi-sdk
@@ -228,7 +228,7 @@ jobs:
228228
- script: pwsh $(Build.SourcesDirectory)/eng/pipelines/runtimelab/install-jco.ps1 $(Build.SourcesDirectory)
229229
displayName: Install Jco
230230

231-
- ${{ if or(eq(parameters.platform, 'browser_wasm_win'), and(eq(parameters.platform, 'wasi_wasm_win'), not(eq(parameters.runtimeFlavor, 'coreclr')))) }}:
231+
- ${{ if and(eq(parameters.hostedOs, 'windows'), eq(parameters.archType, 'wasm')) }}:
232232
# Update machine certs
233233
- task: PowerShell@2
234234
displayName: Update machine certs

eng/pipelines/common/platform-matrix.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -500,10 +500,10 @@ jobs:
500500
buildConfig: ${{ parameters.buildConfig }}
501501
${{ insert }}: ${{ parameters.jobParameters }}
502502

503-
# Browser WebAssembly Linux X64 for NAOT-LLVM
503+
# WebAssembly Linux for NAOT-LLVM
504504
# Use a different name to differentiate from upstream as we need the -sanitizer image to get build tools that are not present in the stock browser_wasm image.
505505

506-
- ${{ if containsValue(parameters.platforms, 'Browser_wasm_linux_x64_naot_llvm') }}:
506+
- ${{ if containsValue(parameters.platforms, 'browser_wasm_linux_x64_naot_llvm') }}:
507507
- template: xplat-setup.yml
508508
parameters:
509509
jobTemplate: ${{ parameters.jobTemplate }}
@@ -512,19 +512,16 @@ jobs:
512512
osGroup: browser
513513
archType: wasm
514514
targetRid: browser-wasm
515-
platform: Browser_wasm_linux_x64_naot_llvm
515+
platform: browser_wasm_linux_x64_naot_llvm
516516
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
517-
container: linux_x64_sanitizer_naot_llvm
517+
container: linux_x64_naot_llvm
518518
jobParameters:
519519
hostedOs: linux
520520
runtimeFlavor: ${{ parameters.runtimeFlavor }}
521521
stagedBuild: ${{ parameters.stagedBuild }}
522522
buildConfig: ${{ parameters.buildConfig }}
523523
${{ insert }}: ${{ parameters.jobParameters }}
524524

525-
# WASI WebAssembly Linux X64 for NAOT-LLVM
526-
# Use a different name to differentiate from upstream as we need the -sanitizer image to get build tools that are not present in the stock wasi-wasm image.
527-
528525
- ${{ if containsValue(parameters.platforms, 'wasi_wasm_linux_x64_naot_llvm') }}:
529526
- template: xplat-setup.yml
530527
parameters:
@@ -536,9 +533,30 @@ jobs:
536533
targetRid: wasi-wasm
537534
platform: wasi_wasm_linux_x64_naot_llvm
538535
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
539-
container: linux_x64_sanitizer_naot_llvm
536+
container: linux_x64_naot_llvm
537+
jobParameters:
538+
hostedOs: linux
539+
runtimeFlavor: ${{ parameters.runtimeFlavor }}
540+
stagedBuild: ${{ parameters.stagedBuild }}
541+
buildConfig: ${{ parameters.buildConfig }}
542+
${{ insert }}: ${{ parameters.jobParameters }}
543+
544+
- ${{ if containsValue(parameters.platforms, 'browser_wasm_linux_arm64_naot_llvm') }}:
545+
- template: xplat-setup.yml
546+
parameters:
547+
jobTemplate: ${{ parameters.jobTemplate }}
548+
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
549+
variables: ${{ parameters.variables }}
550+
osGroup: browser
551+
archType: wasm
552+
targetRid: browser-wasm
553+
platform: browser_wasm_linux_arm64_naot_llvm
554+
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
555+
container: linux_arm64_naot_llvm
540556
jobParameters:
541557
hostedOs: linux
558+
hostedTargetArch: arm64
559+
nameSuffix: arm64
542560
runtimeFlavor: ${{ parameters.runtimeFlavor }}
543561
stagedBuild: ${{ parameters.stagedBuild }}
544562
buildConfig: ${{ parameters.buildConfig }}

eng/pipelines/common/templates/pipeline-with-resources.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,19 @@ extends:
8282
# We need to be able to use 'tdnf install'. We can't because of https://github.com/dotnet/dotnet-docker/issues/788.
8383
# This is the hackaround: https://github.com/microsoft/azure-pipelines-agent/issues/2043#issuecomment-489692810.
8484
# TODO-LLVM-Upstream: replace with an image that has our prerequisites (LLDB) already installed.
85-
linux_x64_sanitizer_naot_llvm:
86-
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-amd64-sanitizer
85+
linux_x64_naot_llvm:
86+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-cross-amd64-sanitizer
8787
options: '--name naot-llvm-ci-container -v /usr/bin/docker:/tmp/docker:ro'
8888
env:
8989
ROOTFS_DIR: /crossrootfs/x64
9090

91+
# For arm64, we need to install QEMU.
92+
linux_arm64_naot_llvm:
93+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-cross-arm64
94+
options: '--name naot-llvm-ci-container -v /usr/bin/docker:/tmp/docker:ro'
95+
env:
96+
ROOTFS_DIR: /crossrootfs/arm64
97+
9198
# We use a CentOS Stream 8 image here to test building from source on CentOS Stream 9.
9299
SourceBuild_centos_x64:
93100
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9

eng/pipelines/common/xplat-setup.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ jobs:
5252
- name: osSubgroup
5353
value: ${{ parameters.osSubgroup }}
5454

55+
- name: hostedTargetArch
56+
${{ if ne(parameters.jobParameters.hostedTargetArch, '') }}:
57+
value: ${{ parameters.jobParameters.hostedTargetArch }}
58+
${{ else }}:
59+
value: x64
60+
5561
- name: _runSmokeTestsOnlyArg
5662
value: '/p:RunSmokeTestsOnly=$(isRunSmokeTestsOnly)'
5763

eng/pipelines/runtimelab-official.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ extends:
3838
platforms:
3939
- browser_wasm_win
4040
- wasi_wasm_win
41-
- Browser_wasm_linux_x64_naot_llvm
41+
- browser_wasm_linux_x64_naot_llvm
4242
jobParameters:
4343
templatePath: 'templates-official'
4444
timeoutInMinutes: 300

eng/pipelines/runtimelab.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ extends:
6161
- windows_x64
6262
- browser_wasm_win
6363
- wasi_wasm_win
64-
- Browser_wasm_linux_x64_naot_llvm
64+
- browser_wasm_linux_x64_naot_llvm
6565
- wasi_wasm_linux_x64_naot_llvm
6666
jobParameters:
6767
timeoutInMinutes: 300
@@ -101,10 +101,11 @@ extends:
101101
- linux_x64
102102
- osx_x64
103103
- windows_x64
104-
- Browser_wasm_win
104+
- browser_wasm_win
105105
- wasi_wasm_win
106+
- browser_wasm_linux_x64_naot_llvm
106107
- wasi_wasm_linux_x64_naot_llvm
107-
- Browser_wasm_linux_x64_naot_llvm
108+
- browser_wasm_linux_arm64_naot_llvm
108109
jobParameters:
109110
timeoutInMinutes: 300
110111
buildArgs: -s clr.aot+libs -c $(_BuildConfig)
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/usr/bin/env bash
22
set -e
3-
dir=$(dirname "$0")
4-
echo; $dir/install-python.sh
5-
echo; $dir/install-lldb.sh
3+
4+
echo Setting EMSDK_PYTHON to /usr/bin/python3
5+
echo '##vso[task.setvariable variable=EMSDK_PYTHON]'/usr/bin/python3
6+
echo
7+
8+
echo Installing LLDB, QEMU
9+
sudo tdnf install -y lldb python3-lldb qemu-user
10+
echo

eng/pipelines/runtimelab/install-lldb.sh

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

0 commit comments

Comments
 (0)