GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix gem BUNDLE_GEMFILE via symlinked dir (#896) by mikolalysenko · Pull Request #1401 · SocketDev/socket-patch

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Oct 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

LLM Description written by Claude Code:claude-opus-5-5

Fixes #896

Summary

A Bundler project reached through a symlinked directory (macOS /tmp →
/private/tmp, a symlinked workspace or volume on Linux) with
BUNDLE_GEMFILE=$PWD/Gemfile, or the same path in .bundle/config, is
now treated as the project's own Gemfile. Before, hosted scan redirected
nothing (redirect_gem_bundle_gemfile_unsupported), vendored mode
refused, vex exited 2 ("never installed") and rollback failed with
patched_ref_unattributable, all on a correctly configured project.

Root cause

formats::gem::manifest::classify (and with_lockfile, and the
env_keeps_root check inside classify) compared the configured path
with the project root lexically. Bundler expands the setting lexically and
then opens it through the OS, so a symlinked spelling of the directory
names the same file and the same Gemfile.lock.

Fix

  • A configured path names a root file when its file name matches and its
    directory is the root's directory: lexically equal, or the same directory
    by file identity (same_file: device + inode on Unix, so a bind mount or
    Windows junction counts too). Only the directory is resolved, so a root
    Gemfile that itself links to a manifest elsewhere stays "another
    manifest" (Bundler's root, and its lock, follow the spelled directory).
  • The same comparison applies to bundler 4's BUNDLE_LOCKFILE and to
    deciding whether an env BUNDLE_GEMFILE keeps Bundler's root (so the
    app config still outranks it).
  • In-memory views (whose root / only stands in for a project not on this
    disk) use new lexical-only variants, so the host's directories never
    decide their verdict.
  • Every caller (hosted gate, vendored gate, lock inventory, VEX discovery,
    rollback attribution) goes through classify, so all are fixed at once.

Tests (red → green)

Issue Test Before fix After
#896 (env, local config, global config, env-keeps-root, BUNDLE_LOCKFILE; both link directions) formats::gem::manifest::tests::a_symlinked_spelling_of_the_root_is_the_roots_own_manifest FAILED ok
#896 (on-disk .bundle/config with the abs logical / physical path) crawlers::ruby_crawler::tests::loaded_manifest_follows_a_symlinked_spelling_of_the_project FAILED (panicked at ruby_crawler.rs:3769) ok
guard: symlinked root Gemfile file stays another manifest a_manifest_the_roots_gemfile_links_to_is_still_another_manifest ok ok
guard: memory view stays lexical the_lexical_variants_never_read_this_hosts_directories n/a (new API) ok

Local runs on 0528f9f:

  • cargo fmt --all -- --check: clean
  • cargo clippy --workspace --all-features -- -D warnings: clean
  • cargo test -p socket-patch-cli --all-features --test e2e_redirect_gem_build --test e2e_vendor_gem_build -- --ignored (Ruby 3.3.6, Bundler 4.0.18): 29 + 8 passed
  • cargo test --workspace --all-features --no-fail-fast: all gem tests pass. 13 tests fail only in this sandbox and are unrelated: chmod-based write-failure tests (covgap_commands_vendor, in_process_redirect, repair, 4 core lib tests) because the sandbox runs as uid 0, and e2e_bun_lockb::binary_shared_bundled_record_hosted_pin_is_managed because patches-api.socket.dev is unreachable here. CI runs them as a normal user with network.

/code-review high findings

Fixed: in-memory views now compare lexically; directory identity uses
same_file instead of canonical path strings (covers bind mounts and
junctions) and is checked once per classify instead of per candidate.
Not changed:

  • Snapshot views don't fingerprint the directory identity of a configured
    absolute path. A symlink retargeted between two passes of one run is far
    outside a real workflow; the comment now says so.
  • hatch_env::same_path is a different (canonicalize) helper; this fix
    uses the crate's existing same_file dependency instead, so there is
    nothing to share.
  • The module doc's "a missing file" wording predates this change (a missing
    root Gemfile named lexically was already Configured).

No wrapper (npm/, pypi/, gem/) changes: they only dispatch to the binary.

🤖 Generated with Claude Code


Generated by Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@claude
Start fix for #896
451e3fb
Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko Mikola Lysenko (mikolalysenko) mentioned this pull request Oct 11, 2026
Gem BUNDLE_GEMFILE check compares paths lexically, so a symlinked spelling of the project's own Gemfile (e.g. macOS /tmp/app/Gemfile) is refused, and vex / rollback reject the hosted patch Bundler is loading #896
Closed
@claude
Accept BUNDLE_GEMFILE through a symlinked dir
6fc7454
A project reached through a symlinked directory (macOS /tmp, a
symlinked workspace) had BUNDLE_GEMFILE=$PWD/Gemfile, or the same path
in .bundle/config, refused as "another manifest". Hosted scan, vendored
mode, vex and rollback then refused a correctly configured project.

Bundler expands the setting lexically and opens it through the OS, so
compare the file name lexically and the directory by resolved identity.
The same applies to BUNDLE_LOCKFILE and to deciding whether the env
value keeps Bundler's root. A root Gemfile that itself links elsewhere
stays distinct, since Bundler's root follows the spelled directory.

Fixes #896

Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko Mikola Lysenko (mikolalysenko) mentioned this pull request Oct 11, 2026
Swarm health manager log #1382
Open
@claude
Compare gem manifest dirs by file identity
0528f9f
Address review of the symlink fix: decide directory identity with
same-file (device and inode) so a bind mount or Windows junction also
counts, check it once per classify, and keep an in-memory project's
paths lexical so the host's own directories never decide its verdict.

Refs #896

Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko
Mikola Lysenko (mikolalysenko) marked this pull request as ready for review October 11, 2026 22:11
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator Author

BugBot review


Generated by Claude Code

cursor[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Oct 11, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for 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 0528f9f. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Tanmay182003
Tanmay Singla (Tanmay182003) approved these changes Oct 11, 2026
View reviewed changes
@mikolalysenko Mikola Lysenko (mikolalysenko) added the Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review label Oct 11, 2026
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator Author

Ready for review at 0528f9f.

  • CI: 35/35 non-skipped checks green (1 neutral, 50 skipped).
  • Bugbot: reviewed 0528f9f, no findings.
  • Mergeable: yes, no conflicts with main. Already approved by Tanmay Singla (@Tanmay182003) at this head.
  • Slack announcement not sent: the Slack send tool was unavailable this run, so the next run will retry.

Generated by Claude Code

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko
Mikola Lysenko (mikolalysenko) added this pull request to the merge queue Oct 11, 2026
Merged via the queue into main with commit 17c5441 Oct 11, 2026
86 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the agent/fix-gem-manifest-symlinked-root branch October 11, 2026 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments
@Tanmay182003 Tanmay Singla (Tanmay182003) Tanmay182003 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Gem BUNDLE_GEMFILE check compares paths lexically, so a symlinked spelling of the project's own Gemfile (e.g. macOS /tmp/app/Gemfile) is refused, and vex / rollback reject the hosted patch Bundler is loading

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@mikolalysenko @Tanmay182003 @claude
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.