From bddc91b5b0f08ce8e9136dd898ceec1962b0425e Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Wed, 7 Feb 2024 12:24:22 +0100 Subject: [PATCH 01/20] Add error when WasmBuildNative is explicitly false during single-file build --- src/mono/wasm/build/WasmApp.Common.targets | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mono/wasm/build/WasmApp.Common.targets b/src/mono/wasm/build/WasmApp.Common.targets index 3f3a97fff9b3fd..e9e6d8bf0f3165 100644 --- a/src/mono/wasm/build/WasmApp.Common.targets +++ b/src/mono/wasm/build/WasmApp.Common.targets @@ -495,6 +495,9 @@ ('$(RunAOTCompilationAfterBuild)' == 'true' or '$(WasmBuildingForNestedPublish)' == 'true') and '$(_IsToolchainMissing)' == 'true'" Text="$(_ToolchainMissingErrorMessage) SDK is required for AOT'ing assemblies." /> + + <_BoolPropertiesThatTriggerRelinking Include="InvariantTimezone" DefaultValueInRuntimePack="false" /> From 7b578c48672aac1769322b1ef80ce3e2a09c774d Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Wed, 7 Feb 2024 12:26:13 +0100 Subject: [PATCH 02/20] Remove the space --- src/mono/wasm/build/WasmApp.Common.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/wasm/build/WasmApp.Common.targets b/src/mono/wasm/build/WasmApp.Common.targets index e9e6d8bf0f3165..599b82e21c273a 100644 --- a/src/mono/wasm/build/WasmApp.Common.targets +++ b/src/mono/wasm/build/WasmApp.Common.targets @@ -495,7 +495,7 @@ ('$(RunAOTCompilationAfterBuild)' == 'true' or '$(WasmBuildingForNestedPublish)' == 'true') and '$(_IsToolchainMissing)' == 'true'" Text="$(_ToolchainMissingErrorMessage) SDK is required for AOT'ing assemblies." /> - + From 9e49413bff7a0f189f1fbba45441865e99e5fec1 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Wed, 7 Feb 2024 13:39:03 +0100 Subject: [PATCH 03/20] Add WasmSingleFileBundle to _BoolPropertiesThatTriggerRelinking --- src/mono/wasm/build/WasmApp.Common.targets | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mono/wasm/build/WasmApp.Common.targets b/src/mono/wasm/build/WasmApp.Common.targets index 599b82e21c273a..20450f954d0611 100644 --- a/src/mono/wasm/build/WasmApp.Common.targets +++ b/src/mono/wasm/build/WasmApp.Common.targets @@ -502,6 +502,7 @@ <_BoolPropertiesThatTriggerRelinking Include="InvariantTimezone" DefaultValueInRuntimePack="false" /> <_BoolPropertiesThatTriggerRelinking Include="InvariantGlobalization" DefaultValueInRuntimePack="false" /> + <_BoolPropertiesThatTriggerRelinking Include="WasmSingleFileBundle" DefaultValueInRuntimePack="false" /> @@ -516,7 +517,6 @@ true true - true @@ -524,7 +524,6 @@ true true - true false From 88fb7ed2d18f1df157c4cf6a783b4891eb1f38b5 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Wed, 7 Feb 2024 17:09:32 +0100 Subject: [PATCH 04/20] Move common _BoolPropertiesThatTriggerRelinking to WasmApp.Common.targets --- src/mono/browser/build/BrowserWasmApp.targets | 1 - src/mono/wasi/build/WasiApp.targets | 1 - src/mono/wasm/build/WasmApp.Common.targets | 1 + 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mono/browser/build/BrowserWasmApp.targets b/src/mono/browser/build/BrowserWasmApp.targets index 7655c5baa55d61..caa9f5df5bb422 100644 --- a/src/mono/browser/build/BrowserWasmApp.targets +++ b/src/mono/browser/build/BrowserWasmApp.targets @@ -64,7 +64,6 @@ <_BoolPropertiesThatTriggerRelinking Include="WasmEnableSIMD" DefaultValueInRuntimePack="true" /> <_BoolPropertiesThatTriggerRelinking Include="WasmEnableExceptionHandling" DefaultValueInRuntimePack="true" /> - <_BoolPropertiesThatTriggerRelinking Include="WasmNativeStrip" DefaultValueInRuntimePack="true" /> diff --git a/src/mono/wasi/build/WasiApp.targets b/src/mono/wasi/build/WasiApp.targets index e54fbe4f89ac1a..9c2e80d83eee8d 100644 --- a/src/mono/wasi/build/WasiApp.targets +++ b/src/mono/wasi/build/WasiApp.targets @@ -39,7 +39,6 @@ <_BoolPropertiesThatTriggerRelinking Include="WasmEnableSIMD" DefaultValueInRuntimePack="false" /> - <_BoolPropertiesThatTriggerRelinking Include="WasmNativeStrip" DefaultValueInRuntimePack="true" /> diff --git a/src/mono/wasm/build/WasmApp.Common.targets b/src/mono/wasm/build/WasmApp.Common.targets index 20450f954d0611..d7602e778402bf 100644 --- a/src/mono/wasm/build/WasmApp.Common.targets +++ b/src/mono/wasm/build/WasmApp.Common.targets @@ -502,6 +502,7 @@ <_BoolPropertiesThatTriggerRelinking Include="InvariantTimezone" DefaultValueInRuntimePack="false" /> <_BoolPropertiesThatTriggerRelinking Include="InvariantGlobalization" DefaultValueInRuntimePack="false" /> + <_BoolPropertiesThatTriggerRelinking Include="WasmNativeStrip" DefaultValueInRuntimePack="true" /> <_BoolPropertiesThatTriggerRelinking Include="WasmSingleFileBundle" DefaultValueInRuntimePack="false" /> From 00af6ddfc7e7b214bdbac1e0d368478907e3cee4 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Thu, 8 Feb 2024 14:08:03 +0100 Subject: [PATCH 05/20] Implement general rule for WasmBuildNative=false --- src/mono/wasm/build/WasmApp.Common.targets | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/mono/wasm/build/WasmApp.Common.targets b/src/mono/wasm/build/WasmApp.Common.targets index d7602e778402bf..43e93a17ac427e 100644 --- a/src/mono/wasm/build/WasmApp.Common.targets +++ b/src/mono/wasm/build/WasmApp.Common.targets @@ -496,20 +496,25 @@ '$(_IsToolchainMissing)' == 'true'" Text="$(_ToolchainMissingErrorMessage) SDK is required for AOT'ing assemblies." /> - - <_BoolPropertiesThatTriggerRelinking Include="InvariantTimezone" DefaultValueInRuntimePack="false" /> <_BoolPropertiesThatTriggerRelinking Include="InvariantGlobalization" DefaultValueInRuntimePack="false" /> <_BoolPropertiesThatTriggerRelinking Include="WasmNativeStrip" DefaultValueInRuntimePack="true" /> <_BoolPropertiesThatTriggerRelinking Include="WasmSingleFileBundle" DefaultValueInRuntimePack="false" /> + <_WasmChangedProperty Include="%(_BoolPropertiesThatTriggerRelinking.Identity)" Condition="'$(%(_BoolPropertiesThatTriggerRelinking.Identity))' != '' and + '$(%(_BoolPropertiesThatTriggerRelinking.Identity))' != '%(_BoolPropertiesThatTriggerRelinking.DefaultValueInRuntimePack)'" /> - true + <_WasmBuildNativeRequired Condition="'$(%(_BoolPropertiesThatTriggerRelinking.Identity))' != '' and + '$(%(_BoolPropertiesThatTriggerRelinking.Identity))' != '%(_BoolPropertiesThatTriggerRelinking.DefaultValueInRuntimePack)'">true + + + + + + true From dc06c883a1bd12f82f64c7231efc2382ee798d41 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Fri, 9 Feb 2024 10:06:37 +0100 Subject: [PATCH 06/20] Remove WasmBuildNative=false for trimmin tests --- eng/pipelines/libraries/execute-trimming-tests-steps.yml | 3 +-- eng/pipelines/runtime-linker-tests.yml | 4 +--- src/mono/wasm/build/WasmApp.Common.targets | 9 ++++----- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/eng/pipelines/libraries/execute-trimming-tests-steps.yml b/eng/pipelines/libraries/execute-trimming-tests-steps.yml index 567abab0bb984e..eae0a9c82c03da 100644 --- a/eng/pipelines/libraries/execute-trimming-tests-steps.yml +++ b/eng/pipelines/libraries/execute-trimming-tests-steps.yml @@ -1,8 +1,7 @@ parameters: archType: '' - extraTestArgs: '' steps: # Execute tests - - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) -s libs.tests -c $(_BuildConfig) $(crossArg) /p:TestAssemblies=false /p:TestTrimming=true $(_officialBuildParameter) /bl:$(Build.SourcesDirectory)/artifacts/log/$(buildConfigUpper)/TrimmingTests.binlog ${{ parameters.extraTestArgs }} + - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) -s libs.tests -c $(_BuildConfig) $(crossArg) /p:TestAssemblies=false /p:TestTrimming=true $(_officialBuildParameter) /bl:$(Build.SourcesDirectory)/artifacts/log/$(buildConfigUpper)/TrimmingTests.binlog displayName: Run Trimming Tests diff --git a/eng/pipelines/runtime-linker-tests.yml b/eng/pipelines/runtime-linker-tests.yml index 3ae027a5f3e71a..6f09e7a4c7ecab 100644 --- a/eng/pipelines/runtime-linker-tests.yml +++ b/eng/pipelines/runtime-linker-tests.yml @@ -124,7 +124,7 @@ extends: testGroup: innerloop timeoutInMinutes: 120 nameSuffix: Runtime_Release - buildArgs: -s mono+libs+tools.illink -c $(_BuildConfig) -p:WasmBuildNative=false -p:AotHostArchitecture=x64 -p:AotHostOS=$(_hostedOS) + buildArgs: -s mono+libs+tools.illink -c $(_BuildConfig) -p:AotHostArchitecture=x64 -p:AotHostOS=$(_hostedOS) condition: or( eq(variables['isRollingBuild'], true), @@ -134,5 +134,3 @@ extends: eq(dependencies.evaluate_paths.outputs['DarcDependenciesChanged.Microsoft_NET_ILLink_Tasks'], true)) postBuildSteps: - template: /eng/pipelines/libraries/execute-trimming-tests-steps.yml - parameters: - extraTestArgs: '/p:WasmBuildNative=false' diff --git a/src/mono/wasm/build/WasmApp.Common.targets b/src/mono/wasm/build/WasmApp.Common.targets index 43e93a17ac427e..c81b8c578a0940 100644 --- a/src/mono/wasm/build/WasmApp.Common.targets +++ b/src/mono/wasm/build/WasmApp.Common.targets @@ -501,17 +501,16 @@ <_BoolPropertiesThatTriggerRelinking Include="InvariantGlobalization" DefaultValueInRuntimePack="false" /> <_BoolPropertiesThatTriggerRelinking Include="WasmNativeStrip" DefaultValueInRuntimePack="true" /> <_BoolPropertiesThatTriggerRelinking Include="WasmSingleFileBundle" DefaultValueInRuntimePack="false" /> - <_WasmChangedProperty Include="%(_BoolPropertiesThatTriggerRelinking.Identity)" Condition="'$(%(_BoolPropertiesThatTriggerRelinking.Identity))' != '' and - '$(%(_BoolPropertiesThatTriggerRelinking.Identity))' != '%(_BoolPropertiesThatTriggerRelinking.DefaultValueInRuntimePack)'" /> + <_ChangedBoolPropertiesThatTriggerRelinking Include="%(_BoolPropertiesThatTriggerRelinking.Identity)" Condition="'$(%(_BoolPropertiesThatTriggerRelinking.Identity))' != '' and + '$(%(_BoolPropertiesThatTriggerRelinking.Identity))' != '%(_BoolPropertiesThatTriggerRelinking.DefaultValueInRuntimePack)'" /> - <_WasmBuildNativeRequired Condition="'$(%(_BoolPropertiesThatTriggerRelinking.Identity))' != '' and - '$(%(_BoolPropertiesThatTriggerRelinking.Identity))' != '%(_BoolPropertiesThatTriggerRelinking.DefaultValueInRuntimePack)'">true + <_WasmBuildNativeRequired Condition="@(_ChangedBoolPropertiesThatTriggerRelinking->Count()) > 0">true + Text="WasmBuildNative is required because %(_ChangedBoolPropertiesThatTriggerRelinking.Identity)=$(%(_ChangedBoolPropertiesThatTriggerRelinking.Identity)), but WasmBuildNative is already set to 'false'." /> true From dd84cc5b8cc92ea1cb6b1f8d6796fae371bdb57f Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Tue, 13 Feb 2024 10:10:32 +0100 Subject: [PATCH 07/20] import MonoAotCrossCompiler --- eng/pipelines/libraries/execute-trimming-tests-steps.yml | 3 ++- eng/pipelines/runtime-linker-tests.yml | 4 +++- eng/targetingpacks.targets | 5 +++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/libraries/execute-trimming-tests-steps.yml b/eng/pipelines/libraries/execute-trimming-tests-steps.yml index eae0a9c82c03da..567abab0bb984e 100644 --- a/eng/pipelines/libraries/execute-trimming-tests-steps.yml +++ b/eng/pipelines/libraries/execute-trimming-tests-steps.yml @@ -1,7 +1,8 @@ parameters: archType: '' + extraTestArgs: '' steps: # Execute tests - - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) -s libs.tests -c $(_BuildConfig) $(crossArg) /p:TestAssemblies=false /p:TestTrimming=true $(_officialBuildParameter) /bl:$(Build.SourcesDirectory)/artifacts/log/$(buildConfigUpper)/TrimmingTests.binlog + - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) -s libs.tests -c $(_BuildConfig) $(crossArg) /p:TestAssemblies=false /p:TestTrimming=true $(_officialBuildParameter) /bl:$(Build.SourcesDirectory)/artifacts/log/$(buildConfigUpper)/TrimmingTests.binlog ${{ parameters.extraTestArgs }} displayName: Run Trimming Tests diff --git a/eng/pipelines/runtime-linker-tests.yml b/eng/pipelines/runtime-linker-tests.yml index 6f09e7a4c7ecab..1ceb0e74bdbd10 100644 --- a/eng/pipelines/runtime-linker-tests.yml +++ b/eng/pipelines/runtime-linker-tests.yml @@ -124,7 +124,7 @@ extends: testGroup: innerloop timeoutInMinutes: 120 nameSuffix: Runtime_Release - buildArgs: -s mono+libs+tools.illink -c $(_BuildConfig) -p:AotHostArchitecture=x64 -p:AotHostOS=$(_hostedOS) + buildArgs: -s mono+libs+tools.illink -c $(_BuildConfig) -p:WasmNativeStrip=false -p:AotHostArchitecture=x64 -p:AotHostOS=$(_hostedOS) condition: or( eq(variables['isRollingBuild'], true), @@ -134,3 +134,5 @@ extends: eq(dependencies.evaluate_paths.outputs['DarcDependenciesChanged.Microsoft_NET_ILLink_Tasks'], true)) postBuildSteps: - template: /eng/pipelines/libraries/execute-trimming-tests-steps.yml + parameters: + extraTestArgs: '/p:WasmNativeStrip=false' diff --git a/eng/targetingpacks.targets b/eng/targetingpacks.targets index befd249f231d2a..cf2c90259d9345 100644 --- a/eng/targetingpacks.targets +++ b/eng/targetingpacks.targets @@ -36,6 +36,11 @@ $(UseLocalTargetingRuntimePack) + + + + + Date: Tue, 13 Feb 2024 11:07:50 +0100 Subject: [PATCH 08/20] Revert back explicitly setting false WasmBuildNative --- eng/pipelines/runtime-linker-tests.yml | 4 ++-- eng/targetingpacks.targets | 5 ----- .../TrimmingTests/System.Runtime.TrimmingTests.proj | 3 +++ 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/eng/pipelines/runtime-linker-tests.yml b/eng/pipelines/runtime-linker-tests.yml index 1ceb0e74bdbd10..3ae027a5f3e71a 100644 --- a/eng/pipelines/runtime-linker-tests.yml +++ b/eng/pipelines/runtime-linker-tests.yml @@ -124,7 +124,7 @@ extends: testGroup: innerloop timeoutInMinutes: 120 nameSuffix: Runtime_Release - buildArgs: -s mono+libs+tools.illink -c $(_BuildConfig) -p:WasmNativeStrip=false -p:AotHostArchitecture=x64 -p:AotHostOS=$(_hostedOS) + buildArgs: -s mono+libs+tools.illink -c $(_BuildConfig) -p:WasmBuildNative=false -p:AotHostArchitecture=x64 -p:AotHostOS=$(_hostedOS) condition: or( eq(variables['isRollingBuild'], true), @@ -135,4 +135,4 @@ extends: postBuildSteps: - template: /eng/pipelines/libraries/execute-trimming-tests-steps.yml parameters: - extraTestArgs: '/p:WasmNativeStrip=false' + extraTestArgs: '/p:WasmBuildNative=false' diff --git a/eng/targetingpacks.targets b/eng/targetingpacks.targets index cf2c90259d9345..befd249f231d2a 100644 --- a/eng/targetingpacks.targets +++ b/eng/targetingpacks.targets @@ -36,11 +36,6 @@ $(UseLocalTargetingRuntimePack) - - - - - + + <_BoolPropertiesThatTriggerRelinking Remove="InvariantGlobalization" /> + From 15941924fab5a4a185587c7a146258a280551c4c Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Tue, 13 Feb 2024 15:21:14 +0100 Subject: [PATCH 09/20] Remove InvariantGlobalization from _BoolPropertiesThatTriggerRelinking for browser trimming tests --- eng/testing/linker/trimmingTests.targets | 4 ++++ .../TrimmingTests/System.Runtime.TrimmingTests.proj | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/eng/testing/linker/trimmingTests.targets b/eng/testing/linker/trimmingTests.targets index 926bafa52cfef4..fd0050a9c0ed17 100644 --- a/eng/testing/linker/trimmingTests.targets +++ b/eng/testing/linker/trimmingTests.targets @@ -43,6 +43,10 @@ + + + <_BoolPropertiesThatTriggerRelinking Remove="InvariantGlobalization" /> + - - <_BoolPropertiesThatTriggerRelinking Remove="InvariantGlobalization" /> - From 5492af34d20010530b4933acfca6d9466af995b2 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Tue, 13 Feb 2024 16:15:26 +0100 Subject: [PATCH 10/20] exclude invariantglobalization from error --- eng/testing/linker/trimmingTests.targets | 4 ---- src/mono/wasm/build/WasmApp.Common.targets | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/eng/testing/linker/trimmingTests.targets b/eng/testing/linker/trimmingTests.targets index fd0050a9c0ed17..926bafa52cfef4 100644 --- a/eng/testing/linker/trimmingTests.targets +++ b/eng/testing/linker/trimmingTests.targets @@ -43,10 +43,6 @@ - - - <_BoolPropertiesThatTriggerRelinking Remove="InvariantGlobalization" /> - <_WasmBuildNativeRequired Condition="@(_ChangedBoolPropertiesThatTriggerRelinking->Count()) > 0">true - - + From e458b88e5e41a8ee1257f011caa6fba33803472f Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Wed, 14 Feb 2024 12:47:45 +0100 Subject: [PATCH 11/20] Try to enable WasmBuildNative only for InvariantGlobalizationTrue tests --- .../System.Runtime.TrimmingTests.proj | 16 ++++++++++++---- src/mono/wasm/build/WasmApp.Common.targets | 5 ++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/TrimmingTests/System.Runtime.TrimmingTests.proj b/src/libraries/System.Runtime/tests/System.Runtime.Tests/TrimmingTests/System.Runtime.TrimmingTests.proj index c786baba78e379..48573df193ed18 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/TrimmingTests/System.Runtime.TrimmingTests.proj +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/TrimmingTests/System.Runtime.TrimmingTests.proj @@ -23,10 +23,6 @@ InvariantGlobalization - - HybridGlobalization - InvariantGlobalization;PredefinedCulturesOnly - - From 9a61a09fb0200eb8cf48292ecd9f45b03f80e045 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Wed, 14 Feb 2024 13:24:11 +0100 Subject: [PATCH 12/20] Remove InvariantGlobalization from trigger relinking for browser --- .../System.Runtime.TrimmingTests.proj | 19 +++++++------------ src/mono/wasm/build/WasmApp.Common.targets | 11 +++++++---- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/TrimmingTests/System.Runtime.TrimmingTests.proj b/src/libraries/System.Runtime/tests/System.Runtime.Tests/TrimmingTests/System.Runtime.TrimmingTests.proj index 48573df193ed18..faf71025e169da 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/TrimmingTests/System.Runtime.TrimmingTests.proj +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/TrimmingTests/System.Runtime.TrimmingTests.proj @@ -1,5 +1,8 @@ + + <_BoolPropertiesThatTriggerRelinking Remove="InvariantGlobalization" /> + @@ -23,6 +26,10 @@ InvariantGlobalization + + HybridGlobalization + InvariantGlobalization;PredefinedCulturesOnly +