Repository navigation
Merge identical target imports when linking source modules - #343
Conversation
Flattening a source-module closure gave every module its own `target` import, so the rope's linked Core carried five identical imports of echo.dpo@2, which Echo's identity check refuses. Identical `use target` imports (same target, same digest) now share one alias and the linked module emits a single import. Different digests for one target refuse at link time with the new ConflictingTargetImport kind. RED: identical_target_imports_merge_into_one saw 3 target imports; different_digests_for_one_target_are_refused linked without error. GREEN: 3/3; existing module-compilation tests pass; xtask verify exit 0. Agent-Session: AFC0A5E0-B032-49DC-8B18-CB932831DCC2 Agent-Tool: Claude Code
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 11 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Plain-English Walkthrough
TL;DR
Flattening a multi-module source closure now emits one
targetimport per target profile instead of one per module [claim:merge, confidence:1.00]. Conflicting pins of the same target are refused at link time withConflictingTargetImport[claim:conflict, confidence:1.00]. Echo requires exactly one target import, which this unblocks for the rope.Walkthrough
source_linker::collect_namesnow records the alias chosen for each target coordinate. A later module that imports the same target with the same digest reuses that alias, andlink_source_closureemits each alias once. A different digest for the same target is refused. Core does not encode import aliases, and module order is fixed by coordinate, so the Core bytes do not depend on the order dependencies are listed in.Verification.
cargo xtask verifyexits 0.Appendix: Citations
claim:mergeidentical_target_imports_merge_into_one,merged_core_bytes_do_not_depend_on_dependency_order@eda1a838claim:conflictdifferent_digests_for_one_target_are_refusedCloses #342