diff --git a/docs/workflow/building/coreclr/nativeaot.md b/docs/workflow/building/coreclr/nativeaot.md index 155ed05186e7b..43a05ac726afd 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+clr.nativeaotruntime+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.alljits+clr.tools+clr.nativeaotlibs+clr.nativeaotruntime+libs` which is more targeted and builds faster. - [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 de8a2710eb686..8d288c73ee961 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -249,7 +249,8 @@ - + + diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets index c2f64bf1abf8a..8f91d3e6e4257 100644 --- a/eng/liveBuilds.targets +++ b/eng/liveBuilds.targets @@ -25,6 +25,7 @@ $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'sharedFramework')) $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'crossgen2')) $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'ilc')) + $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', '$(BuildArchitecture)', 'ilc')) $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'aotsdk')) $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'build')) diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 9d3bbfe477d8e..c37478db2e39b 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+clr.nativeaotruntime+libs -rc $(_BuildConfig) -lc Release + buildArgs: -s clr.alljits+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+clr.nativeaotruntime+libs -rc $(_BuildConfig) -lc Release + buildArgs: -s clr.alljits+clr.tools+clr.nativeaotlibs+clr.nativeaotruntime+libs -rc $(_BuildConfig) -lc Release extraStepsTemplate: /eng/pipelines/coreclr/nativeaot-post-build-steps.yml condition: >- or( @@ -242,7 +242,7 @@ jobs: eq(variables['isFullMatrix'], true)) # -# CoreCLR NativeAOT checked build and smoke tests +# CoreCLR NativeAOT release build and smoke tests # Only when CoreCLR is changed # - template: /eng/pipelines/common/platform-matrix.yml @@ -257,7 +257,7 @@ jobs: testGroup: innerloop timeoutInMinutes: 120 nameSuffix: NativeAOT - buildArgs: -s clr.jit+clr.tools+clr.nativeaotlibs+clr.nativeaotruntime+libs -rc $(_BuildConfig) -lc Release + buildArgs: -s clr.alljits+clr.tools+clr.nativeaotlibs+clr.nativeaotruntime+libs -rc $(_BuildConfig) -lc Release extraStepsTemplate: /eng/pipelines/coreclr/nativeaot-post-build-steps.yml condition: >- or( @@ -265,6 +265,34 @@ jobs: eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), eq(variables['isFullMatrix'], true)) +# +# CoreCLR NativeAOT release build and libraries tests +# Only when CoreCLR is changed +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + buildConfig: Release + platforms: + - windows_arm64 + - Linux_arm64 + jobParameters: + testGroup: innerloop + isSingleFile: true + nameSuffix: NativeAOT + buildArgs: -s clr.alljits+clr.tools+clr.nativeaotlibs+clr.nativeaotruntime+libs+libs.tests -c $(_BuildConfig) /p:TestNativeAot=true /p:ArchiveTests=true + timeoutInMinutes: 120 + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/libraries/helix.yml + extraStepsParameters: + creator: dotnet-bot + testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig) + condition: >- + or( + eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true), + eq(variables['isFullMatrix'], true)) + # Build and test clr tools - template: /eng/pipelines/common/platform-matrix.yml parameters: diff --git a/eng/testing/tests.singlefile.targets b/eng/testing/tests.singlefile.targets index e6783add3640a..e5f12a683a9f7 100644 --- a/eng/testing/tests.singlefile.targets +++ b/eng/testing/tests.singlefile.targets @@ -22,11 +22,15 @@ $(CoreCLRILCompilerDir) + $(CoreCLRCrossILCompilerDir) + clang-9 + $(ROOTFS_DIR) $(CoreCLRILCompilerDir)netstandard/ILCompiler.Build.Tasks.dll $(CoreCLRAotSdkDir) $(NetCoreAppCurrentTestHostSharedFrameworkPath) - $(NoWarn);IL3050;IL3052;IL3055;IL1005 + $(NoWarn);IL3050;IL3051;IL3052;IL3055;IL1005 false + true true diff --git a/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj b/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj index 6c5a4a6d377d8..52845889902af 100644 --- a/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj +++ b/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj @@ -1,126 +1,7 @@  - ilc - true - Exe - $(NetCoreAppToolCurrent) - 8002,NU1701 - x64;x86 - AnyCPU - false - true - $(RuntimeBinDir)ilc - true - false - Debug;Release;Checked - true - true - false + $(RuntimeBinDir)ilc/ + $(OutputRid) - - - true - false - $(ToolsRID) - - - - osx.10.12-x64 - osx.11.0-arm64 - $(RuntimeIdentifier) - - $(runtimelinuxarm64MicrosoftNETCoreRuntimeObjWriterVersion) - $(runtimelinuxx64MicrosoftNETCoreRuntimeObjWriterVersion) - $(runtimelinuxmuslarm64MicrosoftNETCoreRuntimeObjWriterVersion) - $(runtimelinuxmuslx64MicrosoftNETCoreRuntimeObjWriterVersion) - $(runtimewinarm64MicrosoftNETCoreRuntimeObjWriterVersion) - $(runtimewinx64MicrosoftNETCoreRuntimeObjWriterVersion) - $(runtimeosx110arm64MicrosoftNETCoreRuntimeObjWriterVersion) - $(runtimeosx1012x64MicrosoftNETCoreRuntimeObjWriterVersion) - - - true - - - - - - - $(ObjWriterVersion) - - - - PreserveNewest - false - false - - - - - - PreserveNewest - false - false - - - - PreserveNewest - false - false - - - - PreserveNewest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - Internal.CommandLine.Strings - - - - - - - - - unix - win - $(TargetOSComponent)_$(TargetArchitecture)_$(TargetArchitecture) - - - - - - - + diff --git a/src/coreclr/tools/aot/ILCompiler/ILCompiler.props b/src/coreclr/tools/aot/ILCompiler/ILCompiler.props new file mode 100644 index 0000000000000..936823572cb95 --- /dev/null +++ b/src/coreclr/tools/aot/ILCompiler/ILCompiler.props @@ -0,0 +1,138 @@ + + + ilc + true + Exe + $(NetCoreAppToolCurrent) + 8002,NU1701 + x64;x86 + AnyCPU + false + true + true + false + Debug;Release;Checked + true + false + + + + true + false + true + + + + + <_objWriterRidPlatformIndex>$(RuntimeIdentifier.LastIndexOf('-')) + $(RuntimeIdentifier.Substring(0, $(_objWriterRidPlatformIndex))) + $(RuntimeIdentifier.Substring($(_objWriterRidPlatformIndex)).TrimStart('-')) + + + linux + + + osx.10.12 + osx.11.0 + + $(ObjWriterRidWithoutPlatform)-$(ObjWriterRidPlatform) + + $(runtimelinuxarm64MicrosoftNETCoreRuntimeObjWriterVersion) + $(runtimelinuxx64MicrosoftNETCoreRuntimeObjWriterVersion) + $(runtimelinuxmuslarm64MicrosoftNETCoreRuntimeObjWriterVersion) + $(runtimelinuxmuslx64MicrosoftNETCoreRuntimeObjWriterVersion) + $(runtimewinarm64MicrosoftNETCoreRuntimeObjWriterVersion) + $(runtimewinx64MicrosoftNETCoreRuntimeObjWriterVersion) + $(runtimeosx110arm64MicrosoftNETCoreRuntimeObjWriterVersion) + $(runtimeosx1012x64MicrosoftNETCoreRuntimeObjWriterVersion) + + + true + + + + + + + $(ObjWriterVersion) + + + + PreserveNewest + false + false + + + + PreserveNewest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + Internal.CommandLine.Strings + + + + + + + + + unix + win + unix_osx + + $(TargetArchitecture) + $(CrossHostArch) + arm + + $(TargetArchitecture) + arm + + $(TargetOSComponent)_$(TargetArchitectureForLocalJitBuild)_$(TargetArchitectureForSharedLibraries) + + $(LibPrefix)jitinterface_$(TargetArchitectureForSharedLibraries)$(LibSuffix) + + + + + + + + diff --git a/src/coreclr/tools/aot/ILCompiler/ILCompiler_crossarch.csproj b/src/coreclr/tools/aot/ILCompiler/ILCompiler_crossarch.csproj new file mode 100644 index 0000000000000..9ed97b693e6dd --- /dev/null +++ b/src/coreclr/tools/aot/ILCompiler/ILCompiler_crossarch.csproj @@ -0,0 +1,8 @@ + + + $(BuildArchitecture) + $(RuntimeBinDir)/$(CrossHostArch)/ilc/ + $(ToolsRID) + + + diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2_crossarch.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2_crossarch.csproj index ccea99b3211c1..544b4271117b5 100644 --- a/src/coreclr/tools/aot/crossgen2/crossgen2_crossarch.csproj +++ b/src/coreclr/tools/aot/crossgen2/crossgen2_crossarch.csproj @@ -1,6 +1,6 @@ - x64 + $(BuildArchitecture) $(RuntimeBinDir)/$(CrossHostArch)/crossgen2 false diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 9b802c8508b70..b0e53dde717ae 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -368,9 +368,7 @@ - - - +