-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[wasm-ep] Use DOTNET_DiagnosticPorts to configure Diagnostic Server #73370
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
Changes from all commits
895861d
772da3f
7d97577
4f5ab15
a8873ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 MonoWasmThreads from "consts:monoWasmThreads"; | ||
| import { mono_assert, CharPtrNull, DotnetModule, MonoConfig, MonoConfigError, LoadingResource, AssetEntry, ResourceRequest } from "./types"; | ||
| import { ENVIRONMENT_IS_NODE, ENVIRONMENT_IS_SHELL, INTERNAL, Module, runtimeHelpers } from "./imports"; | ||
| import cwraps, { init_c_exports } from "./cwraps"; | ||
|
|
@@ -25,6 +26,7 @@ import { cwraps_internal } from "./exports-internal"; | |
| import { cwraps_binding_api, cwraps_mono_api } from "./net6-legacy/exports-legacy"; | ||
| import { DotnetPublicAPI } from "./export-types"; | ||
| import { BINDING, MONO } from "./net6-legacy/imports"; | ||
| import { mono_wasm_init_diagnostics } from "./diagnostics"; | ||
|
|
||
| let all_assets_loaded_in_memory: Promise<void> | null = null; | ||
| const loaded_files: { url: string, file: string }[] = []; | ||
|
|
@@ -130,8 +132,8 @@ function preInit(isCustomStartup: boolean, userPreInit: (() => void)[]) { | |
| abort_startup(err, true); | ||
| throw err; | ||
| } | ||
| // this will start immediately but return on first await. | ||
| // It will block our `preRun` by afterPreInit promise | ||
| // this will start immediately but return on first await. | ||
| // It will block our `preRun` by afterPreInit promise | ||
| // It will block emscripten `userOnRuntimeInitialized` by pending addRunDependency("mono_pre_init") | ||
| (async () => { | ||
| try { | ||
|
|
@@ -196,7 +198,7 @@ async function onRuntimeInitializedAsync(isCustomStartup: boolean, userOnRuntime | |
| _print_error("MONO_WASM: user callback onRuntimeInitialized() failed", err); | ||
| throw err; | ||
| } | ||
| // finish | ||
| // finish | ||
| await mono_wasm_after_user_runtime_initialized(); | ||
| } catch (err) { | ||
| _print_error("MONO_WASM: onRuntimeInitializedAsync() failed", err); | ||
|
|
@@ -326,6 +328,10 @@ async function mono_wasm_after_user_runtime_initialized(): Promise<void> { | |
| } | ||
| } | ||
| } | ||
| // for Blazor, init diagnostics after their "onRuntimeInitalized" sets env variables, but before their postRun callback (which calls mono_wasm_load_runtime) | ||
| if (MonoWasmThreads) { | ||
|
||
| await mono_wasm_init_diagnostics("env"); | ||
| } | ||
|
|
||
| if (runtimeHelpers.diagnosticTracing) console.debug("MONO_WASM: Initializing mono runtime"); | ||
|
|
||
|
|
@@ -532,8 +538,10 @@ async function _apply_configuration_from_args() { | |
|
|
||
| if (config.coverageProfilerOptions) | ||
| mono_wasm_init_coverage_profiler(config.coverageProfilerOptions); | ||
|
|
||
| // FIXME await mono_wasm_init_diagnostics(config.diagnosticOptions); | ||
| // for non-Blazor, init diagnostics after environment variables are set | ||
| if (MonoWasmThreads) { | ||
| await mono_wasm_init_diagnostics("env"); | ||
| } | ||
| } | ||
|
|
||
| export function mono_wasm_load_runtime(unused?: string, debugLevel?: number): void { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the signature with
DiagnosticOptionsparam type still useful ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. I want to do a follow up PR to simplify more of the diagnostics support. removing this argument is just one piece.