Skip to content

[browser] Skip boot json generation in nested publish#128361

Merged
maraf merged 1 commit into
dotnet:mainfrom
maraf:fix/wasm-coreclr-vfs-boot-json
May 19, 2026
Merged

[browser] Skip boot json generation in nested publish#128361
maraf merged 1 commit into
dotnet:mainfrom
maraf:fix/wasm-coreclr-vfs-boot-json

Conversation

@maraf

@maraf maraf commented May 19, 2026

Copy link
Copy Markdown
Member

Skip _WriteBuildWasmBootJsonFile and _GenerateBuildWasmBootJson during nested publish to prevent writing a stale boot JSON without VFS entries.

During CoreCLR WASM nested publish, the new incrementalism (Inputs/Outputs) on _WriteBuildWasmBootJsonFile caused it to be skipped in the outer build after the nested publish wrote the boot JSON without VFS content. This resulted in DirectoryNotFoundException for content files like testdataset1.xml.

Regression from #125367
Relates to #128293

During CoreCLR WASM nested publish, the _WriteBuildWasmBootJsonFile
target (added by dotnet#125367 with Inputs/Outputs incrementalism) would
write the boot JSON without VFS entries (because LinkContentToWwwroot
is skipped when WasmBuildingForNestedPublish=true). Then in the outer
build, the Inputs/Outputs check would find the stale output and skip
regeneration, leaving the final boot JSON without VFS content files.

This caused tests relying on content files (like testdataset1.xml) to
fail with DirectoryNotFoundException on WASM CoreCLR.

Fix: Skip _WriteBuildWasmBootJsonFile and _GenerateBuildWasmBootJson
during nested publish. The nested publish doesn't need the build boot
JSON (it only returns WasmAssembliesFinal/WasmNativeAsset), and
skipping it ensures the outer build writes the correct boot JSON with
VFS entries.

Fixes dotnet#128293

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 19, 2026 10:04
@maraf maraf self-assigned this May 19, 2026
@maraf maraf changed the title Fix WASM CoreCLR VFS content files missing from boot JSON [browser] Skip boot json generation in nested publish May 19, 2026
@maraf maraf added arch-wasm WebAssembly architecture os-browser Browser variant of arch-wasm labels May 19, 2026
@maraf maraf added this to the 11.0.0 milestone May 19, 2026
@maraf maraf marked this pull request as ready for review May 19, 2026 10:06
@maraf maraf requested review from akoeplinger and lewing as code owners May 19, 2026 10:06
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts the WASM Browser SDK MSBuild targets so that build-time boot JSON generation is skipped during nested publish runs (gated by $(WasmBuildingForNestedPublish)), preventing the nested publish from producing a boot JSON that omits VFS content entries and then causing the outer build to incorrectly skip regeneration due to incremental Inputs/Outputs.

Changes:

  • Add a Condition="'$(WasmBuildingForNestedPublish)' != 'true'" gate to _WriteBuildWasmBootJsonFile.
  • Add the same gate to _GenerateBuildWasmBootJson so it doesn’t define boot-config static web asset items during nested publish.
  • Expand in-file comments to explain why these targets must be skipped for nested publish scenarios.

@maraf maraf enabled auto-merge (squash) May 19, 2026 11:58
@maraf maraf merged commit 1226382 into dotnet:main May 19, 2026
70 checks passed
@maraf maraf deleted the fix/wasm-coreclr-vfs-boot-json branch May 19, 2026 14:47
@dotnet-milestone-bot dotnet-milestone-bot Bot modified the milestones: 11.0.0, 11.0-preview6 May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-wasm WebAssembly architecture area-Build-mono os-browser Browser variant of arch-wasm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants