feat: fast-path fingerprint coherence, diagnostic warning, cxx_scan restat#35
Merged
Conversation
P1: .build_cache now stores fingerprint hex (4th line). try_fast_build validates that the cached fingerprint matches the outputDir basename; if inconsistent (e.g. switched mcpp installation), the cache is invalidated immediately instead of silently falling through to a different fingerprint directory. P1.5: run_build_plan prints a warning when the outputDir fingerprint differs from the previous .build_cache entry, so users immediately see why a full rebuild is happening instead of getting a silent 26s. P2: cxx_scan rule now writes .ddi to $out.tmp first, then compares with existing $out via cmp -s. If content is identical, old $out is kept (preserving mtime). Combined with restat = 1, this prevents downstream dyndep/compile edges from being marked dirty when a source file's mtime changed but its module dependencies didn't.
The $out.tmp + cmp -s approach for content-stable .ddi writes caused linker failures in the CI self-host smoke step. GCC's -fdeps-file= interacts with ninja's depfile tracking in ways that make the temp-file approach fragile. Revert to direct -fdeps-file=$out for now. P1 (fingerprint coherence) and P1.5 (diagnostic warning) are retained. P2 needs a different approach — possibly ninja's built-in restat alone without temp-file wrappers.
4 tasks
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.
Summary
Three incremental build experience improvements:
.build_cachenow stores fingerprint hex (4th line).try_fast_buildvalidates consistency; if fingerprint doesn't match outputDir, cache is invalidated immediately instead of silently falling through to a stale directoryrun_build_planprintswarning: fingerprint changed (old → new), full rebuildwhen outputDir differs from cached, so users see WHY a full rebuild happened.ddito$out.tmpfirst, compares withcmp -s, keeps old file if identical. Withrestat = 1, downstream edges are not dirtied when source mtime changed but module deps didn'tTest plan
mcpp buildcompiles successfullymcpp test— 12/12 pass.build_cachenow has 4 lines (fingerprint hex on line 4).build_cachefiles handled gracefully (empty fingerprint = skip check)