fix(build): object-path disambiguation follow-ups #239 #240 (0.0.98)#244
Closed
Sunrisepeak wants to merge 4 commits into
Closed
fix(build): object-path disambiguation follow-ups #239 #240 (0.0.98)#244Sunrisepeak wants to merge 4 commits into
Sunrisepeak wants to merge 4 commits into
Conversation
…of-root gen source) Two follow-up gaps in #233's object-path disambiguation, each reproduced as a failing e2e test (red on 0.0.97) plus a decomposed design doc: - 123 (#240): a dependency and the consumer ship a same-named source (the near-universal both-have-src/main.cpp). #233 renames the scanned consumer main to obj/<pkg>/src/main.o, but the link still references the stale flat obj/main.o -> 'obj/main.o missing and no known rule'. Blocks mcpplibs #79. - 124 (#239): a dependency build.mcpp emits a source into OUT_DIR (outside the package root); its relPath carries '..', so #233 pastes obj/<pkg>/../.. and the object escapes obj/ (and the '@' in <name>@<ver> gets ninja-quoted, breaking the #235 "$out.d" depfile redirect). Design: .agents/docs/2026-07-19-object-path-disambiguation-followups-239-240-design.md
…iguation (#240, #239) #233 disambiguated object paths only for scanner-produced units, leaving two gaps that both surface as broken/invalid ninja edges. Converge object-path assignment into one source of truth (object_for) and make the collision prefix always downward + shell-safe (safe_object_prefix). #240 — the entry main's object path was recomputed independently as flat obj/<name>.o (plan.cppm) and pushed to the link inputs even when the source had already been scanned into a disambiguated compile unit. Fix: - the synthesized main no longer computes its own object path; - if the entry was globbed (scanned), the link reuses THAT unit's already- disambiguated object; - if not scanned, it is added to the basename census and routed through the same object_for, so it disambiguates against a dependency's same-named source too. Common single-binary projects (unique main) stay flat obj/main.o. #239 — the collision prefix was u.relPath.parent_path() pasted raw. For sources outside their package root (dependency build.mcpp OUT_DIR-generated sources) the relPath carries '..'/absolute roots, so obj/<prefix> climbed out of the build tree, and the '@' in <name>@<ver> got ninja-quoted (breaking the #235 "$out.d" redirect). safe_object_prefix folds each component downward: drop root, '.' skipped, '..'->'__up', non-portable chars (e.g. '@')->'_'. Per-component injective, so #233's uniqueness (and its L1b assertion backstop) holds. Non-colliding paths are untouched (flat obj/<name>.o); colliding paths with a clean relPath are byte-identical to before.
CHANGELOG entry for the two #233 follow-up fixes. Bootstrap pin bump + release mirror + index are the usual post-merge operational steps (not in this PR).
…erved architecture assessment Authoritative per-issue ledger (classification / status / root-cause subsystem / verified file:line anchor / root-cause-level fix / commit) for the whole #230-#243 wave, plus the standing no-workaround discipline and the criteria for the final holistic architecture assessment (§4, filled once all land). Records the current state: #230 already fixed (0.0.96); #239/#240 fixed on this branch (0.0.98); #237/#241/#242 mechanical root-cause fixes pending; #243 needs design; #238 root cause lives in xlings (not fixable in this repo, must not be band-aided as done).
Member
Author
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.
Fixes the two #233 object-path disambiguation follow-up gaps that block mcpplibs #79 (opencv intake).
obj/main.o; converged object-path assignment onto a singleobject_forso link input == compile edge (e2e 123).obj/, and the@in<name>@<ver>broke the [bug] 模块 purview 内文本 #include 改动不触发重编(stale build;gen_exports/*.inc 模式) #235 depfile redirect;safe_object_prefixfolds every component downward + shell-safe (e2e 124).Common single-binary projects are byte-identical. Design + ledger:
.agents/docs/2026-07-19-*.Unblocks #79 (the merge gate). Ship as 0.0.98.