Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
18b5fe6
Fix AsyncVoidMethodBuilder race condition around SynchronizationConte…
github-actions[bot] Mar 13, 2024
f09cd44
Always keep global symbols on ApplePlatforms (#99650)
github-actions[bot] Mar 13, 2024
c0a2606
Delete Decrypt_Pkcs1_ErrorsForInvalidPadding
github-actions[bot] Mar 13, 2024
c412efb
Rename MSBuild property MicrosoftNativeQuicMsQuicVersion -> Microsoft…
carlossanlop Mar 14, 2024
e373424
Fixing SignedXml.CheckSignature for enveloped signature with `#xpoint…
bartonjs Mar 14, 2024
50c3c86
[release/8.0-staging] disable optimizations for PopCount (#99832)
github-actions[bot] Mar 15, 2024
ff80834
[release/8.0-staging] Handle NativeOverlapped* coming from both the W…
github-actions[bot] Mar 16, 2024
cf1182c
Fix exporting certificate keys on macOS 14.4.
github-actions[bot] Mar 19, 2024
c27b203
[release/8.0] Upgrade zlib to 1.3.1 (#99473)
carlossanlop Mar 20, 2024
250354b
Fix failing CertificateValidationRemoteServer.ConnectWithRevocation_W…
rzikm Mar 20, 2024
afb3fca
[mono] Stop exporting ICU symbols from Mono (#99449)
matouskozak Mar 20, 2024
99c7022
[release/8.0-staging] Fix AV in HttpTelemetry.WriteEvent (#99607)
github-actions[bot] Mar 21, 2024
155a4ab
Merge branch 'release/8.0-staging' into merge/release/8.0-to-release/…
carlossanlop Mar 25, 2024
b7f0477
[Http/2] Fix handling of effectively empty DATA frame (#99502) (#99677)
ManickaP Mar 26, 2024
3f774aa
[release/8.0-staging] [HttpStress] [SslStress] Workaround image bug i…
github-actions[bot] Mar 27, 2024
ab416e9
Support building against clang 18 (#100258)
omajid Mar 27, 2024
f36dd88
[release/8.0][browser] WebSocket works differently depending on if we…
ilonatommy Mar 28, 2024
ba9df1e
[release/8.0-staging] Call the Copy Constructor for stack arguments i…
AaronRobinsonMSFT Mar 30, 2024
3ea18f2
[release/8.0] Don't unset ALPN list pointer during ALPN selection cal…
github-actions[bot] Apr 2, 2024
9de64a2
Backport of #99843 (#99844)
thaystg Apr 2, 2024
7d45915
[release/8.0-staging] Ensure that Sse3.MoveAndDuplicate correctly tra…
tannergooding Apr 4, 2024
7ae2d00
Fix allocation of empty array in the frozen heap for collectible type…
jkotas Apr 4, 2024
479defb
Use clang --version to get Apple toolset version (#100199)
github-actions[bot] Apr 4, 2024
d49f6cf
Azure Linux 3.0 deps package (#100684)
github-actions[bot] Apr 5, 2024
2b94204
Fix Http2 deadlock (#100086)
github-actions[bot] Apr 9, 2024
0de7023
[release/8.0-staging] Update CI builds to not use VS Previews (#100622)
github-actions[bot] Apr 10, 2024
4be29ad
Update dependencies from https://github.com/dotnet/hotreload-utils bu…
dotnet-maestro[bot] Apr 12, 2024
cca20d0
[release/8.0-staging] Update dependencies from dotnet/runtime-assets …
dotnet-maestro[bot] Apr 12, 2024
4814719
Merge pull request #99585 from dotnet-maestro-bot/merge/release/8.0-t…
ericstj Apr 12, 2024
f37eb48
Update dependencies from https://github.com/dotnet/source-build-exter…
dotnet-maestro[bot] Apr 12, 2024
0a26d20
Update dependencies from https://github.com/dotnet/xharness build 202…
dotnet-maestro[bot] Apr 12, 2024
24e52a0
[release/8.0-staging] Update dependencies from dotnet/source-build-re…
dotnet-maestro[bot] Apr 12, 2024
b1b775e
[release/8.0-staging] Update dependencies from dotnet/source-build-ex…
dotnet-maestro[bot] Apr 12, 2024
be4864f
Update dependencies from https://github.com/dotnet/runtime-assets bui…
dotnet-maestro[bot] Apr 12, 2024
78cde87
Update dependencies from https://github.com/dotnet/arcade build 20240…
dotnet-maestro[bot] Apr 12, 2024
9b82dcc
Fix native leak in CryptoNative_GetX509nameInfo
github-actions[bot] Apr 12, 2024
7fa8815
[release/8.0-staging] Update dependencies from dotnet/emsdk (#99696)
dotnet-maestro[bot] Apr 12, 2024
f9feb68
Try to find seqpoints directly from jitinfo if it's not find on get_d…
github-actions[bot] Apr 13, 2024
af764fd
[release/8.0][browser] fix emscripten out/err overrides (#100818)
pavelsavara Apr 15, 2024
cd27afe
[mono][eventpipe] Fix firing dynamic method wrappers crash (#99712)
github-actions[bot] Apr 15, 2024
f0f42cc
Update Alpine versions for `release/8.0-staging` (#99849)
richlander Apr 15, 2024
6f29267
[release/8.0-staging] Guard against -1 Returned from sysconf for the …
github-actions[bot] Apr 15, 2024
a494d22
[Release/8.0] Remove preventing EH at shutdown (#100836)
janvorli Apr 15, 2024
3c5a0af
Add workload metadata (#100649)
joeloff Apr 15, 2024
2d7642d
System.Diagnostics.DiagnosticSource (#99583)
carlossanlop Apr 15, 2024
88be910
Always zero-init if object contains pointers (#100265) (#100426)
VSadov Apr 15, 2024
aa7c7ff
[release/8.0-staging] JIT: Fixed incorrect reversed condition for GT …
github-actions[bot] Apr 15, 2024
befe7ad
Merge branch 'release/8.0' into release/8.0-staging
directhex Apr 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
Prev Previous commit
Next Next commit
[release/8.0][browser] fix emscripten out/err overrides (#100818)
* backport of #100630

* fix

* fix
  • Loading branch information
pavelsavara authored Apr 15, 2024
commit af764fd245c4a90b59ac8b29ad9ae95f705beac4
2 changes: 1 addition & 1 deletion eng/testing/scenarios/BuildWasmAppsJobsList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ Wasm.Build.Tests.WasmRunOutOfAppBundleTests
Wasm.Build.Tests.WasmSIMDTests
Wasm.Build.Tests.WasmTemplateTests
Wasm.Build.Tests.WorkloadTests
Wasm.Build.Tests.TestAppScenarios.DownloadResourceProgressTests
Wasm.Build.Tests.TestAppScenarios.ModuleConfigTests
Wasm.Build.Tests.MT.Blazor.SimpleMultiThreadedTests
1 change: 1 addition & 0 deletions src/mono/sample/wasm/browser-advanced/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ try {
console.log('user code Module.onDotnetReady');
},
postRun: () => { console.log('user code Module.postRun'); },
out: (text) => { console.log("ADVANCED:" + text) },
})
.withResourceLoader((type, name, defaultUri, integrity, behavior) => {
// loadBootResource could return string with unqualified name of resource. It assumes that we resolve it with document.baseURI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

namespace Wasm.Build.Tests.TestAppScenarios;

public class DownloadResourceProgressTests : AppTestBase
public class ModuleConfigTests : AppTestBase
{
public DownloadResourceProgressTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext)
public ModuleConfigTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext)
: base(output, buildContext)
{
}
Expand All @@ -25,7 +25,7 @@ public DownloadResourceProgressTests(ITestOutputHelper output, SharedBuildPerTes
[InlineData(true)]
public async Task DownloadProgressFinishes(bool failAssemblyDownload)
{
CopyTestAsset("WasmBasicTestApp", $"DownloadResourceProgressTests_{failAssemblyDownload}");
CopyTestAsset("WasmBasicTestApp", $"ModuleConfigTests_DownloadProgressFinishes_{failAssemblyDownload}");
PublishProject("Debug");

var result = await RunSdkStyleApp(new(
Expand Down Expand Up @@ -54,4 +54,24 @@ public async Task DownloadProgressFinishes(bool failAssemblyDownload)
: "The download progress test did emit unexpected message about failing download"
);
}

[Fact]
public async Task OutErrOverrideWorks()
{
CopyTestAsset("WasmBasicTestApp", $"ModuleConfigTests_OutErrOverrideWorks");
PublishProject("Debug");

var result = await RunSdkStyleApp(new(
Configuration: "Debug",
TestScenario: "OutErrOverrideWorks"
));
Assert.True(
result.ConsoleOutput.Any(m => m.Contains("Emscripten out override works!")),
"Emscripten out override doesn't work"
);
Assert.True(
result.ConsoleOutput.Any(m => m.Contains("Emscripten err override works!")),
"Emscripten err override doesn't work"
);
}
}
3 changes: 2 additions & 1 deletion src/mono/wasm/runtime/loader/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { mono_exit } from "./exit";
import { addCachedReponse, findCachedResponse } from "./assetsCache";
import { getIcuResourceName } from "./icu";
import { makeURLAbsoluteWithApplicationBase } from "./polyfills";
import { mono_log_info } from "./logging";


let throttlingPromise: PromiseAndController<void> | undefined;
Expand Down Expand Up @@ -545,7 +546,7 @@ async function start_asset_download_sources(asset: AssetEntryInternal): Promise<
err.status = response.status;
throw err;
} else {
loaderHelpers.out(`optional download '${response.url}' for ${asset.name} failed ${response.status} ${response.statusText}`);
mono_log_info(`optional download '${response.url}' for ${asset.name} failed ${response.status} ${response.statusText}`);
return undefined;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/mono/wasm/runtime/loader/icu.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

import { mono_log_error } from "./logging";
import { GlobalizationMode, MonoConfig } from "../types";
import { ENVIRONMENT_IS_WEB, loaderHelpers } from "./globals";
import { mono_log_info, mono_log_debug } from "./logging";
Expand All @@ -18,7 +19,7 @@ export function init_globalization() {
loaderHelpers.preferredIcuAsset = null;
} else {
const msg = "invariant globalization mode is inactive and no ICU data archives are available";
loaderHelpers.err(`ERROR: ${msg}`);
mono_log_error(`ERROR: ${msg}`);
throw new Error(msg);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/mono/wasm/runtime/loader/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ async function initializeModules(es6Modules: [RuntimeModuleExportsInternal, Nati
const { default: emscriptenFactory } = es6Modules[1];
setRuntimeGlobals(globalObjectsRoot);
initializeExports(globalObjectsRoot);
await configureRuntimeStartup();
await configureRuntimeStartup(globalObjectsRoot.module);
loaderHelpers.runtimeModuleLoaded.promise_control.resolve();

emscriptenFactory((originalModule: EmscriptenModuleInternal) => {
Expand Down
29 changes: 17 additions & 12 deletions src/mono/wasm/runtime/startup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,23 @@ import { assertNoProxies } from "./gc-handles";
// default size if MonoConfig.pthreadPoolSize is undefined
const MONO_PTHREAD_POOL_SIZE = 4;

export async function configureRuntimeStartup(): Promise<void> {
export async function configureRuntimeStartup (module: DotnetModuleInternal): Promise<void> {
if (!module.out) {
// eslint-disable-next-line no-console
module.out = console.log.bind(console);
}
if (!module.err) {
// eslint-disable-next-line no-console
module.err = console.error.bind(console);
}
if (!module.print) {
module.print = module.out;
}
if (!module.printErr) {
module.printErr = module.err;
}
loaderHelpers.out = module.print;
loaderHelpers.err = module.printErr;
await init_polyfills_async();
await checkMemorySnapshotSize();
}
Expand All @@ -54,17 +70,6 @@ export function configureEmscriptenStartup(module: DotnetModuleInternal): void {
module.locateFile = module.__locateFile = (path) => loaderHelpers.scriptDirectory + path;
}

if (!module.out) {
// eslint-disable-next-line no-console
module.out = console.log.bind(console);
}

if (!module.err) {
// eslint-disable-next-line no-console
module.err = console.error.bind(console);
}
loaderHelpers.out = module.out;
loaderHelpers.err = module.err;
module.mainScriptUrlOrBlob = loaderHelpers.scriptUrl;// this is needed by worker threads

// these all could be overridden on DotnetModuleConfig, we are chaing them to async below, as opposed to emscripten
Expand Down
6 changes: 4 additions & 2 deletions src/mono/wasm/runtime/types/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,8 @@ export declare interface EmscriptenModuleInternal {
runtimeKeepalivePush(): void;
runtimeKeepalivePop(): void;
maybeExit(): void;
print(message: string): void;
printErr(message: string): void;
}

/// A PromiseController encapsulates a Promise together with easy access to its resolve and reject functions.
Expand Down Expand Up @@ -492,7 +494,7 @@ export type setGlobalObjectsType = (globalObjects: GlobalObjects) => void;
export type initializeExportsType = (globalObjects: GlobalObjects) => RuntimeAPI;
export type initializeReplacementsType = (replacements: EmscriptenReplacements) => void;
export type configureEmscriptenStartupType = (module: DotnetModuleInternal) => void;
export type configureRuntimeStartupType = () => Promise<void>;
export type configureRuntimeStartupType = (module: DotnetModuleInternal) => Promise<void>;
export type configureWorkerStartupType = (module: DotnetModuleInternal) => Promise<void>


Expand All @@ -508,4 +510,4 @@ export type RuntimeModuleExportsInternal = {

export type NativeModuleExportsInternal = {
default: (unificator: Function) => EmscriptenModuleInternal
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
// The .NET Foundation licenses this file to you under the MIT license.

System.Console.WriteLine("WasmBasicTestApp");
System.Console.Error.WriteLine("WasmBasicTestApp stderr");
15 changes: 15 additions & 0 deletions src/mono/wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ switch (testCase) {
}
});
break;
case "OutErrOverrideWorks":
dotnet.withModuleConfig({
out: (message) => {
console.log("Emscripten out override works!");
console.log(message)
},
err: (message) => {
console.error("Emscripten err override works!");
console.error(message)
},
});
break;
}

const { getAssemblyExports, getConfig, INTERNAL } = await dotnet.create();
Expand Down Expand Up @@ -94,6 +106,9 @@ try {
case "DownloadResourceProgressTest":
exit(0);
break;
case "OutErrOverrideWorks":
dotnet.run();
break;
default:
console.error(`Unknown test case: ${testCase}`);
exit(3);
Expand Down