-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[browser] build browserhost in host.native subset #120298
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
base: main
Are you sure you want to change the base?
Conversation
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
32ecbfa
to
04232e2
Compare
3dfa996
to
2e8702e
Compare
For subset Bear with me, this is still work in progress. I know it's large change, but hopefully I will merge large part of it as #120359. You can ignore changes under @jkoritzinsky - Jeremy, could you please share your thoughts ? runtime/src/coreclr/CMakeLists.txt Line 93 in 51ca4ba
runtime/src/coreclr/CMakeLists.txt Line 69 in 51ca4ba
@janvorli prefers consistency over speed for cc @akoeplinger |
singlefilehost is built as part of CoreCLR as it's significantly easier to build all of the components at once instead of shuffling them between machines. We used to build it separately and it caused a lot of pain. If you wish, there's two options I'd recommend for wasm:
|
That's already done, I also prefer that.
@jkoritzinsky could you please share more details ? It seems unless I change my direction, I may suffer same pains. For context:
|
For Linux and Windows, we were hitting issues with linker incompatibilities and a ton of complexity because of the flags we pass around and the fact that we shuffle pieces between different machines in the PR builds. For wasm, we already have an established path of shipping static libs, so I'm not as concerned that we'll hit the same problem. If you're able to pre-link everything with the new host like how we do the singlefilehost, I'd recommend that. If you can't, then splitting it is fine. |
f86a2dc
to
7070241
Compare
fix corehost/build.cmd
add CLR_CORE_RUN_ONLY install gcinfo_unix_wasm install coreclrminipal install shared minipal install System.Globalization.Native move Common.JavaScript
disable brotli
f1b86aa
to
a1543be
Compare
# Conflicts: # src/coreclr/hosts/corewasmrun/CMakeLists.txt
@jkoritzinsky I'm not fan either but I don't have better idea. Let's discuss options or invent something else A) ideally we would have only one CMake root for all native builds, on all targets.
B) singlefilehost style, static linking of host and libs within coreclr root:
C) what I'm doing in this PR. 3 cmake roots and loose dependency via msbuild
cc: @jkotas @AaronRobinsonMSFT @janvorli @akoeplinger thoughts ? I will take non-controversial changes from this PR into different PR in the meantime and focus this PR only on this topic. |
This is almost same changes but whole native libs + browserhost happens in |
This is something I see as possible in the future, but due to the fact that the Mono CMake tree is designed fundamentally differently from the rest of the CMake trees makes unification difficult.
This is not a problem, as the Debug/Release versions of the native libs shouldn't differ in contract (so combining debug libs.native in the host with release managed libs should be fine, or we aren't sufficiently testing singlefilehost in CI).
Don't we need to do this anyway for linking the out-of-tree browserhost (built in our CMake in
My preference would be to build the For libs.native, how does Mono WASM get the native libs binaries?
Does Mono always link the .a files later (and never build a pre-linked-together browserhost equivalent)?
If the innerloop for making a runtime change would be
Generally, we've kept flags consistent by centralizing on
|
I don't follow. If you want to build whole Creating
Yes, mono links all native libs in .a files that were built separately.
Ok, I will explore that in some of the future PRs. The challenge is that we also have to share same compiler/linker flags on customer machine when there is no CMake at all. |
eng/native.props
host.native
subset back for coreCLR browsercorehost/build.cmd
CLR_ARTIFACTS_BIN_DIR
,CMAKE_BUILD_LIBRARIES_CONFIGURATION
STATIC_LIB_DESTINATION
and move all JS outputs thereSystem.Native.Browser-Rollup
andSystem.Native.Browser-NpmInstall
into it's ownCommon\JavaScript\CMakeLists.txt
browserhost
forclr.runtime
subsetbrowserhost
intolibBrowserHost.a
, so that it could be linked later on customer machinebrowserhost
dependent on relevant.a
files oflibs.native+clr.runtime
subsets, instead of CMake target andadd_subdirectory
Fixes #120188