fix(package-manager): link_hoisted_modules PkgIdWithPatchHash types#508
Conversation
The Slice 5 linker (#505) was written against `String` for `pkg_id_with_patch_hash` and merged onto a main that had already switched the underlying `DependenciesGraphNode` field to the `PkgIdWithPatchHash` newtype (#504). The merge auto-resolved without flagging the type incompatibility — `cargo check` on main now errors with: error[E0277]: the trait bound `String: Borrow<PkgIdWithPatchHash>` is not satisfied error[E0308]: mismatched types expected `String`, found `PkgIdWithPatchHash` Switch the two slice-5-introduced surfaces to match the newtype: - `CasPathsByPkgId = HashMap<PkgIdWithPatchHash, HashMap<String, PathBuf>>` — the per-package CAS index now keys on the brand the graph node carries, matching the post-#504 invariant across the workspace. - `LinkHoistedModulesError::MissingCasPaths.pkg_id_with_patch_hash: PkgIdWithPatchHash` — same type the graph node has, so the error round-trips the value without `.to_string()`. Tests updated to construct `PkgIdWithPatchHash::from(...)` keys/fields. All 8 linker tests pass on the fixed branch. This unblocks main building again.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
🧰 Additional context used📓 Path-based instructions (1)**/*.rs📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (5)📚 Learning: 2026-05-07T23:19:08.272ZApplied to files:
📚 Learning: 2026-05-13T22:52:32.579ZApplied to files:
📚 Learning: 2026-05-13T19:22:48.951ZApplied to files:
📚 Learning: 2026-05-13T20:09:22.171ZApplied to files:
📚 Learning: 2026-05-01T10:01:33.766ZApplied to files:
🔇 Additional comments (2)
📝 WalkthroughWalkthroughThe PR re-keys the CAS path index and error reporting in the hoisted-modules linker from ChangesCAS Index Type Migration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Micro-Benchmark ResultsLinux |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #508 +/- ##
==========================================
- Coverage 88.74% 88.58% -0.16%
==========================================
Files 124 125 +1
Lines 13429 13575 +146
==========================================
+ Hits 11917 12026 +109
- Misses 1512 1549 +37 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Main is broken on
d5b33e75— Slice 5 (#505) merged withStringforpkg_id_with_patch_hashtypes after #504 had already switched the underlyingDependenciesGraphNodefield to thePkgIdWithPatchHashnewtype. The GitHub auto-merge didn't surface the type mismatch.cargo check -p pacquet-package-manageronorigin/main:Fix
Switch the two slice-5-introduced surfaces to use
PkgIdWithPatchHash:CasPathsByPkgId—HashMap<String, _>→HashMap<PkgIdWithPatchHash, _>. The CAS index now keys on the brand the graph node carries.LinkHoistedModulesError::MissingCasPaths.pkg_id_with_patch_hash—String→PkgIdWithPatchHash. Same type the graph node has, so the error round-trips the value without.to_string().Tests updated to construct
PkgIdWithPatchHash::from(...)keys/fields.Test plan
just ready(893 tests, all green).cargo doc --document-private-items,taplo format --check,just dylintclean.Written by an agent (Claude Code, claude-opus-4-7).
Summary by CodeRabbit