Centralize file update handling, handle concurrent deletes.#4865
Merged
davidmorgan merged 2 commits intodart-lang:masterfrom Apr 2, 2026
Merged
Centralize file update handling, handle concurrent deletes.#4865davidmorgan merged 2 commits intodart-lang:masterfrom
davidmorgan merged 2 commits intodart-lang:masterfrom
Conversation
PR HealthChangelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. This check can be disabled by tagging the PR with |
fecd1fe to
0398b5d
Compare
0398b5d to
19a0e00
Compare
Contributor
Author
|
@Markzipan not sure if you want to review this, it's pretty huge :) Jens who usually reviews is away this week so it might have to wait until next week otherwise, nothing urgent from my side. Thanks. |
Contributor
|
I'm back from leave, so lemme give the a browse! Jens can give it a double-check as well though. |
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.
Fix dart-lang/webdev#2795
Pull initial reads of primary inputs and files that are known to be inputs into one place in
build.dart.Stop handling "updates" as a map from path to "add"/"modify"/"remove": just pass around the list of changed files, read the filesystem state to determine if they are "add"/"modify"/"remote". This removes the race that was happening if a file was changed after "updates" was constructed.
Files that are primary inputs or known from the previous build to be inputs are read at the start of the build and cached. So changes to these file during the build do nothing. This covers most cases.
Files that are not yet known to be inputs are still read+digested only if/when they are first used.
Add a new codepath for handling deletion of files after the start of the build if they were not read to cache. We already have a mechanism for restarting a command from scratch for recompiling builders, use the same mechanism for concurrent delete. The whole build will be retried.
Because files are no longer read before the start of the build a "modify file" event that does not change the file contents now causes a no-op build instead of the build being skipped. Update tests accordingly.