fix(build): self-heal stale build.ninja + bump 0.0.58#142
Merged
Conversation
When a dependency package under the registry is reinstalled/moved but keeps the same version string, the build fingerprint (which does not yet cover registry dep state) is unchanged, so the cached build.ninja is reused. Ninja then aborts with 'missing and no known rule to make it' and the build hard-fails, forcing the user to run `mcpp clean` by hand. Add that signature to is_stale_ninja_failure so try_fast_build drops to a full graph regeneration (same invocation) instead of failing — the stale graph is rewritten against the current dep state and the build proceeds. (Folding registry dep state into the fingerprint to avoid the regen entirely is a larger follow-up; see .agents/docs/2026-06-22 §T-j.)
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.
Problem
After a dependency package under
~/.mcpp/registry/data/xpkgs/isreinstalled/moved but keeps the same version string,
mcpp buildfails:The file actually exists — the cached
build.ninjais stale. The buildfingerprint doesn't cover registry dep state (
dependencyLockHashis empty),so
fp.hex/outputDirare unchanged andtry_fast_buildreuses the oldgraph. That ninja error isn't recognized as "stale", so it hard-fails and the
user has to run
mcpp cleanby hand.Fix
Add
"missing and no known rule to make"tois_stale_ninja_failure(
src/build/execute.cppm). On that signature,try_fast_buildreturnsnullopt→ the samemcpp buildinvocation drops to a full graphregeneration, rewrites
build.ninjaagainst the current dep state, andproceeds. No more manual
mcpp clean.Folding registry dep state into the fingerprint (to skip the regen entirely)
is a larger, riskier follow-up — tracked in
.agents/docs/2026-06-22-mcpp-followups-design.md§T-j.Version bump → 0.0.58
This is the last PR of the 5-PR follow-up batch, so it carries the version
bump (
fingerprint.cppmMCPP_VERSION+mcpp.toml) for the release thatships:
Merge this PR last.
Test
mcpp build+mcpp testgreen (22 passed), v0.0.58 compiles clean.