GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||
GeezerVison is showing github.com — Fix gem crawler missing Bundler .bundle root (#967) by mikolalysenko · Pull Request #968 · SocketDev/socket-patch Conversation
|
| Test | Without fix | With fix |
|---|---|---|
ruby_crawler::tests::dot_bundle_base_path_is_crawled (no config, local simulate_version 5, local default_install_uses_path, falsy path.system) |
FAIL | pass |
ruby_crawler::tests::dot_bundle_base_path_with_global_flag_is_crawled |
FAIL | pass |
ruby_crawler::tests::dot_bundle_base_path_is_skipped_when_bundler_does_not_use_it (controls: local/env/global path, empty path, path.system in each tier, non-Ruby dir) |
pass | pass |
crawler_ruby_e2e::dot_bundle_base_path_crawls_the_loaded_copy (ambient discovery finds the .bundle copy before the gem env home; local and env flags) |
FAIL | pass |
e2e_redirect_gem_stale_install::gem_hosted_stale_dot_bundle_install_warns_and_is_not_attested (hosted guard names the stale .bundle copy, same-run --vex doesn't attest) |
FAIL | pass |
Per-issue checklist:
.bundle default install path (default_install_uses_path on 2.x, simulate_version 5 on 4.x), so agent apply patches the system copy and vex attests not_affected while Bundler loads the unpatched .bundle/ruby/<abi> copy #967: agent apply / vex (crawler unit + e2e tests above) and the hosted stale guard (CLI e2e above).Real Bundler check (Ruby 3.3.6, Bundler 4.0.18, bundle config set --local simulate_version 5, bundle install → ./.bundle/ruby/3.3.0/gems/colorize-0.8.1, hand-written manifest):
socket-patch apply --offline --json → applied, and bundle exec now loads the patched file (include?("SOCKET-PATCHED") → true).socket-patch vex → not_affected. After reverting the .bundle copy by hand, vex omits the purl (not_applied).Local runs:
cargo clippy --workspace --all-features -- -D warnings: clean.rustfmt --check on the changed files: clean. CI has no fmt job, and main isn't fmt-clean repo-wide.cargo test --workspace --all-features: 10829 passed, 12 failed. All 12 are chmod/unwritable-file tests (e.g. vendor_state_write_failure_reports_failed_event, copy_tree::relax_loop_must_not_traverse_symlinked_root). They can't fail a write when run as root, which this container is. None of them touch gem code, and CI runs them as non-root..bundle against Bundler.root. Like the other roots here, this uses --cwd. A BUNDLE_GEMFILE that moves the root is Gem agent crawl ignores that BUNDLE_GEMFILE=gemfiles/x.gemfile moves Bundler.root, so a relative bundle path resolves to the wrong dir, apply patches the system copy and vex attests not_affected while Bundler loads the unpatched gemfiles/vendor/bundle copy #952's separate cause.🤖 Generated with Claude Code
Note
Medium Risk
Changes gem install-root discovery used by scan/apply/vex and hosted stale guards; incorrect tier logic could miss or double-count paths, but behavior is heavily covered by new tests.
Overview
Fixes #967 by teaching the Ruby gem crawler to treat <cwd>/.bundle as a Bundler install root when no settings tier names an explicit path or truthy path.system — matching Bundler 5 / simulate_version 5 / default_install_uses_path behavior where gems land under .bundle/<engine>/<abi>/gems.
bundler_path_system is generalized to bundler_path_tier, which returns whether the deciding tier has an explicit path and/or uses system gems; that drives both existing path.system handling and the new .bundle probe (still gated on a Bundler manifest, and still keeping the gem env fallback like other non-default roots).
CLI_CONTRACT.md documents the new root in the gem install-root precedence list. Unit, crawler e2e, and hosted stale-install e2e tests assert discovery, loaded-copy scanning, stale warnings, and that --vex does not attest stale .bundle installs.
Reviewed by Cursor Bugbot for commit 3886270. Configure here.
Generated by Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Assisted-by: Claude Code:claude-opus-5-5
A project that switched from vendor/bundle back to system gems (`bundle config set path.system true`, or BUNDLE_PATH__SYSTEM=true) usually still has the old gitignored vendor/bundle. The gem crawler always counted that leftover store and, because it held gems, stopped looking in the `gem env` homes. Agent apply then patched only the unused copy, and vex attested not_affected while Bundler kept loading the unpatched system gem. The crawler now works out which Bundler settings tier decides the install path (local config, then environment, then global config) and, when that tier sets a truthy path.system, skips the default vendor/bundle root so the system gem homes are crawled. path.system values now follow Bundler's own boolean coercion, so "1" or "yes" count as true too. Fixes #915 Assisted-by: Claude Code:claude-opus-5-5
main has failed socket-patch-core's lib tests since Gradle support (#646) and the digest helpers (#865) both landed. The guard test production_digests_go_through_the_helpers flags three files #646 added that still hash inline: crawlers/gradle_cache.rs, patch/jvm_jar.rs and patch/sidecars/maven.rs. That breaks test, test-release and coverage on every open PR. Each inline sha1/sha256 call now goes through sha1_hex_of or sha256_hex_of, which compute the same lowercase hex. Behaviour is unchanged. Assisted-by: Claude Code:claude-opus-5-5 (cherry picked from commit 659ac2c)
When the Bundler tier that wins sets path.system, Bundler also ignores an env BUNDLE_PATH below it or beside it. If that value named the leftover vendor/bundle, the crawler still probed it as the default root and hid the system gem homes again, so apply and vex kept targeting the unused copy. The env root is now skipped in that case too. Assisted-by: Claude Code:claude-opus-5-5
Assisted-by: Claude Code:claude-opus-5-5
With `default_install_uses_path` (Bundler 2.x) or `simulate_version 5` (Bundler 4.x), and no path in any settings tier, `bundle install` puts the project's gems in `<root>/.bundle/<engine>/<abi>/gems` and `bundle exec` loads them from there. The gem crawler never probed that root, so agent `apply` patched only the system copy, `vex` attested not_affected over the unpatched loaded copy, and the hosted stale-install guard missed a stale `.bundle` materialization. Resolve the deciding Bundler path tier once (explicit path and `path.system`) and probe `<root>/.bundle` whenever that tier names no path and no truthy `path.system`, mirroring `Path#base_path`. Like the other explicit roots it keeps the `gem env` fallback on for default gems. Fixes #967 Assisted-by: Claude Code:claude-opus-5-5
Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
[agent] Ready for review at
Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
#916 merged into main as a squash, so the stacked ruby_crawler.rs and crawler_ruby_e2e.rs conflicted against its own content. Take main's copy of both files and replay only this PR's .bundle-root changes (#967) on top, so the path.system logic stays exactly as reviewed on main. Also pass std::env::var_os directly in the new env-guard test helper to satisfy clippy's redundant_closure lint. Co-Authored-By: Claude <[email protected]>
|
bugbot run Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
bugbot run Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 3886270. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Gem crawler ignores Bundler's.bundle default install path (default_install_uses_path on 2.x, simulate_version 5 on 4.x), so agent apply patches the system copy and vex attests not_affected while Bundler loads the unpatched .bundle/ruby/<abi> copy
There was an error while loading. Please reload this page.