From bf1d3c0771abc2a926034b4245211e9614c775aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Thu, 6 Jun 2024 14:45:00 +0200 Subject: [PATCH 1/6] Don't copy assemblies to output in single file --- src/mono/browser/build/BrowserWasmApp.targets | 1 + src/tasks/WasmAppBuilder/WasmAppBuilder.cs | 120 ++++++++++-------- 2 files changed, 65 insertions(+), 56 deletions(-) diff --git a/src/mono/browser/build/BrowserWasmApp.targets b/src/mono/browser/build/BrowserWasmApp.targets index fc8708fed161d..1c66da41a240b 100644 --- a/src/mono/browser/build/BrowserWasmApp.targets +++ b/src/mono/browser/build/BrowserWasmApp.targets @@ -140,6 +140,7 @@ AppDir="$(WasmAppDir)" Assemblies="@(_WasmAssembliesInternal)" MainAssemblyName="$(WasmMainAssemblyFileName)" + IsSingleFileBundle="$(WasmSingleFileBundle)" HostConfigs="@(HostConfig)" RuntimeArgsForHost="@(WasmMonoRuntimeArgs)" DefaultHostConfig="$(DefaultWasmHostConfig)" diff --git a/src/tasks/WasmAppBuilder/WasmAppBuilder.cs b/src/tasks/WasmAppBuilder/WasmAppBuilder.cs index 9fca78e4263fa..22c173348492a 100644 --- a/src/tasks/WasmAppBuilder/WasmAppBuilder.cs +++ b/src/tasks/WasmAppBuilder/WasmAppBuilder.cs @@ -21,6 +21,7 @@ namespace Microsoft.WebAssembly.Build.Tasks; public class WasmAppBuilder : WasmAppBuilderBaseTask { + public bool IsSingleFileBundle { get; set; } public ITaskItem[]? RemoteSources { get; set; } public bool IncludeThreadsWorker { get; set; } public int PThreadPoolInitialSize { get; set; } @@ -129,37 +130,41 @@ protected override bool ExecuteInternal() Log.LogMessage(MessageImportance.Low, $"Runtime assets output path {runtimeAssetsPath}"); Directory.CreateDirectory(AppDir!); - Directory.CreateDirectory(runtimeAssetsPath); - - if (UseWebcil) - Log.LogMessage(MessageImportance.Normal, "Converting assemblies to Webcil"); int baseDebugLevel = helper.GetDebugLevel(false); - foreach (var assembly in _assemblies) + if (!IsSingleFileBundle) { + Directory.CreateDirectory(runtimeAssetsPath); + if (UseWebcil) + Log.LogMessage(MessageImportance.Normal, "Converting assemblies to Webcil"); + + foreach (var assembly in _assemblies) { - using TempFileName tmpWebcil = new(); - var webcilWriter = Microsoft.WebAssembly.Build.Tasks.WebcilConverter.FromPortableExecutable(inputPath: assembly, outputPath: tmpWebcil.Path, logger: logAdapter); - webcilWriter.ConvertToWebcil(); - var finalWebcil = Path.Combine(runtimeAssetsPath, Path.ChangeExtension(Path.GetFileName(assembly), Utils.WebcilInWasmExtension)); - if (Utils.CopyIfDifferent(tmpWebcil.Path, finalWebcil, useHash: true)) - Log.LogMessage(MessageImportance.Low, $"Generated {finalWebcil} ."); + if (UseWebcil) + { + using TempFileName tmpWebcil = new(); + var webcilWriter = Microsoft.WebAssembly.Build.Tasks.WebcilConverter.FromPortableExecutable(inputPath: assembly, outputPath: tmpWebcil.Path, logger: logAdapter); + webcilWriter.ConvertToWebcil(); + var finalWebcil = Path.Combine(runtimeAssetsPath, Path.ChangeExtension(Path.GetFileName(assembly), Utils.WebcilInWasmExtension)); + if (Utils.CopyIfDifferent(tmpWebcil.Path, finalWebcil, useHash: true)) + Log.LogMessage(MessageImportance.Low, $"Generated {finalWebcil} ."); + else + Log.LogMessage(MessageImportance.Low, $"Skipped generating {finalWebcil} as the contents are unchanged."); + _fileWrites.Add(finalWebcil); + } else - Log.LogMessage(MessageImportance.Low, $"Skipped generating {finalWebcil} as the contents are unchanged."); - _fileWrites.Add(finalWebcil); - } - else - { - FileCopyChecked(assembly, Path.Combine(runtimeAssetsPath, Path.GetFileName(assembly)), "Assemblies"); - } - if (baseDebugLevel != 0) - { - var pdb = assembly; - pdb = Path.ChangeExtension(pdb, ".pdb"); - if (File.Exists(pdb)) - FileCopyChecked(pdb, Path.Combine(runtimeAssetsPath, Path.GetFileName(pdb)), "Assemblies"); + { + FileCopyChecked(assembly, Path.Combine(runtimeAssetsPath, Path.GetFileName(assembly)), "Assemblies"); + } + if (baseDebugLevel != 0) + { + var pdb = assembly; + pdb = Path.ChangeExtension(pdb, ".pdb"); + if (File.Exists(pdb)) + FileCopyChecked(pdb, Path.Combine(runtimeAssetsPath, Path.GetFileName(pdb)), "Assemblies"); + } } } @@ -196,48 +201,51 @@ protected override bool ExecuteInternal() File.WriteAllText(packageJsonPath, json); } - foreach (var assembly in _assemblies) + if (!IsSingleFileBundle) { - string assemblyPath = assembly; - var bytes = File.ReadAllBytes(assemblyPath); - // for the is IL IsAssembly check we need to read the bytes from the original DLL - if (!Utils.IsManagedAssembly(bytes)) + foreach (var assembly in _assemblies) { - Log.LogMessage(MessageImportance.Low, "Skipping non-assembly file: " + assemblyPath); - } - else - { - if (UseWebcil) + string assemblyPath = assembly; + var bytes = File.ReadAllBytes(assemblyPath); + // for the is IL IsAssembly check we need to read the bytes from the original DLL + if (!Utils.IsManagedAssembly(bytes)) { - assemblyPath = Path.Combine(runtimeAssetsPath, Path.ChangeExtension(Path.GetFileName(assembly), Utils.WebcilInWasmExtension)); - // For the hash, read the bytes from the webcil file, not the dll file. - bytes = File.ReadAllBytes(assemblyPath); + Log.LogMessage(MessageImportance.Low, "Skipping non-assembly file: " + assemblyPath); } + else + { + if (UseWebcil) + { + assemblyPath = Path.Combine(runtimeAssetsPath, Path.ChangeExtension(Path.GetFileName(assembly), Utils.WebcilInWasmExtension)); + // For the hash, read the bytes from the webcil file, not the dll file. + bytes = File.ReadAllBytes(assemblyPath); + } - var assemblyName = Path.GetFileName(assemblyPath); - bool isCoreAssembly = IsAot || helper.IsCoreAssembly(assemblyName); + var assemblyName = Path.GetFileName(assemblyPath); + bool isCoreAssembly = IsAot || helper.IsCoreAssembly(assemblyName); - var assemblyList = isCoreAssembly ? bootConfig.resources.coreAssembly : bootConfig.resources.assembly; - assemblyList[assemblyName] = Utils.ComputeIntegrity(bytes); + var assemblyList = isCoreAssembly ? bootConfig.resources.coreAssembly : bootConfig.resources.assembly; + assemblyList[assemblyName] = Utils.ComputeIntegrity(bytes); - if (baseDebugLevel != 0) - { - var pdb = Path.ChangeExtension(assembly, ".pdb"); - if (File.Exists(pdb)) + if (baseDebugLevel != 0) { - if (isCoreAssembly) - { - if (bootConfig.resources.corePdb == null) - bootConfig.resources.corePdb = new(); - } - else + var pdb = Path.ChangeExtension(assembly, ".pdb"); + if (File.Exists(pdb)) { - if (bootConfig.resources.pdb == null) - bootConfig.resources.pdb = new(); + if (isCoreAssembly) + { + if (bootConfig.resources.corePdb == null) + bootConfig.resources.corePdb = new(); + } + else + { + if (bootConfig.resources.pdb == null) + bootConfig.resources.pdb = new(); + } + + var pdbList = isCoreAssembly ? bootConfig.resources.corePdb : bootConfig.resources.pdb; + pdbList[Path.GetFileName(pdb)] = Utils.ComputeIntegrity(pdb); } - - var pdbList = isCoreAssembly ? bootConfig.resources.corePdb : bootConfig.resources.pdb; - pdbList[Path.GetFileName(pdb)] = Utils.ComputeIntegrity(pdb); } } } From 5e72c958ea4285202ec8eeb15eda8b438afc28f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Thu, 6 Jun 2024 15:32:54 +0200 Subject: [PATCH 2/6] Fix emcc extension --- src/mono/browser/build/BrowserWasmApp.targets | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mono/browser/build/BrowserWasmApp.targets b/src/mono/browser/build/BrowserWasmApp.targets index 1c66da41a240b..e5415c552390a 100644 --- a/src/mono/browser/build/BrowserWasmApp.targets +++ b/src/mono/browser/build/BrowserWasmApp.targets @@ -289,6 +289,7 @@ false $(EmscriptenUpstreamEmscriptenPath)emcc + $(WasmClang).bat From 4b4b4d9358a6992f32a3136e8dbb463e2b5aec75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Thu, 6 Jun 2024 17:57:22 +0200 Subject: [PATCH 3/6] Integrate bundles into driver --- src/mono/browser/build/BrowserWasmApp.targets | 1 + src/mono/browser/runtime/driver.c | 9 +++++++++ src/tasks/WasmAppBuilder/WasmAppBuilder.cs | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/mono/browser/build/BrowserWasmApp.targets b/src/mono/browser/build/BrowserWasmApp.targets index e5415c552390a..53abd1a3cdc69 100644 --- a/src/mono/browser/build/BrowserWasmApp.targets +++ b/src/mono/browser/build/BrowserWasmApp.targets @@ -314,6 +314,7 @@ <_EmccCFlags Include="-DDISABLE_PERFTRACING_LISTEN_PORTS=1" /> <_EmccCFlags Include="-DENABLE_AOT=1" Condition="'$(_WasmShouldAOT)' == 'true'" /> <_EmccCFlags Include="-DDRIVER_GEN=1" Condition="'$(_WasmShouldAOT)' == 'true'" /> + <_EmccCFlags Include="-DWASM_SINGLE_FILE=1" Condition="'$(WasmSingleFileBundle)' == 'true'" /> <_EmccCFlags Include="-DINVARIANT_GLOBALIZATION=1" Condition="'$(InvariantGlobalization)' == 'true'" /> <_EmccCFlags Include="-DINVARIANT_TIMEZONE=1" Condition="'$(InvariantTimezone)' == 'true'" /> <_EmccCFlags Include="-DLINK_ICALLS=1" Condition="'$(WasmLinkIcalls)' == 'true'" /> diff --git a/src/mono/browser/runtime/driver.c b/src/mono/browser/runtime/driver.c index 1b3663e4f3f3c..5425ff3e03eab 100644 --- a/src/mono/browser/runtime/driver.c +++ b/src/mono/browser/runtime/driver.c @@ -46,6 +46,12 @@ char *mono_method_get_full_name (MonoMethod *method); #ifndef INVARIANT_TIMEZONE extern void mono_register_timezones_bundle (void); #endif /* INVARIANT_TIMEZONE */ +#ifdef WASM_SINGLE_FILE +extern void mono_register_assemblies_bundle (void); +#ifndef INVARIANT_GLOBALIZATION +extern void mono_register_icu_bundle (void); +#endif /* INVARIANT_GLOBALIZATION */ +#endif /* WASM_SINGLE_FILE */ extern void mono_wasm_set_entrypoint_breakpoint (const char* assembly_name, int method_token); extern void mono_bundled_resources_add_assembly_resource (const char *id, const char *name, const uint8_t *data, uint32_t size, void (*free_func)(void *, void*), void *free_data); @@ -221,6 +227,9 @@ mono_wasm_load_runtime (int debug_level) #ifndef INVARIANT_TIMEZONE mono_register_timezones_bundle (); #endif /* INVARIANT_TIMEZONE */ +#ifdef WASM_SINGLE_FILE + mono_register_assemblies_bundle (); +#endif root_domain = mono_wasm_load_runtime_common (debug_level, wasm_trace_logger, interp_opts); diff --git a/src/tasks/WasmAppBuilder/WasmAppBuilder.cs b/src/tasks/WasmAppBuilder/WasmAppBuilder.cs index 22c173348492a..c1a606c116606 100644 --- a/src/tasks/WasmAppBuilder/WasmAppBuilder.cs +++ b/src/tasks/WasmAppBuilder/WasmAppBuilder.cs @@ -130,12 +130,12 @@ protected override bool ExecuteInternal() Log.LogMessage(MessageImportance.Low, $"Runtime assets output path {runtimeAssetsPath}"); Directory.CreateDirectory(AppDir!); + Directory.CreateDirectory(runtimeAssetsPath); int baseDebugLevel = helper.GetDebugLevel(false); if (!IsSingleFileBundle) { - Directory.CreateDirectory(runtimeAssetsPath); if (UseWebcil) Log.LogMessage(MessageImportance.Normal, "Converting assemblies to Webcil"); From a7215a5dc636c2c8e3b1db94c9aa7e4f7eac294f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Fri, 7 Jun 2024 13:30:38 +0200 Subject: [PATCH 4/6] Loading ICU and runtimeconfig from bundle --- src/mono/browser/build/BrowserWasmApp.targets | 52 ++++++++++--------- src/mono/browser/runtime/driver.c | 44 ++++++++++++++-- src/tasks/WasmAppBuilder/WasmAppBuilder.cs | 2 +- 3 files changed, 69 insertions(+), 29 deletions(-) diff --git a/src/mono/browser/build/BrowserWasmApp.targets b/src/mono/browser/build/BrowserWasmApp.targets index 53abd1a3cdc69..4cda1efa13c22 100644 --- a/src/mono/browser/build/BrowserWasmApp.targets +++ b/src/mono/browser/build/BrowserWasmApp.targets @@ -66,7 +66,23 @@ <_BoolPropertiesThatTriggerRelinking Include="WasmEnableExceptionHandling" DefaultValueInRuntimePack="true" /> - + + + <_HybridGlobalizationDataFiles Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)icudt_hybrid.dat"/> + <_HybridGlobalizationDataFiles Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)segmentation-rules.json"/> + <_IcuAvailableDataFiles Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)icudt_*" Exclude="@(_HybridGlobalizationDataFiles);$(_WasmIcuDataFileName)"/> + + + + + + + + + + + + @@ -102,20 +118,6 @@ - - - <_HybridGlobalizationDataFiles Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)icudt_hybrid.dat"/> - <_HybridGlobalizationDataFiles Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)segmentation-rules.json"/> - <_IcuAvailableDataFiles Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)icudt_*" Exclude="@(_HybridGlobalizationDataFiles);$(_WasmIcuDataFileName)"/> - - - - - - - - - - + @@ -395,15 +397,15 @@ BundleFile="wasm_bundled_assemblies.o" /> - - - - - - - - - + <_WasmBundleItem + Include="@(WasmIcuDataFileNames)" + BundleRegistrationFunctionName="mono_register_icu_bundle" + BundleFile="wasm_bundled_icu.o" /> + + <_WasmBundleItem + Include="$(_ParsedRuntimeConfigFilePath)" + BundleRegistrationFunctionName="mono_register_runtimeconfig_bin" + BundleFile="wasm_bundled_runtimeconfig_bin.o" /> diff --git a/src/mono/browser/runtime/driver.c b/src/mono/browser/runtime/driver.c index 5425ff3e03eab..c6e69de98b7cd 100644 --- a/src/mono/browser/runtime/driver.c +++ b/src/mono/browser/runtime/driver.c @@ -48,8 +48,11 @@ extern void mono_register_timezones_bundle (void); #endif /* INVARIANT_TIMEZONE */ #ifdef WASM_SINGLE_FILE extern void mono_register_assemblies_bundle (void); +extern void mono_register_runtimeconfig_bin (void); +extern mono_bool mono_bundled_resources_get_data_resource_values (const char *id, const uint8_t **data_out, uint32_t *size_out); #ifndef INVARIANT_GLOBALIZATION extern void mono_register_icu_bundle (void); +extern int32_t mono_wasm_load_icu_data(const void* pData); #endif /* INVARIANT_GLOBALIZATION */ #endif /* WASM_SINGLE_FILE */ extern void mono_wasm_set_entrypoint_breakpoint (const char* assembly_name, int method_token); @@ -186,14 +189,32 @@ cleanup_runtime_config (MonovmRuntimeConfigArguments *args, void *user_data) free (user_data); } +void +load_icu () +{ +#ifndef INVARIANT_GLOBALIZATION +#ifdef WASM_SINGLE_FILE + mono_register_icu_bundle (); + + const uint8_t *buffer = NULL; + uint32_t data_len = 0; + if (!mono_bundled_resources_get_data_resource_values ("icudt.dat", &buffer, &data_len)) { + printf("Could not load icudt.dat from the bundle"); + assert(buffer); + } + assert(mono_wasm_load_icu_data(buffer)); +#else + mono_wasm_link_icu_shim (); +#endif +#endif +} + EMSCRIPTEN_KEEPALIVE void mono_wasm_load_runtime (int debug_level) { const char *interp_opts = ""; -#ifndef INVARIANT_GLOBALIZATION - mono_wasm_link_icu_shim (); -#endif + load_icu(); // When the list of app context properties changes, please update RuntimeConfigReservedProperties for // target _WasmGenerateRuntimeConfig in BrowserWasmApp.targets file @@ -205,6 +226,22 @@ mono_wasm_load_runtime (int debug_level) appctx_values [0] = "/"; appctx_values [1] = "browser-wasm"; +#ifdef WASM_SINGLE_FILE + mono_register_runtimeconfig_bin (); + + const uint8_t *buffer = NULL; + uint32_t data_len = 0; + if (!mono_bundled_resources_get_data_resource_values (RUNTIMECONFIG_BIN_FILE, &buffer, &data_len)) { + printf("Could not load " RUNTIMECONFIG_BIN_FILE " from the bundle\n"); + assert(buffer); + } + + MonovmRuntimeConfigArguments *arg = (MonovmRuntimeConfigArguments *)malloc (sizeof (MonovmRuntimeConfigArguments)); + arg->kind = 1; // kind: image pointer + arg->runtimeconfig.data.data = buffer; + arg->runtimeconfig.data.data_len = data_len; + monovm_runtimeconfig_initialize (arg, cleanup_runtime_config, NULL); +#else char *file_name = RUNTIMECONFIG_BIN_FILE; int str_len = strlen (file_name) + 1; // +1 is for the "/" char *file_path = (char *)malloc (sizeof (char) * (str_len +1)); // +1 is for the terminating null character @@ -221,6 +258,7 @@ mono_wasm_load_runtime (int debug_level) } else { free (file_path); } +#endif monovm_initialize (2, appctx_keys, appctx_values); diff --git a/src/tasks/WasmAppBuilder/WasmAppBuilder.cs b/src/tasks/WasmAppBuilder/WasmAppBuilder.cs index c1a606c116606..09f3d1643f91b 100644 --- a/src/tasks/WasmAppBuilder/WasmAppBuilder.cs +++ b/src/tasks/WasmAppBuilder/WasmAppBuilder.cs @@ -350,7 +350,7 @@ protected override bool ExecuteInternal() bootConfig.resources.coreVfs = coreVfs; } - if (!InvariantGlobalization) + if (!InvariantGlobalization && !IsSingleFileBundle) { bool loadRemote = RemoteSources?.Length > 0; foreach (var idfn in IcuDataFileNames) From 17ccfbada020b4983aba7da8dda23f6084c49f96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Thu, 13 Jun 2024 16:04:07 +0200 Subject: [PATCH 5/6] Load selected icu by file name --- src/mono/browser/build/BrowserWasmApp.targets | 30 ++++++++++++++----- src/mono/browser/runtime/driver.c | 4 ++- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/mono/browser/build/BrowserWasmApp.targets b/src/mono/browser/build/BrowserWasmApp.targets index 4cda1efa13c22..05944a9aa9eb9 100644 --- a/src/mono/browser/build/BrowserWasmApp.targets +++ b/src/mono/browser/build/BrowserWasmApp.targets @@ -66,15 +66,16 @@ <_BoolPropertiesThatTriggerRelinking Include="WasmEnableExceptionHandling" DefaultValueInRuntimePack="true" /> - + <_HybridGlobalizationDataFiles Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)icudt_hybrid.dat"/> <_HybridGlobalizationDataFiles Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)segmentation-rules.json"/> <_IcuAvailableDataFiles Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)icudt_*" Exclude="@(_HybridGlobalizationDataFiles);$(_WasmIcuDataFileName)"/> - - - - + + + + + @@ -82,7 +83,7 @@ - + @@ -238,7 +239,7 @@ - + @@ -428,6 +429,21 @@ + + + <_BrowserGetIcuFileName>$(_WasmIntermediateOutputPath)icufilename_$(WasmMainAssemblyFileName).c + + + + + <_WasmNativeFileForLinking Include="$(_BrowserGetIcuFileName)" /> + + + <_WasmEHLib Condition="'$(WasmEnableExceptionHandling)' == 'true'">libmono-wasm-eh-wasm.a diff --git a/src/mono/browser/runtime/driver.c b/src/mono/browser/runtime/driver.c index c6e69de98b7cd..626784f597c6a 100644 --- a/src/mono/browser/runtime/driver.c +++ b/src/mono/browser/runtime/driver.c @@ -53,6 +53,7 @@ extern mono_bool mono_bundled_resources_get_data_resource_values (const char *id #ifndef INVARIANT_GLOBALIZATION extern void mono_register_icu_bundle (void); extern int32_t mono_wasm_load_icu_data(const void* pData); +extern const char* dotnet_browser_geticufilename(); #endif /* INVARIANT_GLOBALIZATION */ #endif /* WASM_SINGLE_FILE */ extern void mono_wasm_set_entrypoint_breakpoint (const char* assembly_name, int method_token); @@ -198,7 +199,8 @@ load_icu () const uint8_t *buffer = NULL; uint32_t data_len = 0; - if (!mono_bundled_resources_get_data_resource_values ("icudt.dat", &buffer, &data_len)) { + const char* icu_name = dotnet_browser_geticufilename (); + if (!mono_bundled_resources_get_data_resource_values (icu_name, &buffer, &data_len)) { printf("Could not load icudt.dat from the bundle"); assert(buffer); } From 1e4d31232cc3b52ddd9f3bf23210842fdec7f078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Wed, 14 Aug 2024 12:02:59 +0200 Subject: [PATCH 6/6] TOREVERT try it on Wasm SDK based WBT --- .../wasm/Wasm.Build.Tests/TestAppScenarios/LazyLoadingTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/wasm/Wasm.Build.Tests/TestAppScenarios/LazyLoadingTests.cs b/src/mono/wasm/Wasm.Build.Tests/TestAppScenarios/LazyLoadingTests.cs index eb98b3d6f6e0a..68fc139b9bdd4 100644 --- a/src/mono/wasm/Wasm.Build.Tests/TestAppScenarios/LazyLoadingTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/TestAppScenarios/LazyLoadingTests.cs @@ -31,7 +31,7 @@ public LazyLoadingTests(ITestOutputHelper output, SharedBuildPerTestClassFixture public async Task LoadLazyAssemblyBeforeItIsNeeded(string lazyLoadingTestExtension, string[] allLazyLoadingTestExtensions) { CopyTestAsset("WasmBasicTestApp", "LazyLoadingTests", "App"); - BuildProject("Debug", extraArgs: $"-p:LazyLoadingTestExtension={lazyLoadingTestExtension}"); + BuildProject("Debug", extraArgs: $"-p:LazyLoadingTestExtension={lazyLoadingTestExtension} -p:WasmSingleFileBundle=true -p:_WasmOutputFileName=dotnet.native.wasm"); // We are running the app and passing all possible lazy extensions to test matrix of all possibilities. // We don't need to rebuild the application to test how client is trying to load the assembly.