Skip to content

[wasm] asset loading for workers#73484

Merged
pavelsavara merged 8 commits into
dotnet:mainfrom
pavelsavara:wasm_load_crypto_asset
Aug 9, 2022
Merged

[wasm] asset loading for workers#73484
pavelsavara merged 8 commits into
dotnet:mainfrom
pavelsavara:wasm_load_crypto_asset

Conversation

@pavelsavara

@pavelsavara pavelsavara commented Aug 5, 2022

Copy link
Copy Markdown
Member
  • move asset related logic to separate fileassets.ts
  • split logging code into separate file logging.ts
  • add dotnet.wasm and dotnet-crypto-worker.js to mono-config.json via WasmAppBuilder
  • moved readSymbolMapFile() call to startup.ts
  • fixed bug in setup_proxy_console() which didn't really copy the original log and error functions of the console and caused recursion on error.
  • moved init_crypto after mono_wasm_load_config in mono_wasm_pre_init_essential_async
  • added new resource type js-module-crypto and js-module-threads
  • changed the detection of blazor startup sequence to not be disabled by presence of config, but only by config.assets having some assembly in it.

Most of this changes were moved from #73073 where is log of discussions about it
Together with dotnet/aspnetcore#43049

- split logging code into separate file `logging.ts`
- add `dotnet.wasm` and `dotnet-crypto-worker.js` to mono-config.json
- moved `readSymbolMapFile()` call to `startup.ts`
- fixed bug in `setup_proxy_console()` which didn't really copy the original `log` and `error` functions of the console and caused recursion on error.
- moved `init_crypto` after `mono_wasm_load_config` in `mono_wasm_pre_init_essential_async`
- added new resource type `js-module-crypto` and `js-module-threads`
- changed the detection of blazor startup sequence to not be disabled by presence of config, but only by config.assets having some assembly in it.
@pavelsavara pavelsavara added this to the 7.0.0 milestone Aug 5, 2022
@pavelsavara pavelsavara self-assigned this Aug 5, 2022
@ghost

ghost commented Aug 5, 2022

Copy link
Copy Markdown

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

Issue Details
  • move asset related logic to separate fileassets.ts
  • split logging code into separate file logging.ts
  • add dotnet.wasm and dotnet-crypto-worker.js to mono-config.json via WasmAppBuilder
  • moved readSymbolMapFile() call to startup.ts
  • fixed bug in setup_proxy_console() which didn't really copy the original log and error functions of the console and caused recursion on error.
  • moved init_crypto after mono_wasm_load_config in mono_wasm_pre_init_essential_async
  • added new resource type js-module-crypto and js-module-threads
  • changed the detection of blazor startup sequence to not be disabled by presence of config, but only by config.assets having some assembly in it.
Author: pavelsavara
Assignees: pavelsavara
Labels:

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

Milestone: 7.0.0

@pavelsavara

Copy link
Copy Markdown
Member Author

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara
pavelsavara requested a review from maraf August 5, 2022 18:35

@maraf maraf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Comment thread src/mono/wasm/runtime/startup.ts Outdated
pavelsavara and others added 2 commits August 6, 2022 07:02
# Conflicts:
#	src/mono/wasm/runtime/crypto-worker.ts
#	src/mono/wasm/runtime/workers/dotnet-crypto-worker.js
Co-authored-by: Marek Fišera <mara@neptuo.com>
@pavelsavara

Copy link
Copy Markdown
Member Author

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
Member Author

Unfortunately the deadlock is still with us. Log

@radical

radical commented Aug 6, 2022

Copy link
Copy Markdown
Member

You can run the tests a good bunch(30?) of times on helix, which can be done in one shot as we had discussed offline. It is helpful in finding similar issues.

I wonder if we should always do that for tests that depend on workers, on CI.

@pavelsavara

Copy link
Copy Markdown
Member Author

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
Member Author

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Pull request contains merge conflicts.

# Conflicts:
#	src/mono/wasm/runtime/startup.ts
@pavelsavara

Copy link
Copy Markdown
Member Author

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
Member Author

@radical

radical commented Aug 9, 2022

Copy link
Copy Markdown
Member

The wasm/debugger test failures are unrelated, and will be fixed by #73524 .

@radical

radical commented Aug 9, 2022

Copy link
Copy Markdown
Member

We should queue up the crypto deadlock fix right after this. If this happens to cause any issue with crypto, then it can be fixed in that PR.

@pavelsavara
pavelsavara merged commit de03d8a into dotnet:main Aug 9, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Sep 9, 2022
@pavelsavara
pavelsavara deleted the wasm_load_crypto_asset branch November 29, 2022 16:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants