runtime icon indicating copy to clipboard operation
runtime copied to clipboard

[wasm-ep] Use DOTNET_DiagnosticPorts to configure Diagnostic Server

Open lambdageek opened this issue 3 years ago • 9 comments

Parse it the same way that the C code does:

   <uri>[,<connect|listen>][,<suspend|nosuspend>]
  • uri should be a websocket uri
  • listen is not supported as it doesn't make sense with a WebSocket
  • connect is the default if omitted
  • suspend is the default if omitted

Additionally, move mono_wasm_diagnostics_init to later in the startup flow. This gives Blazor a chance to set DOTNET_DiagnosticPorts from their onRuntimeInitialized callback. An unfortunate problem here is that blazor and non-blazor startup need to call diagnostics init from different places because of how environment variables are populated. So we try to init diagnostics twice and set a flag.

Fixes https://github.com/dotnet/runtime/issues/73011

lambdageek avatar Aug 04 '22 13:08 lambdageek

Tagging subscribers to 'arch-wasm': @lewing See info in area-owners.md if you want to be subscribed.

Issue Details

Parse it the same way that the C code does:

   <uri>[,<connect|listen>][,<suspend|nosuspend>]
  • uri should be a websocket uri
  • listen is not supported as it doesn't make sense with a WebSocket
  • connect is the default if omitted
  • suspend is the default if omitted

Additionally, move mono_wasm_diagnostics_init to later in the startup flow. This gives Blazor a chance to set DOTNET_DiagnosticPorts from their onRuntimeInitialized callback.

Fixes https://github.com/dotnet/runtime/issues/73011

Author: lambdageek
Assignees: lambdageek
Labels:

arch-wasm, area-System.Runtime.InteropServices.JavaScript

Milestone: -

msftbot[bot] avatar Aug 04 '22 13:08 msftbot[bot]

Please also update src\mono\sample\wasm\browser-eventpipe\main.js to use the env variable Ideally also replacing BINDING.bind_static_method with [JSExport] or is @maraf already looking at that ?

pavelsavara avatar Aug 04 '22 13:08 pavelsavara

Ideally also replacing BINDING.bind_static_method with [JSExport] or is @maraf Marek Fisera FTE already looking at that ?

Rewrite to JSExport is here https://github.com/dotnet/runtime/pull/73367

maraf avatar Aug 04 '22 13:08 maraf

@pavelsavara @maraf I'd like to get https://github.com/dotnet/runtime/pull/73305 in before this one. I can't really test what's here until that other PR goes on.

@maraf I think I want to delete of browser-mt-eventpipe. It was just a proof of concept. browser-eventpipe is good (and i'll update it to use DOTNET_DiagnosticPorts) and the new browser-threads in #73305 is good. Both of them should be able to run in CI, I think. browser-mt-eventpipe isn't really needed.

lambdageek avatar Aug 04 '22 13:08 lambdageek

/azp run runtime-wasm

lambdageek avatar Aug 06 '22 04:08 lambdageek

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Aug 06 '22 04:08 azure-pipelines[bot]

/azp run runtime-wasm

lambdageek avatar Aug 07 '22 18:08 lambdageek

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Aug 07 '22 18:08 azure-pipelines[bot]

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Aug 07 '22 18:08 azure-pipelines[bot]

/azp run runtime-wasm

lambdageek avatar Aug 08 '22 13:08 lambdageek

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Aug 08 '22 13:08 azure-pipelines[bot]