Skip to content

fix(build): object-path disambiguation follow-ups #239 #240 (0.0.98)#244

Closed
Sunrisepeak wants to merge 4 commits into
mainfrom
fix/object-path-239-240
Closed

fix(build): object-path disambiguation follow-ups #239 #240 (0.0.98)#244
Sunrisepeak wants to merge 4 commits into
mainfrom
fix/object-path-239-240

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

Fixes the two #233 object-path disambiguation follow-up gaps that block mcpplibs #79 (opencv intake).

Common single-binary projects are byte-identical. Design + ledger: .agents/docs/2026-07-19-*.
Unblocks #79 (the merge gate). Ship as 0.0.98.

…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).
@Sunrisepeak

Copy link
Copy Markdown
Member Author

Superseded by #245 — the whole #230#243 batch is unified into a single 0.0.98 release there (#239/#240 included).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant