From 640df60d36910d86691b9fbdb0aadb7724fa8493 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 5 May 2023 12:39:36 -0700 Subject: [PATCH] Run NativeAot tests on arm64 (#82307) Adds arm64 build and run of NativeAot smoke tests --- .../build-runtime-tests-and-send-to-helix.yml | 4 +--- .../coreclr/nativeaot-post-build-steps.yml | 14 +++++++------- eng/pipelines/runtime.yml | 5 ++++- src/tests/Directory.Build.targets | 1 + 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml b/eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml index f1073500a44f5..d7864c3cdc57a 100644 --- a/eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml +++ b/eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml @@ -31,14 +31,12 @@ parameters: steps: - ${{ if eq(parameters.osGroup, 'windows') }}: - - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) ci ${{ parameters.archType }} $(buildConfigUpper) $(priorityArg) $(runtimeFlavorArgs) ${{ parameters.testBuildArgs }} $(runtimeVariantArg) /p:LibrariesConfiguration=${{ coalesce(parameters.liveLibrariesBuildConfig, parameters.buildConfig) }} + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(crossArg) ci ${{ parameters.archType }} $(buildConfigUpper) $(priorityArg) $(runtimeFlavorArgs) ${{ parameters.testBuildArgs }} $(runtimeVariantArg) /p:LibrariesConfiguration=${{ coalesce(parameters.liveLibrariesBuildConfig, parameters.buildConfig) }} displayName: Build Tests - ${{ if ne(parameters.osGroup, 'windows') }}: - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(crossArg) ci os ${{ parameters.osGroup }} ${{ parameters.archType }} $(buildConfigUpper) $(priorityArg) $(runtimeFlavorArgs) ${{ parameters.testBuildArgs }} $(runtimeVariantArg) /p:LibrariesConfiguration=${{ coalesce(parameters.liveLibrariesBuildConfig, parameters.buildConfig) }} displayName: Build Tests - - # Build a Mono LLVM AOT cross-compiler for non-amd64 targets (in this case, just arm64) - ${{ if and(eq(parameters.runtimeFlavor, 'mono'), or(eq(parameters.runtimeVariant, 'llvmaot'), eq(parameters.runtimeVariant, 'llvmfullaot'))) }}: - ${{ if eq(parameters.archType, 'arm64') }}: diff --git a/eng/pipelines/coreclr/nativeaot-post-build-steps.yml b/eng/pipelines/coreclr/nativeaot-post-build-steps.yml index 491e663230fcb..c3d65b8281fd1 100644 --- a/eng/pipelines/coreclr/nativeaot-post-build-steps.yml +++ b/eng/pipelines/coreclr/nativeaot-post-build-steps.yml @@ -8,9 +8,6 @@ parameters: liveLibrariesBuildConfig: '' steps: -# Can't run arm/arm64 tests on x64 build machines -- ${{ if and(ne(parameters.archType, 'arm'), ne(parameters.archType, 'arm64')) }}: - # Build coreclr native test output and send to helix - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml parameters: @@ -25,7 +22,10 @@ steps: helixQueues: ${{ parameters.helixQueues }} liveLibrariesBuildConfig: ${{ parameters.liveLibrariesBuildConfig }} - # Publishing tooling doesn't support different configs between runtime and libs, so only run tests in Release config - - ${{ if eq(parameters.buildConfig, 'release') }}: - - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) -s libs.tests -c $(_BuildConfig) $(crossArg) /p:TestAssemblies=false /p:RunNativeAotTestApps=true $(_officialBuildParameter) /bl:$(Build.SourcesDirectory)/artifacts/log/$(buildConfigUpper)/NativeAotTests.binlog ${{ parameters.extraTestArgs }} - displayName: Run NativeAot Library Tests + # Can't run arm/arm64 tests on x64 build machines + - ${{ if and(ne(parameters.archType, 'arm'), ne(parameters.archType, 'arm64')) }}: + + # Publishing tooling doesn't support different configs between runtime and libs, so only run tests in Release config + - ${{ if eq(parameters.buildConfig, 'release') }}: + - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) -s libs.tests -c $(_BuildConfig) $(crossArg) /p:TestAssemblies=false /p:RunNativeAotTestApps=true $(_officialBuildParameter) /bl:$(Build.SourcesDirectory)/artifacts/log/$(buildConfigUpper)/NativeAotTests.binlog ${{ parameters.extraTestArgs }} + displayName: Run NativeAot Library Tests diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 4ad81e6c23d7b..36c91077c0b71 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -271,6 +271,9 @@ extends: - linux_x64 - windows_x64 - osx_x64 + - linux_arm64 + - windows_arm64 + - osx_arm64 variables: - name: timeoutPerTestInMinutes value: 60 @@ -313,7 +316,7 @@ extends: jobParameters: testGroup: innerloop isSingleFile: true - nameSuffix: NativeAOT + nameSuffix: NativeAOT_Libraries buildArgs: -s clr.aot+host.native+libs+libs.tests -c $(_BuildConfig) /p:TestNativeAot=true /p:RunSmokeTestsOnly=true /p:ArchiveTests=true timeoutInMinutes: 240 # Doesn't actually take long, but we've seen the ARM64 Helix queue often get backlogged for 2+ hours # extra steps, run tests diff --git a/src/tests/Directory.Build.targets b/src/tests/Directory.Build.targets index 098c7eac814c1..6a6bdcba99dfd 100644 --- a/src/tests/Directory.Build.targets +++ b/src/tests/Directory.Build.targets @@ -527,6 +527,7 @@ partial $(CoreCLRILCompilerDir) + $(CoreCLRCrossILCompilerDir) $(CoreCLRILCompilerDir)netstandard/ILCompiler.Build.Tasks.dll $(CoreCLRAotSdkDir) $(MicrosoftNetCoreAppRuntimePackRidLibTfmDir)