From d62a165dd9e4ec1051f7fd49b6316252526a992b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Thu, 28 Mar 2024 14:17:48 +0100 Subject: [PATCH 1/8] Don't link icu for InvariantGlobalization=true --- src/mono/wasi/build/WasiApp.targets | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mono/wasi/build/WasiApp.targets b/src/mono/wasi/build/WasiApp.targets index b229d76dd71ff..cf9dc7add15cb 100644 --- a/src/mono/wasi/build/WasiApp.targets +++ b/src/mono/wasi/build/WasiApp.targets @@ -302,6 +302,9 @@ <_MonoRuntimeComponentDontLink Include="libmono-component-diagnostics_tracing-static.a" /> <_MonoRuntimeComponentDontLink Include="wasm-bundled-timezones.a" Condition="'$(InvariantTimezone)' == 'true'"/> + <_MonoRuntimeComponentDontLink Include="libicui18n.a" Condition="'$(InvariantGlobalization)' == 'true'" /> + <_MonoRuntimeComponentDontLink Include="libicudata.a" Condition="'$(InvariantGlobalization)' == 'true'" /> + <_MonoRuntimeComponentDontLink Include="libicuuc.a" Condition="'$(InvariantGlobalization)' == 'true'" /> <_WasmNativeFileForLinking Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)*.a" From 1fe2a4b93303d6c7875d9db909778d766e00e917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Thu, 28 Mar 2024 14:18:03 +0100 Subject: [PATCH 2/8] Don't link debugger for publish --- src/mono/wasi/build/WasiApp.targets | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mono/wasi/build/WasiApp.targets b/src/mono/wasi/build/WasiApp.targets index cf9dc7add15cb..65a9ca2cf22c2 100644 --- a/src/mono/wasi/build/WasiApp.targets +++ b/src/mono/wasi/build/WasiApp.targets @@ -305,6 +305,7 @@ <_MonoRuntimeComponentDontLink Include="libicui18n.a" Condition="'$(InvariantGlobalization)' == 'true'" /> <_MonoRuntimeComponentDontLink Include="libicudata.a" Condition="'$(InvariantGlobalization)' == 'true'" /> <_MonoRuntimeComponentDontLink Include="libicuuc.a" Condition="'$(InvariantGlobalization)' == 'true'" /> + <_MonoRuntimeComponentDontLink Include="libmono-component-debugger-static.a" Condition="'$(_IsPublishing)' == 'true'" /> <_WasmNativeFileForLinking Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)*.a" From 40c49e97cb2347f90a1420697a3d60dee062c543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Tue, 2 Apr 2024 11:23:13 +0200 Subject: [PATCH 3/8] Revert "Don't link icu for InvariantGlobalization=true" This reverts commit d62a165dd9e4ec1051f7fd49b6316252526a992b. # Conflicts: # src/mono/wasi/build/WasiApp.targets --- src/mono/wasi/build/WasiApp.targets | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/mono/wasi/build/WasiApp.targets b/src/mono/wasi/build/WasiApp.targets index 65a9ca2cf22c2..af080b29532a8 100644 --- a/src/mono/wasi/build/WasiApp.targets +++ b/src/mono/wasi/build/WasiApp.targets @@ -302,9 +302,6 @@ <_MonoRuntimeComponentDontLink Include="libmono-component-diagnostics_tracing-static.a" /> <_MonoRuntimeComponentDontLink Include="wasm-bundled-timezones.a" Condition="'$(InvariantTimezone)' == 'true'"/> - <_MonoRuntimeComponentDontLink Include="libicui18n.a" Condition="'$(InvariantGlobalization)' == 'true'" /> - <_MonoRuntimeComponentDontLink Include="libicudata.a" Condition="'$(InvariantGlobalization)' == 'true'" /> - <_MonoRuntimeComponentDontLink Include="libicuuc.a" Condition="'$(InvariantGlobalization)' == 'true'" /> <_MonoRuntimeComponentDontLink Include="libmono-component-debugger-static.a" Condition="'$(_IsPublishing)' == 'true'" /> <_WasmNativeFileForLinking From 81f585542da5a54fc8f787bec3b7da15eb2c8351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Thu, 4 Apr 2024 12:12:59 +0200 Subject: [PATCH 4/8] Drop in-tree setup. Solve the rest of the components --- src/mono/wasi/build/WasiApp.InTree.props | 8 -------- src/mono/wasi/build/WasiApp.targets | 18 +++++++++++++++--- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/mono/wasi/build/WasiApp.InTree.props b/src/mono/wasi/build/WasiApp.InTree.props index 894b17f646e38..b85fd737856dc 100644 --- a/src/mono/wasi/build/WasiApp.InTree.props +++ b/src/mono/wasi/build/WasiApp.InTree.props @@ -11,12 +11,4 @@ partial false - - - <_MonoRuntimeComponentDontLink Include="libmono-component-debugger-stub-static.a" /> - - <_MonoRuntimeComponentDontLink Include="libmono-component-diagnostics_tracing-static.a" Condition="'$(FeatureWasmPerfTracing)' != 'true' and $(FeatureWasmManagedThreads) != 'true'"/> - <_MonoRuntimeComponentDontLink Include="libmono-component-hot_reload-stub-static.a" /> - <_MonoRuntimeComponentDontLink Include="libmono-component-marshal-ilgen-stub-static.a" /> - diff --git a/src/mono/wasi/build/WasiApp.targets b/src/mono/wasi/build/WasiApp.targets index af080b29532a8..4615b2f104c39 100644 --- a/src/mono/wasi/build/WasiApp.targets +++ b/src/mono/wasi/build/WasiApp.targets @@ -296,13 +296,25 @@ <_WasmSIMDLibToExclude Condition="'$(WasmEnableSIMD)' == 'true'">libmono-wasm-nosimd.a + + + <_MonoRuntimeComponentDontLink Include="libmono-component-diagnostics_tracing-static.a" /> + <_MonoRuntimeComponentDontLink Include="libmono-component-marshal-ilgen-static.a" /> + <_MonoRuntimeComponentDontLink Include="wasm-bundled-timezones.a" Condition="'$(InvariantTimezone)' == 'true'"/> + + + <_MonoRuntimeComponentDontLink Include="libmono-component-debugger-static.a" /> + <_MonoRuntimeComponentDontLink Include="libmono-component-hot_reload-static.a" /> + + + <_MonoRuntimeComponentDontLink Include="libmono-component-debugger-stub-static.a" /> + <_MonoRuntimeComponentDontLink Include="libmono-component-hot_reload-stub-static.a" /> + + <_WasmNativeFileForLinking Include="%(_BitcodeFile.ObjectFile)" /> - <_MonoRuntimeComponentDontLink Include="libmono-component-diagnostics_tracing-static.a" /> - <_MonoRuntimeComponentDontLink Include="wasm-bundled-timezones.a" Condition="'$(InvariantTimezone)' == 'true'"/> - <_MonoRuntimeComponentDontLink Include="libmono-component-debugger-static.a" Condition="'$(_IsPublishing)' == 'true'" /> <_WasmNativeFileForLinking Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)*.a" From ba725737acfa9c7c7c7f9869e4bd01e8f4e4ee57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Thu, 4 Apr 2024 12:22:46 +0200 Subject: [PATCH 5/8] Incorporate WasmDebugLevel --- src/mono/wasi/build/WasiApp.targets | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mono/wasi/build/WasiApp.targets b/src/mono/wasi/build/WasiApp.targets index 4615b2f104c39..683f715d8d0e1 100644 --- a/src/mono/wasi/build/WasiApp.targets +++ b/src/mono/wasi/build/WasiApp.targets @@ -297,16 +297,23 @@ + + <_WasiDebuggerSupport Condition="'$(WasmDebugLevel)' != '' and '$(WasmDebugLevel)' != '0'">true + <_WasiDebuggerSupport Condition="'$(WasmDebugLevel)' != '' and '$(WasmDebugLevel)' == '0'">false + <_WasiDebuggerSupport Condition="'$(_WasiDebuggerSupport)' == '' and '$(WasmBuildingForNestedPublish)' == 'true'">false + <_WasiDebuggerSupport Condition="'$(_WasiDebuggerSupport)' == ''">true + + <_MonoRuntimeComponentDontLink Include="libmono-component-diagnostics_tracing-static.a" /> <_MonoRuntimeComponentDontLink Include="libmono-component-marshal-ilgen-static.a" /> <_MonoRuntimeComponentDontLink Include="wasm-bundled-timezones.a" Condition="'$(InvariantTimezone)' == 'true'"/> - + <_MonoRuntimeComponentDontLink Include="libmono-component-debugger-static.a" /> <_MonoRuntimeComponentDontLink Include="libmono-component-hot_reload-static.a" /> - + <_MonoRuntimeComponentDontLink Include="libmono-component-debugger-stub-static.a" /> <_MonoRuntimeComponentDontLink Include="libmono-component-hot_reload-stub-static.a" /> From dd01c5217303bfcfc8dadbe0339b36a0564a5a56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Mon, 8 Apr 2024 14:15:44 +0200 Subject: [PATCH 6/8] Hook MonoSelectRuntimeComponents. Unify component selection --- src/mono/wasi/build/WasiApp.targets | 22 ++-------------------- src/mono/wasm/build/WasmApp.Common.targets | 16 +++++++++++----- 2 files changed, 13 insertions(+), 25 deletions(-) diff --git a/src/mono/wasi/build/WasiApp.targets b/src/mono/wasi/build/WasiApp.targets index 683f715d8d0e1..33067810129b0 100644 --- a/src/mono/wasi/build/WasiApp.targets +++ b/src/mono/wasi/build/WasiApp.targets @@ -261,7 +261,7 @@ @@ -296,27 +296,9 @@ <_WasmSIMDLibToExclude Condition="'$(WasmEnableSIMD)' == 'true'">libmono-wasm-nosimd.a - - - <_WasiDebuggerSupport Condition="'$(WasmDebugLevel)' != '' and '$(WasmDebugLevel)' != '0'">true - <_WasiDebuggerSupport Condition="'$(WasmDebugLevel)' != '' and '$(WasmDebugLevel)' == '0'">false - <_WasiDebuggerSupport Condition="'$(_WasiDebuggerSupport)' == '' and '$(WasmBuildingForNestedPublish)' == 'true'">false - <_WasiDebuggerSupport Condition="'$(_WasiDebuggerSupport)' == ''">true - - - <_MonoRuntimeComponentDontLink Include="libmono-component-diagnostics_tracing-static.a" /> - <_MonoRuntimeComponentDontLink Include="libmono-component-marshal-ilgen-static.a" /> <_MonoRuntimeComponentDontLink Include="wasm-bundled-timezones.a" Condition="'$(InvariantTimezone)' == 'true'"/> - - <_MonoRuntimeComponentDontLink Include="libmono-component-debugger-static.a" /> - <_MonoRuntimeComponentDontLink Include="libmono-component-hot_reload-static.a" /> - - - <_MonoRuntimeComponentDontLink Include="libmono-component-debugger-stub-static.a" /> - <_MonoRuntimeComponentDontLink Include="libmono-component-hot_reload-stub-static.a" /> - @@ -460,4 +442,4 @@ wasi.start(instance); - + \ No newline at end of file diff --git a/src/mono/wasm/build/WasmApp.Common.targets b/src/mono/wasm/build/WasmApp.Common.targets index 5c7e4353fee0a..a8fc2ad7a824c 100644 --- a/src/mono/wasm/build/WasmApp.Common.targets +++ b/src/mono/wasm/build/WasmApp.Common.targets @@ -251,9 +251,16 @@ - - - <_MonoComponent Include="hot_reload;debugger" /> + + + <_WasmDebuggerSupport Condition="'$(WasmDebugLevel)' != '' and '$(WasmDebugLevel)' != '0'">true + <_WasmDebuggerSupport Condition="'$(WasmDebugLevel)' != '' and '$(WasmDebugLevel)' == '0'">false + <_WasmDebuggerSupport Condition="'$(_WasmDebuggerSupport)' == '' and '$(WasmBuildingForNestedPublish)' == 'true'">false + <_WasmDebuggerSupport Condition="'$(_WasmDebuggerSupport)' == ''">true + + + <_MonoComponent Include="debugger" /> + <_MonoComponent Include="hot_reload" /> @@ -508,7 +515,6 @@ <_WasmBuildNativeRequired Condition="@(_ChangedBoolPropertiesThatTriggerRelinking->Count()) > 0">true - @@ -590,7 +596,7 @@ - + <_AssembliesToScan Include="@(_WasmAssembliesInternal)" /> From d577697252e3fa5b7ade15d25f23b8f2e7e45430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Mon, 8 Apr 2024 20:02:43 +0200 Subject: [PATCH 7/8] Fix merge damage --- src/mono/wasm/build/WasmApp.Common.targets | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mono/wasm/build/WasmApp.Common.targets b/src/mono/wasm/build/WasmApp.Common.targets index a8fc2ad7a824c..7e4c7d343417f 100644 --- a/src/mono/wasm/build/WasmApp.Common.targets +++ b/src/mono/wasm/build/WasmApp.Common.targets @@ -515,6 +515,7 @@ <_WasmBuildNativeRequired Condition="@(_ChangedBoolPropertiesThatTriggerRelinking->Count()) > 0">true + From 58ea1feac5ab1885f5b9ac8b0aca7ab1b11ae691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Wed, 10 Apr 2024 13:48:06 +0200 Subject: [PATCH 8/8] Conditional mono targets --- src/mono/wasi/build/WasiApp.targets | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/mono/wasi/build/WasiApp.targets b/src/mono/wasi/build/WasiApp.targets index 33067810129b0..37d6d40d1f172 100644 --- a/src/mono/wasi/build/WasiApp.targets +++ b/src/mono/wasi/build/WasiApp.targets @@ -23,6 +23,16 @@ _WasmGenerateNodeScripts; + + $(WasiWriteRspForLinkingDependsOn); + _WasmSelectRuntimeComponentsForLinking; + _WasiGetWasiOutputFileName; + + + $(WasiWriteRspForLinkingDependsOn); + _MonoSelectRuntimeComponents; + + true @@ -261,7 +271,7 @@ @@ -298,6 +308,7 @@ <_MonoRuntimeComponentDontLink Include="wasm-bundled-timezones.a" Condition="'$(InvariantTimezone)' == 'true'"/> + <_MonoRuntimeComponentDontLink Include="libmono-component-diagnostics_tracing-static.a" Condition="'$(UsingWasiRuntimeWorkload)' != 'true'" />