From 15b3ca6d2884d23254b66b740f61d8de80f3d073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Wed, 13 Nov 2024 20:05:52 +0100 Subject: [PATCH] Allow building Mono Cross AOT compilers in the VMR (#109776) Introduce DotNetBuildMonoCrossAOT property to simplify the logic. Also cleanup the similar logic for DotNetBuildRuntimeNativeAOTRuntimePack. Contributes to https://github.com/dotnet/source-build/issues/3902 --- Directory.Build.props | 11 ++++++++ eng/DotNetBuild.props | 3 ++- eng/Subsets.props | 2 ++ eng/pipelines/runtime-official.yml | 41 ++--------------------------- eng/pipelines/runtime.yml | 42 ++---------------------------- 5 files changed, 19 insertions(+), 80 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 1e4aec17d15c0..a365e35d38fdb 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -192,6 +192,17 @@ $([MSBuild]::NormalizeDirectory($(WasmProjectRoot), 'build')) + + true + true + + + + true + android+browser+wasi + $(MonoCrossAOTTargetOS)+tvos+ios+maccatalyst + + false true diff --git a/eng/DotNetBuild.props b/eng/DotNetBuild.props index a1a8affb5cd6e..49f7bdaf9cf34 100644 --- a/eng/DotNetBuild.props +++ b/eng/DotNetBuild.props @@ -65,10 +65,11 @@ $(InnerBuildArgs) /p:AdditionalRuntimeIdentifierParent=$(BaseOS) /p:BaseOS=$(BaseOS) $(InnerBuildArgs) /p:WasmEnableThreads=true - $(InnerBuildArgs) $(FlagParameterPrefix)s clr.nativeaotlibs+clr.nativeaotruntime+libs+packs /p:BuildNativeAOTRuntimePack=true /p:SkipLibrariesNativeRuntimePackages=true + $(InnerBuildArgs) /p:DotNetBuildRuntimeNativeAOTRuntimePack=$(DotNetBuildRuntimeNativeAOTRuntimePack) $(InnerBuildArgs) /p:MonoEnableLLVM=$(DotNetBuildMonoEnableLLVM) $(InnerBuildArgs) /p:MonoAOTEnableLLVM=$(DotNetBuildMonoAOTEnableLLVM) $(InnerBuildArgs) /p:MonoBundleLLVMOptimizer=$(DotNetBuildMonoBundleLLVMOptimizer) + $(InnerBuildArgs) /p:DotNetBuildMonoCrossAOT=$(DotNetBuildMonoCrossAOT) $(InnerBuildArgs) $(FlagParameterPrefix)pgoinstrument diff --git a/eng/Subsets.props b/eng/Subsets.props index 969b8bd4c851e..313cbe3d54c8b 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -41,6 +41,8 @@ mono+libs+host+packs clr+libs+tools+host+packs + clr.nativeaotlibs+clr.nativeaotruntime+libs+packs + mono+packs diff --git a/eng/pipelines/runtime-official.yml b/eng/pipelines/runtime-official.yml index 0309f659133e3..e3e10911f52e9 100644 --- a/eng/pipelines/runtime-official.yml +++ b/eng/pipelines/runtime-official.yml @@ -281,7 +281,7 @@ extends: - windows_arm64 jobParameters: templatePath: 'templates-official' - buildArgs: -s clr.nativeaotlibs+clr.nativeaotruntime+libs+packs -c $(_BuildConfig) /p:BuildNativeAOTRuntimePack=true /p:SkipLibrariesNativeRuntimePackages=true + buildArgs: -c $(_BuildConfig) /p:DotNetBuildRuntimeNativeAOTRuntimePack=true nameSuffix: NativeAOT isOfficialBuild: ${{ variables.isOfficialBuild }} postBuildSteps: @@ -406,50 +406,13 @@ extends: - linux_musl_x64 - linux_arm64 - linux_musl_arm64 - jobParameters: - templatePath: 'templates-official' - buildArgs: -s mono+packs -c $(_BuildConfig) - /p:MonoCrossAOTTargetOS=android+browser+wasi /p:BuildMonoAOTCrossCompilerOnly=true - nameSuffix: CrossAOT_Mono - runtimeVariant: crossaot - isOfficialBuild: ${{ variables.isOfficialBuild }} - postBuildSteps: - - template: /eng/pipelines/common/upload-intermediate-artifacts-step.yml - parameters: - name: MonoRuntimePacks - - - template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - runtimeFlavor: mono - buildConfig: release - platforms: - windows_arm64 - windows_x64 - jobParameters: - templatePath: 'templates-official' - buildArgs: -s mono+packs -c $(_BuildConfig) - /p:MonoCrossAOTTargetOS=android+browser+wasi /p:BuildMonoAOTCrossCompilerOnly=true - nameSuffix: CrossAOT_Mono - runtimeVariant: crossaot - isOfficialBuild: ${{ variables.isOfficialBuild }} - postBuildSteps: - - template: /eng/pipelines/common/upload-intermediate-artifacts-step.yml - parameters: - name: MonoRuntimePacks - - - template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - runtimeFlavor: mono - buildConfig: release - platforms: - osx_x64 - osx_arm64 jobParameters: templatePath: 'templates-official' - buildArgs: -s mono+packs -c $(_BuildConfig) - /p:MonoCrossAOTTargetOS=android+browser+wasi+tvos+ios+maccatalyst /p:BuildMonoAOTCrossCompilerOnly=true + buildArgs: -c $(_BuildConfig) /p:DotNetBuildMonoCrossAOT=true nameSuffix: CrossAOT_Mono runtimeVariant: crossaot isOfficialBuild: ${{ variables.isOfficialBuild }} diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 56faff436d07e..01788474bd3b5 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -1179,6 +1179,7 @@ extends: # # Build Mono release AOT cross-compilers + # Only when mono changed # - template: /eng/pipelines/common/platform-matrix.yml parameters: @@ -1190,51 +1191,12 @@ extends: - linux_musl_x64 - linux_arm64 - linux_musl_arm64 - jobParameters: - buildArgs: -s mono+packs -c $(_BuildConfig) - /p:MonoCrossAOTTargetOS=android+browser+wasi /p:BuildMonoAOTCrossCompilerOnly=true - nameSuffix: CrossAOT_Mono - runtimeVariant: crossaot - condition: >- - or( - eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_mono_excluding_wasm.containsChange'], true), - eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isRollingBuild'], true)) - - - template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - runtimeFlavor: mono - buildConfig: release - platforms: - windows_arm64 - windows_x64 - jobParameters: - buildArgs: -s mono+packs -c $(_BuildConfig) - /p:MonoCrossAOTTargetOS=android+browser+wasi /p:BuildMonoAOTCrossCompilerOnly=true - nameSuffix: CrossAOT_Mono - runtimeVariant: crossaot - condition: >- - or( - eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_mono_excluding_wasm.containsChange'], true), - eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isRollingBuild'], true)) - # - # Build Mono release AOT cross-compilers - # Only when mono changed - # - - - template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - runtimeFlavor: mono - buildConfig: release - platforms: - osx_x64 - osx_arm64 jobParameters: - buildArgs: -s mono+packs -c $(_BuildConfig) - /p:MonoCrossAOTTargetOS=android+browser+wasi+tvos+ios+maccatalyst /p:BuildMonoAOTCrossCompilerOnly=true + buildArgs: -c $(_BuildConfig) /p:DotNetBuildMonoCrossAOT=true nameSuffix: CrossAOT_Mono runtimeVariant: crossaot condition: >-