From 5b8206e2ffd52e2189149f7d0788535f3cb3a36a Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Thu, 14 Sep 2023 18:52:05 -0400 Subject: [PATCH 1/8] [wasi] Add AOT compiler build --- eng/pipelines/runtime-official.yml | 7 ++++--- .../pkg/sfx/Microsoft.NETCore.App/monocrossaot.sfxproj | 1 + src/mono/monoaotcross.proj | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/runtime-official.yml b/eng/pipelines/runtime-official.yml index 9c341a0479128..5954f468d3736 100644 --- a/eng/pipelines/runtime-official.yml +++ b/eng/pipelines/runtime-official.yml @@ -211,6 +211,7 @@ extends: platforms: - android_x64 - browser_wasm + - wasi_wasm - tvos_arm64 - ios_arm64 - maccatalyst_x64 @@ -232,7 +233,7 @@ extends: - linux_musl_arm64 jobParameters: buildArgs: -s mono+packs -c $(_BuildConfig) - /p:MonoCrossAOTTargetOS=android+browser /p:SkipMonoCrossJitConfigure=true /p:BuildMonoAOTCrossCompilerOnly=true + /p:MonoCrossAOTTargetOS=android+browser+wasi /p:SkipMonoCrossJitConfigure=true /p:BuildMonoAOTCrossCompilerOnly=true nameSuffix: CrossAOT_Mono runtimeVariant: crossaot dependsOn: @@ -255,7 +256,7 @@ extends: - windows_x64 jobParameters: buildArgs: -s mono+packs -c $(_BuildConfig) - /p:MonoCrossAOTTargetOS=android+browser /p:SkipMonoCrossJitConfigure=true /p:BuildMonoAOTCrossCompilerOnly=true + /p:MonoCrossAOTTargetOS=android+browser+wasi /p:SkipMonoCrossJitConfigure=true /p:BuildMonoAOTCrossCompilerOnly=true nameSuffix: CrossAOT_Mono runtimeVariant: crossaot dependsOn: @@ -279,7 +280,7 @@ extends: - osx_arm64 jobParameters: buildArgs: -s mono+packs -c $(_BuildConfig) - /p:MonoCrossAOTTargetOS=android+browser+tvos+ios+maccatalyst /p:SkipMonoCrossJitConfigure=true /p:BuildMonoAOTCrossCompilerOnly=true + /p:MonoCrossAOTTargetOS=android+browser+wasi+tvos+ios+maccatalyst /p:SkipMonoCrossJitConfigure=true /p:BuildMonoAOTCrossCompilerOnly=true nameSuffix: CrossAOT_Mono runtimeVariant: crossaot dependsOn: diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/monocrossaot.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/monocrossaot.sfxproj index a5bd806e21ec6..08da76561f220 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/monocrossaot.sfxproj +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/monocrossaot.sfxproj @@ -7,6 +7,7 @@ $(MonoAotTargets);tvossimulator-x64;tvossimulator-arm64;tvos-arm64 $(MonoAotTargets);iossimulator-x64;iossimulator-arm64;ios-arm64 $(MonoAotTargets);maccatalyst-x64;maccatalyst-arm64 + $(MonoAotTargets);wasi-wasm diff --git a/src/mono/monoaotcross.proj b/src/mono/monoaotcross.proj index 52648d991f8e5..ab68a9bc33f2f 100644 --- a/src/mono/monoaotcross.proj +++ b/src/mono/monoaotcross.proj @@ -6,11 +6,13 @@ <_MonoGenerateOffsetsOSGroups Condition="'$(MonoGenerateOffsetsOSGroups)' != ''">+$(MonoGenerateOffsetsOSGroups)+ <_MonoCrossAOTTargetOS Condition="$(_MonoGenerateOffsetsOSGroups.contains('+android+'))">$(_MonoCrossAOTTargetOS)+android+ <_MonoCrossAOTTargetOS Condition="$(_MonoGenerateOffsetsOSGroups.contains('+browser+'))">$(_MonoCrossAOTTargetOS)+browser+ + <_MonoCrossAOTTargetOS Condition="$(_MonoGenerateOffsetsOSGroups.contains('+wasi+'))">$(_MonoCrossAOTTargetOS)+wasi+ <_MonoCrossAOTTargetOS Condition="$(_MonoGenerateOffsetsOSGroups.contains('+tvos+'))">$(_MonoCrossAOTTargetOS)+tvos+ <_MonoCrossAOTTargetOS Condition="$(_MonoGenerateOffsetsOSGroups.contains('+ios+'))">$(_MonoCrossAOTTargetOS)+ios+ <_MonoCrossAOTTargetOS Condition="$(_MonoGenerateOffsetsOSGroups.contains('+maccatalyst+'))">$(_MonoCrossAOTTargetOS)+maccatalyst+ $(MonoAotTargets);android-x64;android-arm64;android-x86;android-arm $(MonoAotTargets);browser-wasm + $(MonoAotTargets);wasi-wasm $(MonoAotTargets);tvossimulator-x64;tvossimulator-arm64;tvos-arm64 $(MonoAotTargets);iossimulator-x64;iossimulator-arm64;ios-arm64 $(MonoAotTargets);maccatalyst-x64;maccatalyst-arm64 From f04f5921bc4fbd9b97edb8ea670e5062889f7aaa Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Fri, 15 Sep 2023 10:17:32 -0400 Subject: [PATCH 2/8] Make sure wasi target gets the offset files --- eng/pipelines/runtime-official.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eng/pipelines/runtime-official.yml b/eng/pipelines/runtime-official.yml index 5954f468d3736..77c98ee520739 100644 --- a/eng/pipelines/runtime-official.yml +++ b/eng/pipelines/runtime-official.yml @@ -239,9 +239,11 @@ extends: dependsOn: - mono_android_offsets - mono_browser_offsets + - mono_wasi_offsets monoCrossAOTTargetOS: - android - browser + - wasi isOfficialBuild: ${{ variables.isOfficialBuild }} extraStepsTemplate: /eng/pipelines/common/upload-intermediate-artifacts-step.yml extraStepsParameters: @@ -262,9 +264,11 @@ extends: dependsOn: - mono_android_offsets - mono_browser_offsets + - mono_wasi_offsets monoCrossAOTTargetOS: - android - browser + - wasi isOfficialBuild: ${{ variables.isOfficialBuild }} extraStepsTemplate: /eng/pipelines/common/upload-intermediate-artifacts-step.yml extraStepsParameters: @@ -286,12 +290,14 @@ extends: dependsOn: - mono_android_offsets - mono_browser_offsets + - mono_wasi_offsets - mono_tvos_offsets - mono_ios_offsets - mono_maccatalyst_offsets monoCrossAOTTargetOS: - android - browser + - wasi - tvos - ios - maccatalyst From 21b999b6f22b22f1fef846d52c8a184e26735ba8 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Fri, 15 Sep 2023 14:36:53 -0400 Subject: [PATCH 3/8] Include windows for wasi cross build --- src/mono/mono.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 62a075843e388..46ae1bae253d9 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -41,7 +41,7 @@ true true true - true + true $([MSBuild]::NormalizeDirectory('$(MonoObjDir)', 'cross')) $([MSBuild]::NormalizePath('$(MonoObjCrossDir)', 'config.h')) true From 3a6ff505f29ad510f51c4a35394e48e8188284c5 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Mon, 18 Sep 2023 11:14:12 -0400 Subject: [PATCH 4/8] Add offset generation to runtime yml as well --- eng/pipelines/runtime.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index c9027093acdc2..5db44055fa0cd 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -406,6 +406,7 @@ extends: platforms: - android_x64 - browser_wasm + - wasi_wasm - tvos_arm64 - ios_arm64 - maccatalyst_x64 @@ -852,9 +853,11 @@ extends: dependsOn: - mono_android_offsets - mono_browser_offsets + - mono_wasi_offsets monoCrossAOTTargetOS: - android - browser + - wasi condition: >- or( eq(dependencies.evaluate_paths.outputs['SetPathVars_mono_excluding_wasm.containsChange'], true), @@ -874,12 +877,14 @@ extends: dependsOn: - mono_android_offsets - mono_browser_offsets + - mono_wasi_offsets - mono_tvos_offsets - mono_ios_offsets - mono_maccatalyst_offsets monoCrossAOTTargetOS: - android - browser + - wasi - tvos - ios - maccatalyst From 663c6e8f21b911615791197d7a8c64f0c7b839a4 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Tue, 14 Nov 2023 19:35:11 -0600 Subject: [PATCH 5/8] Move the path to a property --- src/mono/mono.proj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 46ae1bae253d9..9668f59ede6a3 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -867,7 +867,8 @@ <_MonoSkipInitCompiler Condition="'$(AotHostArchitecture)' != '$(BuildArchitecture)'">false <_MonoSkipInitCompiler Condition="'$(CrossBuild)' == 'true'">false - <_MonoAotCrossOffsetsCommand Condition="'$(MonoUseCrossTool)' == 'true'">$(PythonCmd) $(MonoProjectRoot)mono/tools/offsets-tool/offsets-tool.py @(MonoAotCrossOffsetsToolParams, ' ') + <_MonoAotCrossOffsetsToolPath>$(MonoProjectRoot)mono\tools\offsets-tool\offsets-tool.py + <_MonoAotCrossOffsetsCommand Condition="'$(MonoUseCrossTool)' == 'true'">$(PythonCmd) $(_MonoAotCrossOffsetsToolPath) @(MonoAotCrossOffsetsToolParams, ' ') <_MonoAotCMakeConfigureCommand>cmake @(MonoAOTCMakeArgs, ' ') $(MonoCMakeExtraArgs) "$(MonoProjectRoot.TrimEnd('\/'))" <_MonoAotCMakeConfigureCommand Condition="'$(_MonoSkipInitCompiler)' != 'true' and '$(HostOS)' != 'windows'">sh -c 'build_arch="$(_CompilerTargetArch)" ROOTFS_DIR="$(MonoCrossDir)" compiler="$(MonoCCompiler)" . "$(RepositoryEngineeringCommonDir)native/init-compiler.sh" && @(_MonoAotBuildEnv, ' ') $(_MonoAotCMakeConfigureCommand)' <_MonoAotCMakeConfigureCommand Condition="'$(_MonoSkipInitCompiler)' == 'true' and '$(HostOS)' != 'windows'">$(_MonoAOTCCOption) $(_MonoAOTCXXOption) @(_MonoAotBuildEnv, ' ') $(_MonoAotCMakeConfigureCommand) From 75c8f4bd7d3bc6743c50c5d79febddf70d1f78d6 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Tue, 14 Nov 2023 21:30:38 -0600 Subject: [PATCH 6/8] Trim the sdk paths so that the trailing \ doesn't end up escaping the " --- src/mono/mono.proj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 9668f59ede6a3..93df2580866ef 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -806,8 +806,8 @@ - - + + 9.0.0-alpha.1.23564.1 $(MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion) + 9.0.0-alpha.1.23565.1 1.1.87-gba258badda 1.0.0-v3.14.0.5722 diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 26168ecd384ff..5bb0e3c883817 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -85,8 +85,21 @@ + + + + $([MSBuild]::NormalizePath('$(PkgMicrosoft_NET_Runtime_Emscripten_3_1_34_Python_win-x64)', 'tools', 'python')) + + <_MonoCMakeArgs Include="-DENABLE_WERROR=1"/>