From 6142b82dd3ffbc14701eb3bc92bcbce166ba4bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Fri, 28 Jan 2022 16:17:34 +0900 Subject: [PATCH] Fix NativeAOT official build Official builds are currently not building NativeAOT CoreLib. For unknown reasons the official build splits native build and managed build of the CoreCLR partition. We had a convenient clr.nativeaotlibs subset that built both the native part and managed part. Managed part can't be built without the native part, so it makes sense. To satisfy official build's weirdness, we need to split this into two subsets so that we can tell the official build to build the managed part. (Official builds already build everything in the native part, so we're good there.) --- docs/workflow/building/coreclr/nativeaot.md | 2 +- eng/Subsets.props | 5 +++-- eng/pipelines/coreclr/templates/build-job.yml | 2 +- eng/pipelines/runtime.yml | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/workflow/building/coreclr/nativeaot.md b/docs/workflow/building/coreclr/nativeaot.md index 968bb5fa892435..3206fc7349c200 100644 --- a/docs/workflow/building/coreclr/nativeaot.md +++ b/docs/workflow/building/coreclr/nativeaot.md @@ -21,7 +21,7 @@ The executable looks like a native executable, in the sense that it can be debug ## Building - [Install pre-requisites](../../README.md#build-requirements) -- Run `build[.cmd|.sh] clr+libs -rc [Debug|Release] -lc Release` from the repo root. This will restore nuget packages required for building and build the parts of the repo required for general CoreCLR development. Alternatively, instead of specifying `clr+libs`, you can specify `clr.jit+clr.tools+clr.nativeaotlibs+libs` which is more targeted and builds faster. Replace `clr.jit` with `clr.alljits` if you need to crosscompile. +- Run `build[.cmd|.sh] clr+libs -rc [Debug|Release] -lc Release` from the repo root. This will restore nuget packages required for building and build the parts of the repo required for general CoreCLR development. Alternatively, instead of specifying `clr+libs`, you can specify `clr.jit+clr.tools+clr.nativeaotlibs+clr.nativeaotruntime+libs` which is more targeted and builds faster. Replace `clr.jit` with `clr.alljits` if you need to crosscompile. - [NOT PORTED OVER YET] The build will place the toolchain packages at `artifacts\packages\[Debug|Release]\Shipping`. To publish your project using these packages: - [NOT PORTED OVER YET] Add the package directory to your `nuget.config` file. For example, replace `dotnet-experimental` line in `samples\HelloWorld\nuget.config` with `` - [NOT PORTED OVER YET] Run `dotnet publish --packages pkg -r [win-x64|linux-x64|osx-64] -c [Debug|Release]` to publish your project. `--packages pkg` option restores the package into a local directory that is easy to cleanup once you are done. It avoids polluting the global nuget cache with your locally built dev package. diff --git a/eng/Subsets.props b/eng/Subsets.props index 4fc54cfd823d15..5ea1ff48e23f4a 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -106,7 +106,8 @@ - + + @@ -203,7 +204,7 @@ $(ClrRuntimeBuildSubsets);ClrILToolsSubset=true - + $(ClrRuntimeBuildSubsets);ClrNativeAotSubset=true diff --git a/eng/pipelines/coreclr/templates/build-job.yml b/eng/pipelines/coreclr/templates/build-job.yml index 713882250e627a..9048e8ed4fe8a2 100644 --- a/eng/pipelines/coreclr/templates/build-job.yml +++ b/eng/pipelines/coreclr/templates/build-job.yml @@ -212,7 +212,7 @@ jobs: # Build CoreCLR Managed Components - ${{ if or(ne(parameters.osGroup, 'Linux'), ne(parameters.archType, 'x86')) }}: - - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -subset clr.corelib+clr.nativecorelib+clr.tools+clr.packages+clr.paltestlist $(crossArg) -arch $(archType) $(osArg) -c $(buildConfig) $(pgoInstrumentArg) $(officialBuildIdArg) -ci + - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -subset clr.corelib+clr.nativecorelib+clr.nativeaotlibs+clr.tools+clr.packages+clr.paltestlist $(crossArg) -arch $(archType) $(osArg) -c $(buildConfig) $(pgoInstrumentArg) $(officialBuildIdArg) -ci displayName: Build managed product components and packages - ${{ if and(eq(parameters.osGroup, 'Linux'), eq(parameters.archType, 'x86')) }}: - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -subset clr.corelib $(crossArg) -arch $(archType) $(osArg) -c $(buildConfig) $(pgoInstrumentArg) $(officialBuildIdArg) -ci diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 1c376cad61b93e..9d3bbfe477d8e0 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -211,7 +211,7 @@ jobs: testGroup: innerloop timeoutInMinutes: 120 nameSuffix: NativeAOT - buildArgs: -s clr.jit+clr.tools+clr.nativeaotlibs+libs -rc $(_BuildConfig) -lc Release + buildArgs: -s clr.jit+clr.tools+clr.nativeaotlibs+clr.nativeaotruntime+libs -rc $(_BuildConfig) -lc Release extraStepsTemplate: /eng/pipelines/coreclr/nativeaot-post-build-steps.yml condition: >- or( @@ -233,7 +233,7 @@ jobs: testGroup: innerloop timeoutInMinutes: 120 nameSuffix: NativeAOT - buildArgs: -s clr.jit+clr.tools+clr.nativeaotlibs+libs -rc $(_BuildConfig) -lc Release + buildArgs: -s clr.jit+clr.tools+clr.nativeaotlibs+clr.nativeaotruntime+libs -rc $(_BuildConfig) -lc Release extraStepsTemplate: /eng/pipelines/coreclr/nativeaot-post-build-steps.yml condition: >- or( @@ -257,7 +257,7 @@ jobs: testGroup: innerloop timeoutInMinutes: 120 nameSuffix: NativeAOT - buildArgs: -s clr.jit+clr.tools+clr.nativeaotlibs+libs -rc $(_BuildConfig) -lc Release + buildArgs: -s clr.jit+clr.tools+clr.nativeaotlibs+clr.nativeaotruntime+libs -rc $(_BuildConfig) -lc Release extraStepsTemplate: /eng/pipelines/coreclr/nativeaot-post-build-steps.yml condition: >- or(