Fix incorrect build due to racy builder changes.#4988
Open
davidmorgan wants to merge 1 commit into
Open
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 |
c26c74d to
84ffc77
Compare
Hybrid digest and mtime check fix: Detect builder source changes during compile Closes dart-lang#4986
84ffc77 to
6e26998
Compare
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 #4986.
Checking for changes to builder code is done using digests computed after the compile.
This causes a problem if files change during the compile: we don't know if the compiler used the same version of the file that was digested.
Fix this by adding a "stamp" file that records when the compile started, then using the stamp file and the digest file timestamps to check for files modified during the compile.
Add platform-specific code for getting higher-resolution-than-available-with-the-Dart-SDK timestamps so this check won't cause too many false positives.
This seems like a lot of complexity for an issue that won't happen very often; but rebuilding correctly is core build_runner functionality, and better handling of mtimes is something we might want to use for other things. So it seems worth a try.
On Windows, include some additional args in PowerShell calls that Gemini thought were a good idea, and some googling confirmed they seem to be recommended for this type of use case.