From 003f379a8ae81ce8bf94dd78af6df2483f7d891a Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 14 Jul 2021 20:51:07 +0200 Subject: [PATCH 1/8] [wasm] Support mono runtime components --- src/mono/wasm/build/WasmApp.Native.targets | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mono/wasm/build/WasmApp.Native.targets b/src/mono/wasm/build/WasmApp.Native.targets index 3bb2154a4cd3e..61328f9ba3f6a 100644 --- a/src/mono/wasm/build/WasmApp.Native.targets +++ b/src/mono/wasm/build/WasmApp.Native.targets @@ -237,7 +237,11 @@ - + + <_MonoComponent Include="hot_reload;diagnostics_tracing;debugger" /> + + + <_EmccLDFlags Include="$(EmccLinkOptimizationFlag)" /> @@ -258,8 +262,9 @@ <_WasmNativeFileForLinking Include="%(_BitcodeFile.ObjectFile)" /> <_WasmNativeFileForLinking Include="%(_WasmSourceFileToCompile.ObjectFile)" /> - - <_WasmNativeFileForLinking Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)\*.a" /> + <_WasmNativeFileForLinking + Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)\*.a" + Exclude="@(_MonoRuntimeComponentDontLink->'$(MicrosoftNetCoreAppRuntimePackRidNativeDir)\%(Identity)')" /> <_EmccLinkStepArgs Include="@(_EmccLDFlags)" /> <_EmccLinkStepArgs Include="--js-library "%(_DotnetJSSrcFile.Identity)"" /> From 57803d42945009a436834ad950a73e3bc36981a0 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 14 Jul 2021 23:19:36 +0200 Subject: [PATCH 2/8] Do not use diagnostics_tracing component --- src/mono/wasm/build/WasmApp.Native.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/wasm/build/WasmApp.Native.targets b/src/mono/wasm/build/WasmApp.Native.targets index 61328f9ba3f6a..bee86b99c743f 100644 --- a/src/mono/wasm/build/WasmApp.Native.targets +++ b/src/mono/wasm/build/WasmApp.Native.targets @@ -238,7 +238,7 @@ - <_MonoComponent Include="hot_reload;diagnostics_tracing;debugger" /> + <_MonoComponent Include="hot_reload;debugger" /> From e680b148bd9d4020346c183c2eb5247a07b6b3d5 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 14 Jul 2021 23:32:15 +0200 Subject: [PATCH 3/8] Allow custom @(_MonoComponent) --- src/mono/wasm/build/WasmApp.Native.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/wasm/build/WasmApp.Native.targets b/src/mono/wasm/build/WasmApp.Native.targets index bee86b99c743f..8aa9e660a165a 100644 --- a/src/mono/wasm/build/WasmApp.Native.targets +++ b/src/mono/wasm/build/WasmApp.Native.targets @@ -237,7 +237,7 @@ - + <_MonoComponent Include="hot_reload;debugger" /> From a2c89fb83e16752e3d600d71b01f428147d9a13b Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Wed, 14 Jul 2021 18:14:08 -0500 Subject: [PATCH 4/8] Update src/mono/wasm/build/WasmApp.Native.targets --- src/mono/wasm/build/WasmApp.Native.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/wasm/build/WasmApp.Native.targets b/src/mono/wasm/build/WasmApp.Native.targets index 8aa9e660a165a..c9d66c561b146 100644 --- a/src/mono/wasm/build/WasmApp.Native.targets +++ b/src/mono/wasm/build/WasmApp.Native.targets @@ -241,7 +241,7 @@ <_MonoComponent Include="hot_reload;debugger" /> - + <_EmccLDFlags Include="$(EmccLinkOptimizationFlag)" /> From 6aef77dde5ddc761c619ebc42c210b306ab19176 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 15 Jul 2021 11:41:04 +0200 Subject: [PATCH 5/8] Select components only with native workload --- src/mono/wasm/build/WasmApp.Native.targets | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mono/wasm/build/WasmApp.Native.targets b/src/mono/wasm/build/WasmApp.Native.targets index c9d66c561b146..c0426264eb7a1 100644 --- a/src/mono/wasm/build/WasmApp.Native.targets +++ b/src/mono/wasm/build/WasmApp.Native.targets @@ -241,7 +241,12 @@ <_MonoComponent Include="hot_reload;debugger" /> - + + + + <_EmccLDFlags Include="$(EmccLinkOptimizationFlag)" /> From 5df27a17d9e2039a4f6e70492b82320d28d7cbf8 Mon Sep 17 00:00:00 2001 From: Thays Date: Thu, 15 Jul 2021 14:15:52 -0300 Subject: [PATCH 6/8] Fixing CI when linking with stubs --- src/mono/mono/component/debugger-stub.c | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/mono/mono/component/debugger-stub.c b/src/mono/mono/component/debugger-stub.c index 3628c0fbc532a..77bd42ccca939 100644 --- a/src/mono/mono/component/debugger-stub.c +++ b/src/mono/mono/component/debugger-stub.c @@ -212,3 +212,32 @@ static void stub_send_enc_delta (MonoImage *image, gconstpointer dmeta_bytes, int32_t dmeta_len, gconstpointer dpdb_bytes, int32_t dpdb_len) { } + +#ifdef HOST_WASM + +#include + +//functions exported to be used by JS +G_BEGIN_DECLS + +EMSCRIPTEN_KEEPALIVE gboolean mono_wasm_send_dbg_command (int id, int command_set, int command, guint8* data, unsigned int size); +EMSCRIPTEN_KEEPALIVE gboolean mono_wasm_send_dbg_command_with_parms (int id, int command_set, int command, guint8* data, unsigned int size, int valtype, char* newvalue); + +G_END_DECLS + + +EMSCRIPTEN_KEEPALIVE gboolean +mono_wasm_send_dbg_command_with_parms (int id, int command_set, int command, guint8* data, unsigned int size, int valtype, char* newvalue) +{ + return false; +} + +EMSCRIPTEN_KEEPALIVE gboolean +mono_wasm_send_dbg_command (int id, int command_set, int command, guint8* data, unsigned int size) +{ + return false; +} + +#endif // HOST_WASM + + From dcd7149d5751943e5b00fd39ba7ab8529f0f8c7e Mon Sep 17 00:00:00 2001 From: Thays Date: Thu, 15 Jul 2021 14:20:15 -0300 Subject: [PATCH 7/8] Adding what @radical asked for. --- src/libraries/sendtohelixhelp.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/sendtohelixhelp.proj b/src/libraries/sendtohelixhelp.proj index 572481d7ccb80..fd9b2d4e674cb 100644 --- a/src/libraries/sendtohelixhelp.proj +++ b/src/libraries/sendtohelixhelp.proj @@ -377,7 +377,7 @@ <_WorkItem Include="$(TestArchiveRoot)runonly/**/WebAssembly.Browser.*.Test.zip" Condition="'$(TargetOS)' == 'Browser' and '$(Scenario)' == 'WasmTestOnBrowser'" /> <_WorkItem Include="$(TestArchiveRoot)browseronly/**/*.zip" Condition="'$(TargetOS)' == 'Browser' and '$(Scenario)' == 'WasmTestOnBrowser'" /> - + %(Identity) $(HelixCommand) $(_workItemTimeout) From d2bbe475e8dacdc4b0c33c0f54f6b83bfdfd6e88 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Thu, 15 Jul 2021 15:33:47 -0400 Subject: [PATCH 8/8] Update sendtohelixhelp.proj Fix helix work item prefix --- src/libraries/sendtohelixhelp.proj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/sendtohelixhelp.proj b/src/libraries/sendtohelixhelp.proj index fd9b2d4e674cb..af2885bbecde6 100644 --- a/src/libraries/sendtohelixhelp.proj +++ b/src/libraries/sendtohelixhelp.proj @@ -317,8 +317,8 @@ $([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'mono', 'wasm', 'build')) $([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'bin', 'NetCoreServer', '$(NetCoreAppCurrent)-$(Configuration)')) $([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'bin', 'RemoteLoopServer', '$(NetCoreAppCurrent)-$(Configuration)')) - Workloads/ - EMSDK/ + Workloads- + EMSDK-