[browser] Fix WasmEmitTypeScriptDefinitions making builds non-incremental#125509
Open
[browser] Fix WasmEmitTypeScriptDefinitions making builds non-incremental#125509
Conversation
When WasmEmitTypeScriptDefinitions is enabled, the _EnsureDotnetTypeScriptDefinitions target copies dotnet.d.ts to wwwroot/ during the first build. On the second build, the evaluation-time wwwroot glob picks up the file as a Content item, causing Static Web Assets to regenerate manifests with different content. The newer obj/ manifests then make _CopyOutOfDateSourceItemsToOutputDirectory treat the build as non-incremental. Fix by removing wwwroot/dotnet.d.ts from Content at evaluation time (static ItemGroup) so the SWA pipeline never discovers it through the glob, keeping manifests stable across builds. Fixes #124729 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a build incrementality regression caused by WasmEmitTypeScriptDefinitions. When enabled, the first build copies dotnet.d.ts to wwwroot/, but on subsequent builds the wwwroot Content glob discovers it, causing Static Web Assets to regenerate manifests and break incrementality. The fix removes wwwroot\dotnet.d.ts from Content at evaluation time.
Changes:
- Added a static
ItemGroupthat removeswwwroot\dotnet.d.tsfrom Content whenWasmEmitTypeScriptDefinitionsis enabled, preventing the SWA pipeline from discovering it via the glob.
You can also share your feedback on Copilot code review. Take the survey.
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.
When WasmEmitTypeScriptDefinitions is enabled, the _EnsureDotnetTypeScriptDefinitions target copies dotnet.d.ts to wwwroot/ during the first build. On the second build, the evaluation-time wwwroot glob picks up the file as a Content item, causing Static Web Assets to regenerate manifests with different content. The newer obj/ manifests then make _CopyOutOfDateSourceItemsToOutputDirectory treat the build as non-incremental.
Fix by removing wwwroot/dotnet.d.ts from Content at evaluation time (static ItemGroup) so the SWA pipeline never discovers it through the glob, keeping manifests stable across builds.
Fixes #124729
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com