From fb651aeab603fda06798d7913865416b17d2a4b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Tue, 18 Apr 2023 12:37:14 +0200 Subject: [PATCH 1/2] Add NativeAOT runtime pack build for iOS/tvOS/Catalyst Contributes to https://github.com/dotnet/runtime/issues/81024 --- eng/Subsets.props | 8 +++-- eng/liveBuilds.targets | 9 +++++- eng/pipelines/runtime-official.yml | 25 +++++++++++++++ src/coreclr/CMakeLists.txt | 4 ++- .../Microsoft.DotNet.ILCompiler.pkgproj | 2 +- .../Directory.Build.props | 14 ++++++++ .../Microsoft.NETCore.App.Runtime.props | 32 ++++++++++++------- 7 files changed, 78 insertions(+), 16 deletions(-) diff --git a/eng/Subsets.props b/eng/Subsets.props index 4af6e90f9172be..ef9935e2407dc9 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -481,12 +481,14 @@ - + + + @@ -494,11 +496,13 @@ + + - + diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets index 286a5d9606d4e9..ba99b07a34017f 100644 --- a/eng/liveBuilds.targets +++ b/eng/liveBuilds.targets @@ -77,7 +77,14 @@ $([MSBuild]::NormalizeDirectory('$(MonoArtifactsPath)')) - + + <_nativeAotRuntimeFiles Include="$(CoreCLRAotSdkDir)*" /> + + true + + + + diff --git a/eng/pipelines/runtime-official.yml b/eng/pipelines/runtime-official.yml index 9b923a7975ec3c..00e66c7630ac2f 100644 --- a/eng/pipelines/runtime-official.yml +++ b/eng/pipelines/runtime-official.yml @@ -97,6 +97,31 @@ extends: - windows_x64 - windows_arm - windows_arm64 + + # + # Build NativeAOT runtime packs + # + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + buildConfig: release + platforms: + - maccatalyst_x64 + - maccatalyst_arm64 + - tvossimulator_x64 + - tvossimulator_arm64 + - tvos_arm64 + - iossimulator_x64 + - iossimulator_arm64 + - ios_arm64 + jobParameters: + buildArgs: -s clr.nativeaotlibs+clr.nativeaotruntime+libs+packs -c $(_BuildConfig) /p:BuildNativeAOTRuntimePack=true + nameSuffix: AllSubsets_NativeAOT + isOfficialBuild: ${{ variables.isOfficialBuild }} + extraStepsTemplate: /eng/pipelines/common/upload-intermediate-artifacts-step.yml + extraStepsParameters: + name: NativeAOTRuntimePacks + # # Build Mono runtime packs # diff --git a/src/coreclr/CMakeLists.txt b/src/coreclr/CMakeLists.txt index d794641ebcd787..4dae5dd2e29490 100644 --- a/src/coreclr/CMakeLists.txt +++ b/src/coreclr/CMakeLists.txt @@ -126,7 +126,9 @@ endif() #---------------------------------------------------- # Build the test watchdog alongside the CLR #---------------------------------------------------- -add_subdirectory("${CLR_SRC_NATIVE_DIR}/watchdog" test-watchdog) +if(NOT CLR_CMAKE_HOST_MACCATALYST AND NOT CLR_CMAKE_HOST_IOS AND NOT CLR_CMAKE_HOST_TVOS) + add_subdirectory("${CLR_SRC_NATIVE_DIR}/watchdog" test-watchdog) +endif() # Add this subdir. We install the headers for the jit. add_subdirectory(pal/prebuilt/inc) diff --git a/src/installer/pkg/projects/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.pkgproj b/src/installer/pkg/projects/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.pkgproj index 315a1dc8b44751..56052895c205ec 100644 --- a/src/installer/pkg/projects/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.pkgproj +++ b/src/installer/pkg/projects/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.pkgproj @@ -27,7 +27,7 @@ - + diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props b/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props index 21b7023bcce08b..adb449991fbd9b 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props @@ -174,6 +174,20 @@ + + + + + + + + + + + + + + diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props index 7f849b8cb632eb..d3e4c444eddbe4 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props @@ -5,8 +5,8 @@ AddRuntimeFilesToPackage; AddFrameworkFilesToPackage - true - false + true + false false @@ -17,6 +17,9 @@ The .NET Shared Framework + + NativeAOT + Mono @@ -38,7 +41,7 @@ We add the entries here to ensure that we don't fail the validation that every file included in the runtime pack is in the platform manifest without adding the entries to the manifest in the ref pack. --> - + @@ -47,14 +50,18 @@ + + + + - - + + @@ -64,7 +71,8 @@ runtimes/$(RuntimeIdentifier)/native - + + tools @@ -87,7 +95,7 @@ runtimes/$(RuntimeIdentifier)/native/Mono.debug.framework/%(RecursiveDir) - runtimes/$(RuntimeIdentifier)/build/%(RecursiveDir) @@ -110,6 +118,8 @@ Condition="Exists('$(CoreCLRArtifactsPath)StandardOptimizationData.mibc')"> tools + + @@ -123,7 +133,7 @@ - + <_diaSymArch>$(_hostArch) <_diaSymReaderPath>$(PkgMicrosoft_DiaSymReader_Native)/runtimes/win/native/Microsoft.DiaSymReader.Native.$(_diaSymArch).dll @@ -134,7 +144,7 @@ <_diaSymReaderTargetArchPath>$(PkgMicrosoft_DiaSymReader_Native)/runtimes/win/native/Microsoft.DiaSymReader.Native.$(_diaSymTargetArch).dll - + runtimes/$(CoreCLRCrossTargetComponentDirName)_$(TargetArchitecture)/native @@ -160,10 +170,10 @@ - + - + true From 68d9943832cb2142fbe4d3718fe98373ea283381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Fri, 21 Apr 2023 14:18:01 +0200 Subject: [PATCH 2/2] PR feedback --- .../pkg/sfx/Microsoft.NETCore.App/Directory.Build.props | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props b/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props index adb449991fbd9b..6c7f9a837d37fd 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props @@ -179,8 +179,6 @@ - -