Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm] emscripten bump 3.1.56 #100334

Merged
merged 59 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
e52f7df
[wasm] Bump emscripten to 3.1.56
radekdoulik Mar 26, 2024
a91ec44
Replace Module.asm with Module.wasmExports
radekdoulik Mar 27, 2024
d23f6fa
Updates for .native.worker.js -> mjs rename
radekdoulik Apr 5, 2024
9848b92
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
radekdoulik Apr 5, 2024
50dfb72
Update deps
radekdoulik May 30, 2024
aca6c58
Add general testing feed
radekdoulik May 30, 2024
f229a30
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
radekdoulik May 30, 2024
f917ea6
Update mode deps
radekdoulik May 30, 2024
a7c4e55
Update path
radekdoulik May 30, 2024
0b030c1
Use current python packages for now, we don't have newer ones
radekdoulik May 30, 2024
6a0057f
Keep using llvm 16 for runtime and aot compiler
radekdoulik Jun 3, 2024
6cde92a
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
radekdoulik Jun 3, 2024
1721779
Add -Wno-pre-c11-compat only for browser
radekdoulik Jun 3, 2024
fe1e5c6
Temporarily disable version checks to get further
radekdoulik Jun 3, 2024
3f8834f
Temporarily disable version checks to get further #2
radekdoulik Jun 4, 2024
123767a
Disable -Wunused-command-line-argument
radekdoulik Jun 4, 2024
e3b1316
Update emsdk deps
radekdoulik Jun 4, 2024
7d6edc3
Update icu dependency
radekdoulik Jun 4, 2024
15bd585
Revert "Temporarily disable version checks to get further #2"
radekdoulik Jun 4, 2024
92b4559
Revert "Temporarily disable version checks to get further"
radekdoulik Jun 4, 2024
d7b1d52
Fix emsdk check
radekdoulik Jun 4, 2024
3593c41
Workaround wasm-opt crash
radekdoulik Jun 4, 2024
4530edf
Workaround wasm-opt crash
radekdoulik Jun 5, 2024
200cf3b
Workaround wasm-opt crash
radekdoulik Jun 5, 2024
6e86cc3
Fix WBT test
radekdoulik Jun 11, 2024
02fb272
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
radekdoulik Jun 11, 2024
c313fa5
Feedback
radekdoulik Jun 11, 2024
253ebf9
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
lewing Jun 12, 2024
0d7708b
Update ICU dependency
radekdoulik Jun 14, 2024
8a12f44
Update emscripten deps
radekdoulik Jun 14, 2024
fc6ad97
Revert "Workaround wasm-opt crash"
radekdoulik Jun 14, 2024
683bd51
Revert "Workaround wasm-opt crash"
radekdoulik Jun 14, 2024
b15fd5c
Revert "Workaround wasm-opt crash"
radekdoulik Jun 14, 2024
9ae3c2f
Increase tests timeout
radekdoulik Jun 16, 2024
60a4799
Show test progress
radekdoulik Jun 16, 2024
4dadd6d
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
radekdoulik Jun 16, 2024
3bd6bfb
Increase MT library tests timeout
radekdoulik Jun 17, 2024
16866a1
Disable WBT tests with SkiaSharp
radekdoulik Jun 17, 2024
d53aaa3
Increase helix tests timeout on browser
radekdoulik Jun 18, 2024
6765913
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
radekdoulik Jun 18, 2024
4c69c36
Increase WBT timeout
radekdoulik Jun 19, 2024
c268a87
Increase initial heap sizes
radekdoulik Jun 19, 2024
d1d8619
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
radekdoulik Jun 20, 2024
abe9b00
Fix mono_wasm_load_runtime cwrap signature
radekdoulik Jun 20, 2024
63087a5
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
radekdoulik Jun 21, 2024
d5a0bc4
Enable XunitShowProgress for threading tasks tests
radekdoulik Jun 26, 2024
5d9a6d2
Try to reduce number of parallel AOT compilations
radekdoulik Jun 26, 2024
8505fd5
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
radekdoulik Jul 1, 2024
3fe1e1f
Use new docker image for helix/windows tests
radekdoulik Jul 2, 2024
b2655bf
Revert "Try to reduce number of parallel AOT compilations"
radekdoulik Jul 3, 2024
ba1ad20
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
pavelsavara Jul 4, 2024
009e371
Reduce the timeouts
radekdoulik Jul 7, 2024
9e0d5ce
Reduce intitial heap size
radekdoulik Jul 7, 2024
061f2b5
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
pavelsavara Jul 9, 2024
8ed7bf9
use active issues for MT
pavelsavara Jul 9, 2024
d665bfa
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
radekdoulik Jul 10, 2024
fdbb1f2
Remove testing channel from nuget config, update deps
radekdoulik Jul 13, 2024
ddc4698
Update emsdk and icu dependencies
radekdoulik Jul 15, 2024
e6426d2
Merge branch 'main' into pr-wasm-emscripten-bump-3.1.56
radekdoulik Jul 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions eng/liveBuilds.targets
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@
$(LibrariesNativeArtifactsPath)segmentation-rules.json;"
IsNative="true" />
<!-- for threaded wasm -->
<LibrariesRuntimeFiles Condition="'$(TargetOS)' == 'browser' and Exists('$(LibrariesNativeArtifactsPath)dotnet.native.worker.js')"
<LibrariesRuntimeFiles Condition="'$(TargetOS)' == 'browser' and Exists('$(LibrariesNativeArtifactsPath)dotnet.native.worker.mjs')"
Include="
$(LibrariesNativeArtifactsPath)dotnet.native.worker.js"
$(LibrariesNativeArtifactsPath)dotnet.native.worker.mjs"
IsNative="true" />
<LibrariesRuntimeFiles Condition="'$(TargetOS)' == 'browser'"
Include="
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
<PlatformManifestFileEntry Include="dotnet.runtime.js" IsNative="true" />
<PlatformManifestFileEntry Include="dotnet.runtime.js.map" IsNative="true" />
<PlatformManifestFileEntry Include="dotnet.native.js" IsNative="true" />
<PlatformManifestFileEntry Include="dotnet.native.worker.js" IsNative="true" />
<PlatformManifestFileEntry Include="dotnet.native.worker.mjs" IsNative="true" />
<PlatformManifestFileEntry Include="dotnet.native.js.symbols" IsNative="true" />
<PlatformManifestFileEntry Include="dotnet.d.ts" IsNative="true" />
<PlatformManifestFileEntry Include="dotnet.native.wasm" IsNative="true" />
Expand Down
10 changes: 6 additions & 4 deletions src/mono/browser/browser.proj
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@
</ItemGroup>
<!-- for the jiterpreter -->
<ItemGroup>
<EmccExportedRuntimeMethod Include="wasmExports" />

<EmccExportedFunction Include="_fmod" />
<EmccExportedFunction Include="_atan2" />
<EmccExportedFunction Include="_fma" />
Expand Down Expand Up @@ -286,7 +288,7 @@
<_EmccLinkFlags Include="--source-map-base http://example.com" />
<_EmccLinkFlags Include="-s WASM_BIGINT=1" />
<_EmccLinkFlags Include="-s EXPORT_NAME=&quot;'createDotnetRuntime'&quot;" />
<_EmccLinkFlags Include="-s MODULARIZE=1"/>
<_EmccLinkFlags Include="-s MODULARIZE=1" />

<_EmccLinkFlags Include="-s ENVIRONMENT=&quot;web,webview,worker,node,shell&quot;" />
<!-- remove -Wno-limited-postlink-optimizations once below issue is fixed
Expand Down Expand Up @@ -364,7 +366,7 @@
<PInvokeTableFile>$(ArtifactsObjDir)wasm/pinvoke-table.h</PInvokeTableFile>
<InterpToNativeTableFile>$(ArtifactsObjDir)wasm/wasm_m2n_invoke.g.h</InterpToNativeTableFile>

<CMakeConfigurationEmccFlags Condition="'$(Configuration)' == 'Debug'">-g -Os -s -DDEBUG=1 -DENABLE_AOT_PROFILER=1 -DENABLE_BROWSER_PROFILER=1</CMakeConfigurationEmccFlags>
<CMakeConfigurationEmccFlags Condition="'$(Configuration)' == 'Debug'">-g -Os -DDEBUG=1 -DENABLE_AOT_PROFILER=1 -DENABLE_BROWSER_PROFILER=1</CMakeConfigurationEmccFlags>
<CMakeConfigurationEmccFlags Condition="'$(Configuration)' == 'Release'">-Oz -DENABLE_BROWSER_PROFILER=1</CMakeConfigurationEmccFlags>

<CMakeConfigurationLinkFlags Condition="'$(Configuration)' == 'Debug'" >$(CMakeConfigurationEmccFlags) -s ASSERTIONS=1 </CMakeConfigurationLinkFlags>
Expand Down Expand Up @@ -481,9 +483,9 @@
DestinationFolder="$(MicrosoftNetCoreAppRuntimePackNativeDir)"
SkipUnchangedFiles="true" />

<Copy SourceFiles="$(NativeBinDir)dotnet.native.worker.js"
<Copy SourceFiles="$(NativeBinDir)dotnet.native.worker.mjs"
DestinationFolder="$(MicrosoftNetCoreAppRuntimePackNativeDir)"
Condition="Exists('$(NativeBinDir)dotnet.native.worker.js')"
Condition="Exists('$(NativeBinDir)dotnet.native.worker.mjs')"
SkipUnchangedFiles="true" />

<Copy SourceFiles="$(NativeBinDir)dotnet.native.js.symbols"
Expand Down
6 changes: 3 additions & 3 deletions src/mono/browser/build/BrowserWasmApp.targets
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

<PropertyGroup>
<_HasDotnetWasm Condition="'%(WasmNativeAsset.FileName)%(WasmNativeAsset.Extension)' == 'dotnet.native.wasm'">true</_HasDotnetWasm>
<_HasDotnetJsWorker Condition="'%(WasmNativeAsset.FileName)%(WasmNativeAsset.Extension)' == 'dotnet.native.worker.js'">true</_HasDotnetJsWorker>
<_HasDotnetJsWorker Condition="'%(WasmNativeAsset.FileName)%(WasmNativeAsset.Extension)' == 'dotnet.native.worker.mjs'">true</_HasDotnetJsWorker>
<_HasDotnetJsSymbols Condition="'%(WasmNativeAsset.FileName)%(WasmNativeAsset.Extension)' == 'dotnet.native.js.symbols'">true</_HasDotnetJsSymbols>
<_HasDotnetNativeJs Condition="'%(WasmNativeAsset.FileName)%(WasmNativeAsset.Extension)' == 'dotnet.native.js'">true</_HasDotnetNativeJs>
<HybridGlobalization Condition="'$(InvariantGlobalization)' == 'true'">false</HybridGlobalization>
Expand All @@ -87,7 +87,7 @@
<WasmNativeAsset Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)dotnet.runtime.js" />
<WasmNativeAsset Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)dotnet.native.wasm" Condition="'$(_HasDotnetWasm)' != 'true'" />
<WasmNativeAsset Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)dotnet.native.js" Condition="'$(_HasDotnetNativeJs)' != 'true'" />
<WasmNativeAsset Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)dotnet.native.worker.js" Condition="'$(_HasDotnetJsWorker)' != 'true' and Exists('$(MicrosoftNetCoreAppRuntimePackRidNativeDir)dotnet.native.worker.js')" />
<WasmNativeAsset Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)dotnet.native.worker.mjs" Condition="'$(_HasDotnetJsWorker)' != 'true' and Exists('$(MicrosoftNetCoreAppRuntimePackRidNativeDir)dotnet.native.worker.mjs')" />
<WasmNativeAsset Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)dotnet.native.js.symbols"
Condition="'$(WasmEmitSymbolMap)' == 'true' and
'$(_HasDotnetJsSymbols)' != 'true' and
Expand Down Expand Up @@ -540,7 +540,7 @@
<ItemGroup>
<WasmNativeAsset Include="$(_WasmIntermediateOutputPath)dotnet.native.wasm" />
<WasmNativeAsset Include="$(_WasmIntermediateOutputPath)dotnet.native.js" />
<WasmNativeAsset Include="$(_WasmIntermediateOutputPath)dotnet.native.worker.js" Condition="Exists('$(_WasmIntermediateOutputPath)dotnet.native.worker.js')" />
<WasmNativeAsset Include="$(_WasmIntermediateOutputPath)dotnet.native.worker.mjs" Condition="Exists('$(_WasmIntermediateOutputPath)dotnet.native.worker.mjs')" />
<WasmNativeAsset Include="$(_WasmIntermediateOutputPath)dotnet.native.js.symbols" Condition="'$(WasmEmitSymbolMap)' == 'true' and Exists('$(_WasmIntermediateOutputPath)dotnet.native.js.symbols')" />
<_WasmAssembliesInternal Remove="$(_WasmDedupAssembly)"/>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/mono/browser/emscripten-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.34
3.1.56
2 changes: 1 addition & 1 deletion src/mono/browser/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ set(ignoreMeEmsdkPath "${EMSDK_PATH}")

if(CMAKE_BUILD_TYPE STREQUAL "Release")
add_custom_command(TARGET dotnet.native
POST_BUILD COMMAND ${EMSDK_PATH}/upstream/bin/wasm-opt --enable-exception-handling ${CONFIGURATION_WASM_OPT_FLAGS} --strip-dwarf ${NATIVE_BIN_DIR}/dotnet.native.wasm -o ${NATIVE_BIN_DIR}/dotnet.native.wasm
POST_BUILD COMMAND ${EMSDK_PATH}/upstream/bin/wasm-opt --enable-exception-handling --enable-simd --enable-bulk-memory ${CONFIGURATION_WASM_OPT_FLAGS} --strip-dwarf ${NATIVE_BIN_DIR}/dotnet.native.wasm -o ${NATIVE_BIN_DIR}/dotnet.native.wasm
COMMENT "Stripping debug symbols from dotnet.native.wasm using wasm-opt")
endif()

Expand Down
6 changes: 3 additions & 3 deletions src/mono/browser/runtime/cwraps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,10 @@ function cwrap (name: string, returnType: string | null, argTypes: string[] | un
// Only attempt to do fast calls if all the args and the return type are either number or void
(fastCwrapTypes.indexOf(returnType) >= 0) &&
(!argTypes || argTypes.every(atype => fastCwrapTypes.indexOf(atype) >= 0)) &&
// Module["asm"] may not be defined yet if we are early enough in the startup process
// Module["wasmExports"] may not be defined yet if we are early enough in the startup process
// in that case, we need to rely on emscripten's lazy wrappers
Module["asm"]
? <Function>((<any>Module["asm"])[name])
Module["wasmExports"]
? <Function>((<any>Module["wasmExports"])[name])
: undefined;

// If the argument count for the wasm function doesn't match the signature, fall back to cwrap
Expand Down
2 changes: 1 addition & 1 deletion src/mono/browser/runtime/es6/dotnet.es6.pre.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
if (_nativeModuleLoaded) throw new Error("Native module already loaded");
_nativeModuleLoaded = true;
createDotnetRuntime = Module = createDotnetRuntime(Module);
createDotnetRuntime = Module = moduleArg(Module);
2 changes: 1 addition & 1 deletion src/mono/browser/runtime/jiterpreter-jit-call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export function mono_interp_invoke_wasm_jit_call_trampoline (
thunk(ret_sp, sp, ftndesc, thrown);
} catch (exc: any) {
receiveWorkerHeapViews();
const exceptionTag = (<any>Module)["asm"]["__cpp_exception"];
const exceptionTag = (<any>Module)["wasmExports"]["__cpp_exception"];
const haveTag = exceptionTag instanceof (<any>WebAssembly).Tag;
if (
!haveTag || (
Expand Down
4 changes: 2 additions & 2 deletions src/mono/browser/runtime/jiterpreter-support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export class WasmBuilder {
}

getExceptionTag (): any {
const exceptionTag = (<any>Module)["asm"]["__cpp_exception"];
const exceptionTag = (<any>Module)["wasmExports"]["__cpp_exception"];
if (typeof (exceptionTag) !== "undefined")
mono_assert(exceptionTag instanceof (<any>WebAssembly).Tag, () => `expected __cpp_exception export from dotnet.wasm to be WebAssembly.Tag but was ${exceptionTag}`);
return exceptionTag;
Expand Down Expand Up @@ -1833,7 +1833,7 @@ export function getMemberOffset (member: JiterpMember) {
}

export function getRawCwrap (name: string): Function {
const result = (<any>Module)["asm"][name];
const result = (<any>Module)["wasmExports"][name];
if (typeof (result) !== "function")
throw new Error(`raw cwrap ${name} not found`);
return result;
Expand Down
1 change: 1 addition & 0 deletions src/mono/browser/runtime/loader/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,7 @@ export function preloadWorkers () {
const workerNumber = loaderHelpers.workerNextNumber++;
const worker: Partial<PThreadWorker> = new Worker(jsModuleWorker.resolvedUrl!, {
name: "dotnet-worker-" + workerNumber.toString().padStart(3, "0"),
type: "module",
});
worker.info = {
workerNumber,
Expand Down
1 change: 1 addition & 0 deletions src/mono/browser/runtime/pthreads/ui-thread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ function allocateUnusedWorker (): PThreadWorker {
const workerNumber = loaderHelpers.workerNextNumber++;
const worker = new Worker(uri, {
name: "dotnet-worker-" + workerNumber.toString().padStart(3, "0"),
type: "module",
}) as PThreadWorker;
getUnusedWorkerPool().push(worker);
worker.loaded = false;
Expand Down
2 changes: 1 addition & 1 deletion src/mono/browser/runtime/types/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ export declare interface EmscriptenModuleInternal {
FS: any;
wasmModule: WebAssembly.Instance | null;
ready: Promise<unknown>;
asm: any;
wasmExports: any;
getWasmTableEntry(index: number): any;
removeRunDependency(id: string): void;
addRunDependency(id: string): void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ runtimeType is RuntimeVariant.SingleThreaded
public string GetRuntimeNativeDir(string tfm = BuildTestBase.DefaultTargetFramework, RuntimeVariant runtimeType = RuntimeVariant.SingleThreaded)
=> Path.Combine(GetRuntimePackDir(tfm, runtimeType), "runtimes", DefaultRuntimeIdentifier, "native");
public bool IsMultiThreadingRuntimePackAvailableFor(string tfm)
=> IsWorkload && File.Exists(Path.Combine(GetRuntimeNativeDir(tfm, RuntimeVariant.MultiThreaded), "dotnet.native.worker.js"));
=> IsWorkload && File.Exists(Path.Combine(GetRuntimeNativeDir(tfm, RuntimeVariant.MultiThreaded), "dotnet.native.worker.mjs"));

public static string WasmOverridePacksTargetsPath = Path.Combine(TestDataPath, "WasmOverridePacks.targets");

Expand Down
6 changes: 3 additions & 3 deletions src/mono/wasm/Wasm.Build.Tests/TestMainJsProjectProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected override IReadOnlyDictionary<string, bool> GetAllKnownDotnetFilesToFin
{ "dotnet.native.js", false },
{ "dotnet.native.js.symbols", false },
{ "dotnet.native.wasm", false },
{ "dotnet.native.worker.js", false },
{ "dotnet.native.worker.mjs", false },
{ "dotnet.runtime.js", false },
{ "dotnet.runtime.js.map", false }
};
Expand All @@ -51,13 +51,13 @@ protected override IReadOnlySet<string> GetDotNetFilesExpectedSet(AssertBundleOp
res.Add("dotnet.native.wasm");
res.Add("dotnet.native.js");
res.Add("dotnet.runtime.js");
res.Add("dotnet.native.worker.js");
res.Add("dotnet.native.worker.mjs");

if (!assertOptions.IsPublish)
{
res.Add("dotnet.js.map");
res.Add("dotnet.runtime.js.map");
res.Add("dotnet.native.worker.js.map");
res.Add("dotnet.native.worker.mjs.map");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected override IReadOnlyDictionary<string, bool> GetAllKnownDotnetFilesToFin
{ "dotnet.native.js", true },
{ "dotnet.native.js.symbols", false },
{ "dotnet.native.wasm", false },
{ "dotnet.native.worker.js", true },
{ "dotnet.native.worker.mjs", true },
{ "dotnet.runtime.js", true },
{ "dotnet.runtime.js.map", false },
};
Expand All @@ -43,7 +43,7 @@ protected override IReadOnlySet<string> GetDotNetFilesExpectedSet(AssertBundleOp
};
if (assertOptions.RuntimeType is RuntimeVariant.MultiThreaded)
{
res.Add("dotnet.native.worker.js");
res.Add("dotnet.native.worker.mjs");
}

if (!assertOptions.IsPublish)
Expand Down Expand Up @@ -107,7 +107,7 @@ public void AssertBundle(AssertWasmSdkBundleOptions assertOptions)
string buildType = assertOptions.IsPublish ? "publish" : "build";
var nativeFilesToCheck = new List<string>() { "dotnet.native.wasm", "dotnet.native.js" };
if (assertOptions.RuntimeType == RuntimeVariant.MultiThreaded)
nativeFilesToCheck.Add("dotnet.native.worker.js");
nativeFilesToCheck.Add("dotnet.native.worker.mjs");
foreach (string nativeFilename in nativeFilesToCheck)
{
if (!actualDotnetFiles.TryGetValue(nativeFilename, out DotNetFileName? dotnetFile))
Expand All @@ -121,7 +121,7 @@ public void AssertBundle(AssertWasmSdkBundleOptions assertOptions)

if (assertOptions.ExpectedFileType != NativeFilesType.FromRuntimePack)
{
if (nativeFilename == "dotnet.native.worker.js")
if (nativeFilename == "dotnet.native.worker.mjs")
{
Console.WriteLine($"Skipping the verification whether {nativeFilename} is from the runtime pack. The check wouldn't be meaningful as the runtime pack file has the same size as the relinked file");
continue;
Expand Down
2 changes: 1 addition & 1 deletion src/mono/wasm/build/WasmApp.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@
<Target Name="_RunWasmOptPostLink" Condition="'$(WasmRunWasmOpt)' == 'true'">
<Error Condition="'$(_WasmOutputFileName)' == ''" Text="Could not determine %24(_WasmOutputFileName)" />

<Exec Command="wasm-opt$(_ExeExt) @(WasmOptConfigurationFlags, ' ') &quot;$(_WasmIntermediateOutputPath)$(_WasmOutputFileName)&quot; -o &quot;$(_WasmIntermediateOutputPath)$(_WasmOutputFileName)&quot;"
<Exec Command="wasm-opt$(_ExeExt) --enable-simd --enable-exception-handling --enable-bulk-memory @(WasmOptConfigurationFlags, ' ') &quot;$(_WasmIntermediateOutputPath)$(_WasmOutputFileName)&quot; -o &quot;$(_WasmIntermediateOutputPath)$(_WasmOutputFileName)&quot;"
pavelsavara marked this conversation as resolved.
Show resolved Hide resolved
IgnoreStandardErrorWarningFormat="true"
EnvironmentVariables="@(WasmToolchainEnvVars)" />
</Target>
Expand Down
2 changes: 1 addition & 1 deletion src/native/libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI)
endif ()

set(CMAKE_INSTALL_PREFIX $ENV{__CMakeBinDir})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wno-declaration-after-statement")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wno-declaration-after-statement -Wno-pre-c11-compat")

add_compile_options(-I${CMAKE_CURRENT_SOURCE_DIR}/Common)
add_compile_options(-I${CMAKE_CURRENT_BINARY_DIR}/Common)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ public static bool ShouldFilterCandidate(
".ts" when fromMonoPackage && fileName == "dotnet.d" => "dotnet type definition is not used by Blazor",
".map" when !emitSourceMap && fromMonoPackage && (fileName == "dotnet.js" || fileName == "dotnet.runtime.js") => "source map file is not published",
".ts" when fromMonoPackage && fileName == "dotnet-legacy.d" => "dotnet type definition is not used by Blazor",
".js" when assetType == "native" && !(dotnetJsSingleThreadNames.Contains(fileName) || (enableThreads && fileName == "dotnet.native.worker")) => $"{fileName}{extension} is not used by Blazor",
".js" when assetType == "native" && !dotnetJsSingleThreadNames.Contains(fileName) => $"{fileName}{extension} is not used by Blazor",
".mjs" when assetType == "native" && !(enableThreads && fileName == "dotnet.native.worker") => $"{fileName}{extension} is not used by Blazor",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the code in this project is used when targeting downlevel versions and we don't have it covered with tests. Threading is not supported there, but it would be good to not break it.

".pdb" when !copySymbols => "copying symbols is disabled",
".symbols" when fromMonoPackage => "extension .symbols is not required.",
_ => null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static void AddDictionary(StringBuilder sb, Dictionary<string, string>? res)
public Dictionary<string, string>? GetNativeResourceTargetInBootConfig(BootJsonData bootConfig, string resourceName)
{
string resourceExtension = Path.GetExtension(resourceName);
if (resourceName.StartsWith("dotnet.native.worker", StringComparison.OrdinalIgnoreCase) && string.Equals(resourceExtension, ".js", StringComparison.OrdinalIgnoreCase))
if (resourceName.StartsWith("dotnet.native.worker", StringComparison.OrdinalIgnoreCase) && string.Equals(resourceExtension, ".mjs", StringComparison.OrdinalIgnoreCase))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is code that impacts Net8, it still needs to consider .js, I think

return bootConfig.resources.jsModuleWorker ??= new();
else if (resourceName.StartsWith("dotnet.native", StringComparison.OrdinalIgnoreCase) && string.Equals(resourceExtension, ".js", StringComparison.OrdinalIgnoreCase))
return bootConfig.resources.jsModuleNative ??= new();
Expand Down
Loading
Loading