Repository navigation
Fix lock-named platform gem builds warned as not installed (#2452) - #2478
Mikola Lysenko (mikolalysenko) wants to merge 5 commits into
Conversation
Refs #2452 Assisted-by: Claude Code:claude-fable-5-2
apply decides whether an uninstalled manifest patch is resolved by the project lockfile from the lock inventory, and a global scan --prune asks the same inventory which records the project still accounts for. That inventory leaves out a gem the Bundler lock names only by its precompiled platform builds, so on such a lock: - apply warned "no matching installed package" for every build that scan --all-releases recorded, and failed outright on a fresh checkout with nothing installed yet; - a global prune dropped the records and blobs of the gem. Both now read one ProjectContext::lock_resolved, which adds the platform-only gems to the inventory's entries. The vex omission line also names the build of a gem release that is listed more than once, so the entries can be told apart. Fixes #2452 Assisted-by: Claude Code:claude-fable-5-2
The other-project gem skip filtered out the gems the lock holds only as platform builds, because the lock-resolved check before it did not know them. That check now does, so such a gem never reaches the skip: remove the filter. A fresh checkout whose lock names the gem only by platform builds is now the calm lockfile-only skip (exit 0), as under a lock with a ruby entry. The test that pinned the earlier failure for that case keeps what it was written for: the gem is not another project's. Refs #2452 Assisted-by: Claude Code:claude-fable-5-2
Count the repeated names once instead of rescanning the list for each entry, and give the global prune test a gem name no machine has installed, so an installed copy cannot keep the records for it. Refs #2452 Assisted-by: Claude Code:claude-fable-5-2
|
bugbot run Generated by Claude Code |
PR SummaryMedium Risk Overview Removes the redundant platform-only filter from Adds Reviewed by Cursor Bugbot for commit 84a8b94. Configure here. |
build_names tested the purl type with an inline prefix, which the purl-type convention test in socket-patch-core refuses. Ask Ecosystem::from_purl, as the rest of the production code does. Refs #2452 Assisted-by: Claude Code:claude-fable-5-2
|
[agent] PR shepherd: review brief for the approver What it does Risk Look here
Verified
Changes I made Open questions Generated by Claude Code |
LLM Description written by Claude Code:claude-fable-5-2
Fixes #2452
Summary
On a Bundler lock that names a gem only by its precompiled platform builds (no
rubyentry: what Bundler 2.5 and 2.6 write, and Bundler 4 afterbundle lock --remove-platform ruby), agent mode treated the gem as one the lock does not resolve:apply, and thescanthat runs it, printedWarning: N manifest patches had no matching installed packagefor every build thatscan --all-releasesrecorded, on every run. With arubyentry in the lock the same records get the calmNote: ... resolved by the project lockfile; skipped.applyexited 1 where theruby-entry lock exits 0.scan --prunedropped the records and blobs of such a gem from the project's manifest, though it keeps every other lockfile-listed entry of the project.vexlisted the omitted builds under one repeated name (nokogiri@1.19.7, nokogiri@1.19.7, ...).Root cause
lockfile_resolvedincommands/apply.rsandkeep_project_entriesincommands/scan/gc.rsboth asked the lock inventory (ProjectContext::locks) which releases the project's locks resolve. That inventory leaves out a gem the lock holds only as platform builds, because no single.gemstands for it. Scan discovery already adds those gems back fromgem_platform_only_purls; these two readers did not.The change
ProjectContext::lock_resolvedis the one answer to "which releases do the project's locks resolve": the inventory's entries plus the platform-only gems.applyand the global prune both read it.other_project_gem_copieshad its own filter for platform-only gems, needed only because the check before it did not know them. It is removed.ui::build_namesnames the build of a gem release that is listed more than once (nokogiri@1.19.7 (arm64-darwin)), and thevexomission line uses it. A name listed once is unchanged.No CLI contract or docs change: the contract already says lockfile-listed packages are a calm skip and are kept by a prune.
For the reviewer
gem_the_lock_holds_as_a_platform_build_is_not_another_projectspinned exit 1 for the fresh checkout. It was written to show that such a gem is not reported as another project's, and it still asserts that. The exit is now 0 with the lockfile-only reason, the same asexplicit_path_with_nothing_installed_is_a_calm_skip_under_a_lockbeside it.rubyentry already does, and what the issue asks for; the new tests include such a record.Evidence
applysuite:nothing_installed_is_a_calm_skip_under_a_platform_only_lockapplysuite:other_builds_of_an_installed_gem_are_a_note_under_a_platform_only_lockWarning: 2 manifest patches had no matching installed packagein_process_scan:scan_global_prune_keeps_a_gem_the_project_locks_only_as_platform_buildsbuilds_of_one_release_are_named_with_their_platform,omissions_are_one_line_per_reasonvexlineRun locally:
cargo test -p socket-patch-cli --lib --test apply --test in_process_scan --test in_process_gem_apply --test in_process_gem_multi_platform: 1106, 242, 3, 9 and 33 passed, 0 failed.cargo clippy --locked -p socket-patch-cli --all-features -- -D warnings(the form CI runs): clean. With--all-targetsit reports errors in test helpers onmainthat this PR does not touch; none are in the files changed here.cargo fmton the touched files.e2e_redirect_gem_build,e2e_vendor_gem_build). They cover hosted and vendored mode, which this change does not touch; CI runs them.Review
/code-review highfound no bug in the change. CI caught one thing the local runs did not:build_namestested the purl type with an inline prefix, which the purl-type convention test insocket-patch-corerefuses; it now asksEcosystem::from_purl. Fixed from the review: the quadratic name count inbuild_names, and the prune test now uses a gem name no machine has installed. Not changed here, as they are outside this root cause:vexline can still repeat a name for release variants that are not gems (several PyPI artifacts of one release).listtable shows the builds of one gem under the same name.https://claude.ai/code/session_011f9aeSPNcmgL99sGZJpqV7
Generated by Claude Code