Skip to content

fix(compile): preserve package instance identity - #8533

Merged
proggeramlug merged 1 commit into
PerryTS:mainfrom
proggeramlug:fix/8516-package-instance-identity
Aug 21, 2026
Merged

fix(compile): preserve package instance identity#8533
proggeramlug merged 1 commit into
PerryTS:mainfrom
proggeramlug:fix/8516-package-instance-identity

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

Closes #8516.

Summary

  • resolve bare package imports from each importer outward, matching Node/Bun resolution
  • replace package-name-keyed first-copy routing with a deterministic set of canonical package roots
  • compile distinct nested installations with their existing path-derived module, symbol, and object-cache identities while canonical links to the same physical instance still deduplicate
  • retain explicit native-package policy and run native-addon root checks for every resolved package instance
  • remove the obsolete one-copy warning and update the compiler documentation

Validation

  • cargo test -p perry --test issue_8516_package_instance_identity -- --nocapture (1 passed; links and runs top-v1 nested-v2)
  • cargo test -p perry --bin perry commands::compile::resolve (138 passed)
  • cargo test -p perry --bin perry commands::compile::collect_modules (54 passed)
  • cargo clippy -p perry --bins (passed; baseline warnings only)
  • SKIP_COMPILE_GATES=1 BASE_SHA=upstream/main ./scripts/run_lint_gates.sh (all 50 gates passed)
  • cargo fmt --all -- --check
  • git diff --check

No version bump is included; the required changelog.d fragment is present.

Resolve bare packages from each importer and track every canonical compile-package root instead of redirecting all copies through a package-name key. This lets nested versions compile with distinct path-derived symbols and cache identities while canonical links to one physical root still deduplicate.

Closes PerryTS#8516.
@proggeramlug
proggeramlug force-pushed the fix/8516-package-instance-identity branch from 8077ef9 to 4e8aa19 Compare August 21, 2026 07:58
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@proggeramlug, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 17 minutes

Limit details: You’ve used all 8 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2b6132fd-3ef3-4a52-b451-879636e7c931

📥 Commits

Reviewing files that changed from the base of the PR and between 8d837df and 4e8aa19.

📒 Files selected for processing (14)
  • CLAUDE.md
  • changelog.d/8533-package-instance-identity.md
  • crates/perry/src/commands/compile/collect_modules.rs
  • crates/perry/src/commands/compile/collect_modules/native_addon.rs
  • crates/perry/src/commands/compile/collect_modules/tests.rs
  • crates/perry/src/commands/compile/resolve.rs
  • crates/perry/src/commands/compile/resolve/dedup_version_tests.rs
  • crates/perry/src/commands/compile/resolve/package_instance_tests.rs
  • crates/perry/src/commands/compile/resolve/tests.rs
  • crates/perry/src/commands/compile/resolve/tests/declaration_sidecar_tests/compile_package.rs
  • crates/perry/src/commands/compile/run_pipeline.rs
  • crates/perry/src/commands/compile/types.rs
  • crates/perry/tests/issue_8516_package_instance_identity.rs
  • docs/src/packages/porting.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proggeramlug

Copy link
Copy Markdown
Contributor Author

Merging on green pr-gate for the current head, plus the mechanical pre-checks (stacks cleanly on main, no version-file changes, PR-keyed changelog fragment present).

Also included in a locally stacked build with #8525, #8529, #8531, #8533, #8534, #8536, #8537 to check cross-PR interaction — several of these touch the same files (expr_new/member.rs, collect_modules.rs, entries/part_1.rs), which per-PR CI does not exercise together.

@proggeramlug
proggeramlug merged commit 6950b42 into PerryTS:main Aug 21, 2026
48 checks passed
@proggeramlug
proggeramlug deleted the fix/8516-package-instance-identity branch August 21, 2026 12:12
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.

compiler: preserve resolved package-instance identity in the full OpenCode dependency graph

1 participant