[browser] Package CoreCLR browser-wasm native relink headers in the runtime pack - #131863
Merged
pavelsavara merged 4 commits intoAug 5, 2026
Merged
Conversation
PR dotnet#131646 installs callhelpers.hpp / minipal headers under sharedFramework/include and declares them in the platform manifest, but the generic runtime-file harvest in eng/liveBuilds.targets only globs the top level of sharedFramework (*.*), so the include/ subtree was silently dropped and the pack shipped without the headers. Native relink from a restored SDK therefore still failed with 'callhelpers.hpp file not found'. Harvest the include/ subtree into runtimes/<rid>/native/include (preserving the minipal subdir), mirroring how the Mono pack ships its relink headers.
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This change updates the CoreCLR runtime-pack SFX packaging project so that (for browser/wasi) header files staged under $(CoreCLRSharedFrameworkDir)include\**\*.* are harvested into the runtime pack under runtimes/<rid>/native/include/, preserving subdirectories via %(RecursiveDir).
Changes:
- Add a new
AddCoreCLRWasmIncludeFilesMSBuild target (scoped tobrowser/wasi) to includesharedFramework/include/**in the runtime pack. - Map harvested headers to
runtimes/$(RuntimeIdentifier)/native/include/%(RecursiveDir)using the sameTargetPathpattern already used by the Mono runtime pack. - Ensure
%(RecursiveDir)is evaluated off a separate glob item (_CoreCLRWasmIncludeFile) to avoid MSBuild self-referencing issues (MSB4120).
Contributor
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Correct the previous approach: the browserhost CMake install lands the headers in the *host* sharedFramework ($(HostSharedFrameworkDir)/include), same as libBrowserHost.a / dotnet.native.wasm - not the CoreCLR sharedFramework. Harvest them via LibrariesRuntimeFiles with NativeSubDirectory (mirroring the Mono include\wasm headers) instead of a bespoke sfxproj glob, and stage them into the in-tree runtime-pack layout via corehost.proj CopyWasmNativeFiles alongside the other browser host files.
maraf
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Follow-up to #131646. That PR made CoreCLR browser-wasm native relink work from a restored/packaged SDK, and one part of it shipped the VM/minipal headers (
callhelpers.hpp,minipal/entrypoints.h,minipal/utils.h) needed by the relink into theMicrosoft.NETCore.App.Runtime.browser-wasmruntime pack undernative/include. It:src/native/corehost/browserhost/CMakeLists.txt—install(... DESTINATION sharedFramework/include ...)the three headers.src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props— declared them asPlatformManifestFileEntry.But the headers still don't end up in the pack. Inspecting a daily
wasm-toolspack (11.0.0-rc.1.26404.112),runtimes/browser-wasm/native/hasdotnet.native.wasm+ libs but noinclude/dir, soBrowserWasmApp.CoreCLR.targetsseesExists($(MicrosoftNetCoreAppRuntimePackRidNativeDir)include\callhelpers.hpp) == false, falls back to the in-repo source path (absent in a restored SDK), and native relink fails again with:Root cause
The browserhost
install(... DESTINATION sharedFramework/include ...)places the headers in the host shared framework ($(HostSharedFrameworkDir)/include) — the same dir the runtime pack already harvestslibBrowserHost.a/dotnet.native.js/dotnet.native.wasmfrom. But nothing harvests theinclude/subtree, so the headers are dropped. The platform-manifest declaration doesn't help — validation is pack ⊆ manifest, so a missing file never fails the build.Mono already ships its relink headers correctly, harvesting them via
LibrariesRuntimeFileswithNativeSubDirectory="include\wasm".Fix
Harvest the headers through the standard mechanisms, sourced from the host shared framework where the CMake install actually puts them:
eng/liveBuilds.targets— add the headers toLibrariesRuntimeFileswithNativeSubDirectory="include"/include\minipal(feeds the nupkg), mirroring the Monoinclude\wasmhandling.src/native/corehost/corehost.proj(CopyWasmNativeFiles) — stage them into the in-tree runtime-pack layout (MicrosoftNetCoreAppRuntimePackNativeDir) alongside the other browser host files, so an in-treeclr+libs+hostbuild's layout is also relink-capable.Validation
End-to-end
build.cmd -os browser -subset clr+libs+host+packs -c Debug(0 warnings, 0 errors). The headers are produced by the real browserhost CMake install and land in all three places with theminipal/subdir preserved:This is exactly what
BrowserWasmApp.CoreCLR.targetsprobes for, so_VmWasmIncludeDir/_MinipalIncludeDirnow resolve from the runtime pack instead of falling back to the missing in-repo path.Notes
browserhost/CMakeLists.txt), and could be addressed separately.CopyWasmNativeFiles(layout) andLibrariesRuntimeFiles(nupkg) duplicate the browser host-file list today; unifying them is a larger cleanup left as a follow-up.Related: #128362