Skip to content

Commit

Permalink
Enable NativeAOT in the CI (#62833)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalStrehovsky committed Dec 16, 2021
1 parent d6d2e38 commit 7f57584
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 2 deletions.
35 changes: 35 additions & 0 deletions eng/pipelines/coreclr/nativeaot-post-build-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
parameters:
buildConfig: ''
archType: ''
osGroup: ''
osSubgroup: ''
platform: ''
pgoType: ''
runtimeVariant: ''
uploadTests: false
testFilter: tree nativeaot
runSingleFileTests: true

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
- ${{ if eq(parameters.osGroup, 'windows') }}:
- script: $(Build.SourcesDirectory)/src/tests/build.cmd nativeaot $(buildConfigUpper) ${{ parameters.archType }} ${{ parameters.testFilter }} /p:NativeAotMultimodule=true
displayName: Build tests
- ${{ if ne(parameters.osGroup, 'windows') }}:
- script: $(Build.SourcesDirectory)/src/tests/build.sh nativeaot $(buildConfigUpper) ${{ parameters.archType }} '${{ parameters.testFilter }}'
displayName: Build tests

- ${{ if eq(parameters.runSingleFileTests, true) }}:
- ${{ if eq(parameters.osGroup, 'windows') }}:
- script: $(Build.SourcesDirectory)/src/tests/run.cmd runnativeaottests $(buildConfigUpper) ${{ parameters.archType }}
displayName: Run tests in single file mode
- ${{ if ne(parameters.osGroup, 'windows') }}:
- script: $(Build.SourcesDirectory)/src/tests/run.sh --runnativeaottests $(buildConfigUpper) ${{ parameters.archType }}
displayName: Run tests in single file mode

- ${{ if eq(parameters.osGroup, 'windows') }}:
- script: $(Build.SourcesDirectory)/src/tests/run.sh runnativeaottests nativeaotmultimodule $(buildConfigUpper) ${{ parameters.archType }}
displayName: Run tests in multifile mode
69 changes: 69 additions & 0 deletions eng/pipelines/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,75 @@ jobs:
eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr_jit.containsChange'], true),
eq(variables['isFullMatrix'], true)))
#
# CoreCLR NativeAOT debug build and smoke tests
# Only when CoreCLR is changed
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
buildConfig: debug
platforms:
- Linux_x64
- windows_x64
jobParameters:
testGroup: innerloop
timeoutInMinutes: 120
nameSuffix: NativeAOT
buildArgs: -s clr.jit+clr.tools+clr.nativeaotlibs+libs -rc $(_BuildConfig) -lc Release
extraStepsTemplate: /eng/pipelines/coreclr/nativeaot-post-build-steps.yml
condition: >-
or(
eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
eq(variables['isFullMatrix'], true))
#
# CoreCLR NativeAOT checked build and smoke tests
# Only when CoreCLR is changed
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
buildConfig: checked
platforms:
- windows_x64
jobParameters:
testGroup: innerloop
timeoutInMinutes: 120
nameSuffix: NativeAOT
buildArgs: -s clr.jit+clr.tools+clr.nativeaotlibs+libs -rc $(_BuildConfig) -lc Release
extraStepsTemplate: /eng/pipelines/coreclr/nativeaot-post-build-steps.yml
condition: >-
or(
eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
eq(variables['isFullMatrix'], true))
#
# CoreCLR NativeAOT checked build and smoke tests
# Only when CoreCLR is changed
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
buildConfig: release
platforms:
- Linux_x64
- windows_x64
- OSX_x64
jobParameters:
testGroup: innerloop
timeoutInMinutes: 120
nameSuffix: NativeAOT
buildArgs: -s clr.jit+clr.tools+clr.nativeaotlibs+libs -rc $(_BuildConfig) -lc Release
extraStepsTemplate: /eng/pipelines/coreclr/nativeaot-post-build-steps.yml
condition: >-
or(
eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
eq(variables['isFullMatrix'], true))
# Build and test clr tools
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/nativeaot/Runtime/inc/ModuleHeaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct ReadyToRunHeaderConstants
{
static const uint32_t Signature = 0x00525452; // 'RTR'

static const uint32_t CurrentMajorVersion = 5;
static const uint32_t CurrentMajorVersion = 6;
static const uint32_t CurrentMinorVersion = 0;
};

Expand Down
9 changes: 8 additions & 1 deletion src/tests/Common/tests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,14 @@

<CorerunExecutable Condition="'$(RunningOnUnix)' == 'true'" >$(CORE_ROOT)\corerun</CorerunExecutable>
<CorerunExecutable Condition="'$(RunningOnUnix)' != 'true'">$(CORE_ROOT)\corerun.exe</CorerunExecutable>
<CorerunExecutable Condition="'$(TargetOS)' == 'Browser' Or '$(TargetOS)' == 'Android' or '$(TargetOS)' == 'iOSSimulator'"> $(DotnetRoot)/dotnet</CorerunExecutable>

<!-- Some configurations might not build a corerun.exe. In those cases, run xunit with dotnet.
We set roll-forward LatestMajor so that dotnet doesn't choose some old runtime that comes from
the era when xunit.console.dll was built. -->
<DotnetExecutable>dotnet --roll-forward LatestMajor</DotnetExecutable>
<DotnetExecutable Condition="'$(DotnetRoot)' != ''">$(DotnetRoot)/dotnet</DotnetExecutable>
<RunXunitWithDotnet Condition="'$(TargetOS)' == 'Browser' Or '$(TargetOS)' == 'Android' or '$(TargetOS)' == 'iOSSimulator' or '$(RunNativeAot)' == 'true'">true</RunXunitWithDotnet>
<CorerunExecutable Condition="'$(RunXunitWithDotnet)' == 'true'">$(DotnetExecutable)</CorerunExecutable>
</PropertyGroup>

<!-- Work around cmd command length limit by using relative paths
Expand Down

0 comments on commit 7f57584

Please sign in to comment.