From 6fbb491d1ce054af10c1d59c4c2e97077dea3024 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 10 Mar 2021 12:40:11 -0500 Subject: [PATCH 01/14] [wasm] reduce visibility of `[AOT] /foo/bar.dll` messages --- src/tasks/AotCompilerTask/MonoAOTCompiler.cs | 5 +++-- src/tasks/Common/Utils.cs | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/tasks/AotCompilerTask/MonoAOTCompiler.cs b/src/tasks/AotCompilerTask/MonoAOTCompiler.cs index f540896e101fc8..8e04dfd2f6fb7c 100644 --- a/src/tasks/AotCompilerTask/MonoAOTCompiler.cs +++ b/src/tasks/AotCompilerTask/MonoAOTCompiler.cs @@ -255,7 +255,7 @@ private bool PrecompileLibrary(ITaskItem assemblyItem, string? monoPaths) processArgs.AddRange(p.Split(";", StringSplitOptions.RemoveEmptyEntries)); } - Utils.LogInfo($"[AOT] {assembly}"); + Log.LogMessage(MessageImportance.Low, $"[AOT] {assembly}"); processArgs.Add("--debug"); @@ -361,7 +361,8 @@ private bool PrecompileLibrary(ITaskItem assemblyItem, string? monoPaths) try { // run the AOT compiler - Utils.RunProcess(CompilerBinaryPath, string.Join(" ", processArgs), envVariables, assemblyDir, silent: false, outputMessageImportance: MessageImportance.Low); + Utils.RunProcess(CompilerBinaryPath, string.Join(" ", processArgs), envVariables, assemblyDir, silent: false, + outputMessageImportance: MessageImportance.Low, debugMessageImportance: MessageImportance.Low); } catch (Exception ex) { diff --git a/src/tasks/Common/Utils.cs b/src/tasks/Common/Utils.cs index 6ed889a483b7bf..0adc13170b7e09 100644 --- a/src/tasks/Common/Utils.cs +++ b/src/tasks/Common/Utils.cs @@ -28,9 +28,10 @@ public static string RunProcess( string? workingDir = null, bool ignoreErrors = false, bool silent = true, - MessageImportance outputMessageImportance=MessageImportance.High) + MessageImportance outputMessageImportance=MessageImportance.High, + MessageImportance debugMessageImportance=MessageImportance.High) { - LogInfo($"Running: {path} {args}"); + LogInfo($"Running: {path} {args}", debugMessageImportance); var outputBuilder = new StringBuilder(); var errorBuilder = new StringBuilder(); var processStartInfo = new ProcessStartInfo @@ -46,7 +47,7 @@ public static string RunProcess( if (workingDir != null) processStartInfo.WorkingDirectory = workingDir; - LogInfo($"Using working directory: {workingDir ?? Environment.CurrentDirectory}", MessageImportance.Low); + LogInfo($"Using working directory: {workingDir ?? Environment.CurrentDirectory}", debugMessageImportance); if (envVars != null) { From ca2718e87e72ef89c065ea3b6664859ac46e4960 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 10 Mar 2021 12:41:11 -0500 Subject: [PATCH 02/14] [wasm] Quote assembly path when invoking mono-aot-cross --- src/tasks/AotCompilerTask/MonoAOTCompiler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tasks/AotCompilerTask/MonoAOTCompiler.cs b/src/tasks/AotCompilerTask/MonoAOTCompiler.cs index 8e04dfd2f6fb7c..d7a7ab69674893 100644 --- a/src/tasks/AotCompilerTask/MonoAOTCompiler.cs +++ b/src/tasks/AotCompilerTask/MonoAOTCompiler.cs @@ -350,7 +350,7 @@ private bool PrecompileLibrary(ITaskItem assemblyItem, string? monoPaths) // values, which wont work. processArgs.Add($"\"--aot={string.Join(",", aotArgs)}\""); - processArgs.Add(assemblyFilename); + processArgs.Add($"\"{assemblyFilename}\""); var envVariables = new Dictionary { From ed17d82adc1e1b3b8c7a5cad98b0ffc5f9928036 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 10 Mar 2021 12:45:32 -0500 Subject: [PATCH 03/14] [wasm] WasmApp.*: Use the msbuild equivalent of `Path.Combine` in .. the targets/props . --- src/mono/wasm/build/WasmApp.InTree.props | 4 +-- src/mono/wasm/build/WasmApp.InTree.targets | 10 +++--- src/mono/wasm/build/WasmApp.LocalBuild.props | 15 ++++---- .../wasm/build/WasmApp.LocalBuild.targets | 10 ++++++ src/mono/wasm/build/WasmApp.targets | 34 +++++++++++-------- 5 files changed, 44 insertions(+), 29 deletions(-) diff --git a/src/mono/wasm/build/WasmApp.InTree.props b/src/mono/wasm/build/WasmApp.InTree.props index f9540f1fac7a2b..87bcc072cf1ddc 100644 --- a/src/mono/wasm/build/WasmApp.InTree.props +++ b/src/mono/wasm/build/WasmApp.InTree.props @@ -6,8 +6,8 @@ AnyCPU false $(NetCoreAppToolCurrent) - $(ArtifactsBinDir)microsoft.netcore.app.runtime.browser-wasm\$(Configuration)\runtimes\browser-wasm\ - $(MonoProjectRoot)wasm\emsdk + $([MSBuild]::NormalizeDirectory($(ArtifactsBinDir), 'microsoft.netcore.app.runtime.browser-wasm', $(Configuration), 'runtimes', 'browser-wasm')) + $([MSBuild]::NormalizeDirectory($(MonoProjectRoot), 'wasm', 'emsdk')) false true diff --git a/src/mono/wasm/build/WasmApp.InTree.targets b/src/mono/wasm/build/WasmApp.InTree.targets index d7009c76275d2c..cde8075f0874c5 100644 --- a/src/mono/wasm/build/WasmApp.InTree.targets +++ b/src/mono/wasm/build/WasmApp.InTree.targets @@ -8,7 +8,7 @@ - $(ArtifactsBinDir)microsoft.netcore.app.runtime.browser-wasm\$(Configuration) + $([MSBuild]::NormalizeDirectory($(ArtifactsBinDir), 'microsoft.netcore.app.runtime.browser-wasm', $(Configuration))) @@ -16,7 +16,7 @@ - + $(TargetOS).AnyCPU.$(Configuration) - $(ArtifactsDir)helix/ - $(HelixArchiveRoot)runonly/ - $(HelixArchiveRunOnlyRoot)$(OSPlatformConfig)/$(WasmHelixTestAppRelativeDir)/ + $([MSBuild]::NormalizeDirectory($(ArtifactsDir), 'helix')) + $([MSBuild]::NormalizeDirectory($(HelixArchiveRoot), 'runonly')) + $([MSBuild]::NormalizeDirectory($(HelixArchiveRunOnlyRoot), $(OSPlatformConfig), $(WasmHelixTestAppRelativeDir))) $(OutputPath)$(AssemblyName).zip diff --git a/src/mono/wasm/build/WasmApp.LocalBuild.props b/src/mono/wasm/build/WasmApp.LocalBuild.props index a56d7137dac890..62260419edf93c 100644 --- a/src/mono/wasm/build/WasmApp.LocalBuild.props +++ b/src/mono/wasm/build/WasmApp.LocalBuild.props @@ -29,7 +29,7 @@ $(RuntimeSrcDir)\artifacts\bin\ $(RuntimeSrcDir)\src\mono\wasm\emsdk\ - $(ArtifactsBinDir)microsoft.netcore.app.runtime.browser-wasm\$(RuntimeConfig)\ + $([MSBuild]::NormalizeDirectory($(ArtifactsBinDir), 'microsoft.netcore.app.runtime.browser-wasm', $(RuntimeConfig))) $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'WasmAppBuilder', 'Debug', '$(_NetCoreAppToolCurrent)', 'publish')) $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'WasmBuildTasks', 'Debug', '$(_NetCoreAppToolCurrent)', 'publish')) @@ -39,19 +39,20 @@ $(WasmBuildSupportDir)\ - $(BuildBaseDir)microsoft.netcore.app.runtime.browser-wasm\ - $(BuildBaseDir)\MonoAOTCompiler\ - $(BuildBaseDir)\WasmAppBuilder\ - $(BuildBaseDir)\WasmBuildTasks\ + $([MSBuild]::NormalizeDirectory($(BuildBaseDir), 'microsoft.netcore.app.runtime.browser-wasm')) + $([MSBuild]::NormalizeDirectory($(BuildBaseDir), 'MonoAOTCompiler')) + $([MSBuild]::NormalizeDirectory($(BuildBaseDir)', WasmAppBuilder')) + $([MSBuild]::NormalizeDirectory($(BuildBaseDir), 'WasmBuildTasks')) - $(MicrosoftNetCoreAppRuntimePackLocationToUse)runtimes\browser-wasm\ - $(MicrosoftNetCoreAppRuntimePackRidDir)native\cross\$(RuntimeIdentifier)\mono-aot-cross + $([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackLocationToUse), 'runtimes', 'browser-wasm')) + $([MSBuild]::NormalizePath($(MicrosoftNetCoreAppRuntimePackRidDir), 'native', 'cross', $(RuntimeIdentifier), 'mono-aot-cross')) $(MonoAotCrossCompilerPath).exe $([MSBuild]::NormalizePath('$(WasmAppBuilderDir)', 'WasmAppBuilder.dll')) $([MSBuild]::NormalizePath('$(WasmBuildTasksDir)', 'WasmBuildTasks.dll')) $([MSBuild]::NormalizePath('$(MonoAOTCompilerDir)', 'MonoAOTCompiler.dll')) + diff --git a/src/mono/wasm/build/WasmApp.LocalBuild.targets b/src/mono/wasm/build/WasmApp.LocalBuild.targets index cc2c752a730f1f..9fdf8de6739bc2 100644 --- a/src/mono/wasm/build/WasmApp.LocalBuild.targets +++ b/src/mono/wasm/build/WasmApp.LocalBuild.targets @@ -58,6 +58,16 @@ + + $([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackLocationToUse), 'runtimes', 'browser-wasm')) + $([MSBuild]::NormalizePath($(MicrosoftNetCoreAppRuntimePackRidDir), 'native', 'cross', $(RuntimeIdentifier), 'mono-aot-cross')) + $(MonoAotCrossCompilerPath).exe + + $([MSBuild]::NormalizePath('$(WasmAppBuilderDir)', 'WasmAppBuilder.dll')) + $([MSBuild]::NormalizePath('$(WasmBuildTasksDir)', 'WasmBuildTasks.dll')) + $([MSBuild]::NormalizePath('$(MonoAOTCompilerDir)', 'MonoAOTCompiler.dll')) + + diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets index a9038193572280..0294da2627d89d 100644 --- a/src/mono/wasm/build/WasmApp.targets +++ b/src/mono/wasm/build/WasmApp.targets @@ -87,7 +87,7 @@ <_WasmAssemblies Remove="@(_WasmAssemblies)" /> - <_WasmAOTSearchPaths Include="$(MicrosoftNetCoreAppRuntimePackRidDir)\native" /> + <_WasmAOTSearchPaths Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)" /> <_WasmAOTSearchPaths Include="$(MicrosoftNetCoreAppRuntimePackRidDir)\lib\net6.0" /> @@ -118,7 +118,7 @@ - <_WasmStrippedAssembliesPath>$([System.IO.Path]::GetFullPath('$(_WasmIntermediateOutputPath)\stripped-assemblies\')) + <_WasmStrippedAssembliesPath>$([MSBuild]::NormalizeDirectory($(_WasmIntermediateOutputPath), 'stripped-assemblies')) @@ -160,15 +160,17 @@ true $(OutputPath)AppBundle\ $(TargetFileName) - $(MicrosoftNetCoreAppRuntimePackRidDir)native\cross\$(PackageRID)\mono-aot-cross$(_ExeExt) + $([MSBuild]::NormalizePath($(MicrosoftNetCoreAppRuntimePackRidNativeDir), 'cross', $(PackageRID), 'mono-aot-cross$(_ExeExt)')) + $([MSBuild]::EnsureTrailingSlash($(MicrosoftNetCoreAppRuntimePackRidDir))) + $([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackRidDir), 'native')) - <_WasmIntermediateOutputPath>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)\wasm\')) + <_WasmIntermediateOutputPath>$([MSBuild]::NormalizeDirectory($(IntermediateOutputPath), 'wasm')) - $(MicrosoftNetCoreAppRuntimePackRidDir)\ + $([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackRidDir))) <_WasmAssemblies Include="@(WasmAssembliesToBundle)" /> @@ -189,11 +191,11 @@ - - + + - - + + - $(MicrosoftNetCoreAppRuntimePackRidDir)native\src\emcc-flags.txt + $([MSBuild]::NormalizePath($(MicrosoftNetCoreAppRuntimePackRidNativeDir), 'src', 'emcc-flags.txt')) true $(WasmBuildNative) @@ -247,11 +249,13 @@ + OutputPath="$(_WasmIntermediateOutputPath)icall-table.h" /> $(EmccFlags) -DLINK_ICALLS=1 + <_WasmIncludeDir>$([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackRidNativeDir), 'include')) + <_WasmSrcDir>$([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackRidNativeDir), 'src')) @@ -291,8 +295,8 @@ - - + + @@ -338,7 +342,7 @@ EMSCRIPTEN_KEEPALIVE void mono_wasm_load_profiler_aot (const char *desc) { mono_ - + From deaaf7f15a796ba8037ff39bbb0dbd507c1dab28 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 10 Mar 2021 13:19:07 -0500 Subject: [PATCH 04/14] [wasm] WasmApp.targets: Simplify emcc invocations a bit --- src/mono/wasm/build/WasmApp.targets | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets index 0294da2627d89d..fb504251c02b3f 100644 --- a/src/mono/wasm/build/WasmApp.targets +++ b/src/mono/wasm/build/WasmApp.targets @@ -268,11 +268,19 @@ <_WasmRuntimePackNativeLibs Include="libmono-profiler-aot.a"/> <_WasmRuntimePackNativeLibs Include="libicuuc.a" Condition="'$(InvariantGlobalization)' != 'true'" /> <_WasmRuntimePackNativeLibs Include="libicui18n.a" Condition="'$(InvariantGlobalization)' != 'true'" /> - <_WasmObjects Include="@(_WasmRuntimePackNativeLibs->'$(MicrosoftNetCoreAppRuntimePackRidDir)\native\%(FileName)%(Extension)')" /> - <_WasmObjects Include="$(_WasmIntermediateOutputPath)driver.o"/> - <_WasmObjects Include="$(_WasmIntermediateOutputPath)pinvoke.o"/> - <_WasmObjects Include="$(_WasmIntermediateOutputPath)corebindings.o"/> + <_WasmObjectsToBuild Include="$(_WasmIntermediateOutputPath)driver.o"/> + <_WasmObjectsToBuild Include="$(_WasmIntermediateOutputPath)pinvoke.o"/> + <_WasmObjectsToBuild Include="$(_WasmIntermediateOutputPath)corebindings.o"/> + <_WasmObjectsToBuild SourcePath="$(_WasmSrcDir)%(FileName).c" /> + + <_WasmObjects Include="@(_WasmRuntimePackNativeLibs->'$(MicrosoftNetCoreAppRuntimePackRidNativeDir)%(FileName)%(Extension)')" /> + <_WasmObjects Include="@(_WasmObjectsToBuild)" /> + + <_DotnetJSSrcFile Include="$(_WasmSrcDir)library_mono.js" /> + <_DotnetJSSrcFile Include="$(_WasmSrcDir)binding_support.js" /> + <_DotnetJSSrcFile Include="$(_WasmSrcDir)dotnet_support.js" /> + <_DotnetJSSrcFile Include="$(_WasmSrcDir)pal_random.js" /> <_BitcodeFile Include="%(_WasmAssemblies.LlvmBitcodeFile)" /> @@ -288,11 +296,10 @@ <_WasmOptCommand>$([MSBuild]::NormalizePath('$(EMSDK_PATH)', 'upstream', 'bin', 'wasm-opt$(_ExeExt)')) - - - - - + + + + From ab01a01f0e253e4d675519103f20ff063e7427f0 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 10 Mar 2021 13:21:17 -0500 Subject: [PATCH 05/14] [wasm] WasmApp.targets: quote paths correctly --- src/mono/wasm/build/WasmApp.targets | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets index fb504251c02b3f..8c4a243abec246 100644 --- a/src/mono/wasm/build/WasmApp.targets +++ b/src/mono/wasm/build/WasmApp.targets @@ -128,7 +128,7 @@ - + <_WasmAssemblies Remove="@(_WasmAssemblies)" /> @@ -247,7 +247,7 @@ OutputPath="$(_WasmIntermediateOutputPath)pinvoke-table.h" /> - + - <_WasmIncludeDir>$(MicrosoftNetCoreAppRuntimePackRidDir)native/include - <_WasmSrcDir>$(MicrosoftNetCoreAppRuntimePackRidDir)native/src - $(EmccFlags) -DCORE_BINDINGS -DGEN_PINVOKE=1 -I$(_WasmIntermediateOutputPath) -I$(_WasmIncludeDir)/mono-2.0 -I$(_WasmIncludeDir)/wasm + $(EmccFlags) -DCORE_BINDINGS -DGEN_PINVOKE=1 "-I$(_WasmIncludeDir)/mono-2.0" "-I$(_WasmIncludeDir)/wasm" + + + $(EmccCFlags) "-I$(_WasmIntermediateOutputPath)." + $(EmccCFlags) "-I$(_WasmIntermediateOutputPath)" + $(EmccFlags) -s TOTAL_MEMORY=536870912 <_WasmOptCommand>$([MSBuild]::NormalizePath('$(EMSDK_PATH)', 'upstream', 'bin', 'wasm-opt$(_ExeExt)')) From eb0c34bbb8467759edf594746d10a3cdef8e8efb Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 10 Mar 2021 13:22:46 -0500 Subject: [PATCH 06/14] [wasm] Add `%(WasmAssembliesToBundle._InternalForceInterpret)` .. to allow skipping AOT, per assembly. --- src/mono/wasm/build/WasmApp.targets | 39 +++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets index 8c4a243abec246..d647b3891b2751 100644 --- a/src/mono/wasm/build/WasmApp.targets +++ b/src/mono/wasm/build/WasmApp.targets @@ -9,6 +9,9 @@ Required public items/properties: - $(WasmMainJSPath) - @(WasmAssembliesToBundle) - list of assemblies to package as the wasm app + - %(_InternalForceInterpret) metadata - if true, then skips this assembly from the AOT step. + Error for this to be set with AOTMode=LLVMOnly + - $(EMSDK_PATH) - points to the emscripten sdk location. Public properties (optional): @@ -80,10 +83,11 @@ - <_AotInputAssemblies Include="@(_WasmAssemblies->Distinct())"> + <_AotInputAssemblies Include="@(_WasmAssemblies)" Condition="'%(_WasmAssemblies._InternalForceInterpret)' != 'true'"> @(MonoAOTCompilerDefaultAotArguments, ';') @(MonoAOTCompilerDefaultProcessArguments, ';') + <_AOT_InternalForceInterpretAssemblies Include="@(_WasmAssemblies->WithMetadataValue('_InternalForceInterpret', 'true'))" /> <_WasmAssemblies Remove="@(_WasmAssemblies)" /> @@ -96,6 +100,10 @@ LLVMOnly + + + + + + + <_WasmAssemblies Include="@(_AOT_InternalForceInterpretAssemblies)" /> + @@ -122,7 +135,11 @@ - <_WasmStrippedAssemblies Include="@(_WasmAssemblies->'$(_WasmStrippedAssembliesPath)\%(FileName)%(Extension)')" OriginalPath="%(_WasmAssemblies.Identity)" /> + <_WasmStrippedAssemblies + Condition="'%(_WasmAssemblies._InternalForceInterpret)' != 'true'" + Include="@(_WasmAssemblies->'$(_WasmStrippedAssembliesPath)%(FileName)%(Extension)')" + OriginalPath="%(_WasmAssemblies.Identity)" /> + <_WasmInterpOnlyAssembly Include="@(_WasmAssemblies->WithMetadataValue('_InternalForceInterpret', 'true'))" /> @@ -132,7 +149,7 @@ <_WasmAssemblies Remove="@(_WasmAssemblies)" /> - <_WasmAssemblies Include="@(_WasmStrippedAssemblies)" /> + <_WasmAssemblies Include="@(_WasmStrippedAssemblies);@(_WasmInterpOnlyAssembly)" /> @@ -153,6 +170,7 @@ + true @@ -173,7 +191,7 @@ $([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackRidDir))) - <_WasmAssemblies Include="@(WasmAssembliesToBundle)" /> + <_WasmAssemblies Include="@(WasmAssembliesToBundle->Distinct())" /> @@ -283,10 +301,11 @@ <_DotnetJSSrcFile Include="$(_WasmSrcDir)pal_random.js" /> <_BitcodeFile Include="%(_WasmAssemblies.LlvmBitcodeFile)" /> + <_AOTAssemblies Include="@(_WasmAssemblies)" Condition="'%(_WasmAssemblies._InternalForceInterpret)' != 'true'" /> - + $(EmccFlags) -DCORE_BINDINGS -DGEN_PINVOKE=1 "-I$(_WasmIncludeDir)/mono-2.0" "-I$(_WasmIncludeDir)/wasm" @@ -378,7 +397,13 @@ EMSCRIPTEN_KEEPALIVE void mono_wasm_load_profiler_aot (const char *desc) { mono_ - + + + + From 80981406cf686006adc86db1de93530a13187f47 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 10 Mar 2021 13:25:09 -0500 Subject: [PATCH 07/14] [wasm] don't copy dotnet.* to appbundle unnecessarily This was added earlier to support blazor workload which only uses AOT. But that has since been fixed to correctly use `WasmBuildApp`+`@(WasmNativeAsset)`, so this can be removed. --- src/mono/wasm/build/WasmApp.targets | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets index d647b3891b2751..384a837b2dcff8 100644 --- a/src/mono/wasm/build/WasmApp.targets +++ b/src/mono/wasm/build/WasmApp.targets @@ -331,9 +331,6 @@ - - - From fd741f552494b3c579bb7c864e2de145c092b992 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 10 Mar 2021 13:29:47 -0500 Subject: [PATCH 08/14] [wasm] Add new `$(WasmNativeDebugSymbols)` that to get symbols with .. dotnet.wasm . It defaults to `true`. --- src/mono/wasm/build/WasmApp.targets | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets index 384a837b2dcff8..3bf97744a432bd 100644 --- a/src/mono/wasm/build/WasmApp.targets +++ b/src/mono/wasm/build/WasmApp.targets @@ -22,6 +22,8 @@ - $(WasmLinkIcalls) - Whenever to link out unused icalls. Defaults to $(WasmBuildNative). - $(RunAOTCompilation) - Defaults to false. - $(WasmDebugLevel) + - $(WasmNativeDebugSymbols) - Build with native debug symbols, useful only with `$(RunAOTCompilation)`, or `$(WasmBuildNative)` + Defaults to true. - $(WasmProfilers) - Profilers to use - $(AOTMode) - Defaults to `LLVMOnly` @@ -176,6 +178,7 @@ true false true + true $(OutputPath)AppBundle\ $(TargetFileName) $([MSBuild]::NormalizePath($(MicrosoftNetCoreAppRuntimePackRidNativeDir), 'cross', $(PackageRID), 'mono-aot-cross$(_ExeExt)')) @@ -309,6 +312,7 @@ $(EmccFlags) -DCORE_BINDINGS -DGEN_PINVOKE=1 "-I$(_WasmIncludeDir)/mono-2.0" "-I$(_WasmIncludeDir)/wasm" + $(EmccCFlags) -g - <_WasmAssemblies Include="@(_AOT_InternalForceInterpretAssemblies)" /> + <_WasmAssembliesInternal Include="@(_AOT_InternalForceInterpretAssemblies)" /> @@ -138,10 +138,10 @@ <_WasmStrippedAssemblies - Condition="'%(_WasmAssemblies._InternalForceInterpret)' != 'true'" - Include="@(_WasmAssemblies->'$(_WasmStrippedAssembliesPath)%(FileName)%(Extension)')" - OriginalPath="%(_WasmAssemblies.Identity)" /> - <_WasmInterpOnlyAssembly Include="@(_WasmAssemblies->WithMetadataValue('_InternalForceInterpret', 'true'))" /> + Condition="'%(_WasmAssembliesInternal._InternalForceInterpret)' != 'true'" + Include="@(_WasmAssembliesInternal->'$(_WasmStrippedAssembliesPath)%(FileName)%(Extension)')" + OriginalPath="%(_WasmAssembliesInternal.Identity)" /> + <_WasmInterpOnlyAssembly Include="@(_WasmAssembliesInternal->WithMetadataValue('_InternalForceInterpret', 'true'))" /> @@ -150,22 +150,22 @@ - <_WasmAssemblies Remove="@(_WasmAssemblies)" /> - <_WasmAssemblies Include="@(_WasmStrippedAssemblies);@(_WasmInterpOnlyAssembly)" /> + <_WasmAssembliesInternal Remove="@(_WasmAssembliesInternal)" /> + <_WasmAssembliesInternal Include="@(_WasmStrippedAssemblies);@(_WasmInterpOnlyAssembly)" /> - <_WasmAssemblies Remove="@(_WasmAssemblies)" /> - <_WasmAssemblies Include="@(_TmpWasmAssemblies)" /> + <_WasmAssembliesInternal Remove="@(_WasmAssembliesInternal)" /> + <_WasmAssembliesInternal Include="@(_TmpWasmAssemblies)" /> @@ -194,7 +194,7 @@ $([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackRidDir))) - <_WasmAssemblies Include="@(WasmAssembliesToBundle->Distinct())" /> + <_WasmAssembliesInternal Include="@(WasmAssembliesToBundle->Distinct())" /> @@ -222,7 +222,7 @@ $(EmccFlags) -DLINK_ICALLS=1 @@ -305,8 +305,8 @@ <_DotnetJSSrcFile Include="$(_WasmSrcDir)dotnet_support.js" /> <_DotnetJSSrcFile Include="$(_WasmSrcDir)pal_random.js" /> - <_BitcodeFile Include="%(_WasmAssemblies.LlvmBitcodeFile)" /> - <_AOTAssemblies Include="@(_WasmAssemblies)" Condition="'%(_WasmAssemblies._InternalForceInterpret)' != 'true'" /> + <_AOTAssemblies Include="@(_WasmAssembliesInternal)" Condition="'%(_WasmAssembliesInternal._InternalForceInterpret)' != 'true'" /> + <_BitcodeFile Include="%(_WasmAssembliesInternal.LlvmBitcodeFile)" /> - + From abca4482a4d57c0d54a525b9c1fae8aa4ab1a2a3 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 10 Mar 2021 15:11:34 -0500 Subject: [PATCH 11/14] [wasm] Fix sample build --- src/mono/wasm/build/WasmApp.targets | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets index 10278a098e4c99..3731ea14735639 100644 --- a/src/mono/wasm/build/WasmApp.targets +++ b/src/mono/wasm/build/WasmApp.targets @@ -181,9 +181,10 @@ true $(OutputPath)AppBundle\ $(TargetFileName) + + $([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackRidDir), 'native')) $([MSBuild]::NormalizePath($(MicrosoftNetCoreAppRuntimePackRidNativeDir), 'cross', $(PackageRID), 'mono-aot-cross$(_ExeExt)')) $([MSBuild]::EnsureTrailingSlash($(MicrosoftNetCoreAppRuntimePackRidDir))) - $([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackRidDir), 'native')) <_WasmIntermediateOutputPath>$([MSBuild]::NormalizeDirectory($(IntermediateOutputPath), 'wasm')) From 10aa72330fe17b3bd183245fefd814a9d2a63116 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 10 Mar 2021 18:33:05 -0500 Subject: [PATCH 12/14] [wasm] Fix tests on helix - typo --- src/mono/wasm/build/WasmApp.LocalBuild.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/wasm/build/WasmApp.LocalBuild.props b/src/mono/wasm/build/WasmApp.LocalBuild.props index 62260419edf93c..0194eaa8b75ca8 100644 --- a/src/mono/wasm/build/WasmApp.LocalBuild.props +++ b/src/mono/wasm/build/WasmApp.LocalBuild.props @@ -41,7 +41,7 @@ $([MSBuild]::NormalizeDirectory($(BuildBaseDir), 'microsoft.netcore.app.runtime.browser-wasm')) $([MSBuild]::NormalizeDirectory($(BuildBaseDir), 'MonoAOTCompiler')) - $([MSBuild]::NormalizeDirectory($(BuildBaseDir)', WasmAppBuilder')) + $([MSBuild]::NormalizeDirectory($(BuildBaseDir)', 'WasmAppBuilder')) $([MSBuild]::NormalizeDirectory($(BuildBaseDir), 'WasmBuildTasks')) From 4cbbaad7571462d72d9d732a66b14a5a980c3304 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 10 Mar 2021 21:19:17 -0500 Subject: [PATCH 13/14] Address review feedback --- src/mono/wasm/build/WasmApp.targets | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets index 3731ea14735639..628d689b85dd52 100644 --- a/src/mono/wasm/build/WasmApp.targets +++ b/src/mono/wasm/build/WasmApp.targets @@ -26,7 +26,7 @@ Defaults to true. - $(WasmProfilers) - Profilers to use - - $(AOTMode) - Defaults to `LLVMOnly` + - $(AOTMode) - Defaults to `AotInterp` - $(AOTProfilePath) - profile data file to be used for profile-guided optimization - $(InvariantGlobalization) - Whenever to disable ICU. Defaults to false. @@ -98,8 +98,8 @@ - AotInterp - LLVMOnly + + AotInterp - $(EmccFlags) -DCORE_BINDINGS -DGEN_PINVOKE=1 "-I$(_WasmIncludeDir)/mono-2.0" "-I$(_WasmIncludeDir)/wasm" + $(EmccFlags) -DCORE_BINDINGS -DGEN_PINVOKE=1 "-I$(_WasmIncludeDir)mono-2.0" "-I$(_WasmIncludeDir)wasm" $(EmccCFlags) -g