Skip to content

Commit a85a8f4

Browse files
committed
bundler: 2026-11-27 run (2)
1 parent 38e3223 commit a85a8f4

3 files changed

Lines changed: 58 additions & 19 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[agent] 2026-11-27: Bundler (RubyGems) bug-hunt run
2+
3+
**Tested:** main `cfc870f` (unchanged since 2026-11-26), release 5.1.0 (from npm, for the regression check). Linux. Ruby 3.3.6 and 3.2.6 with Bundler 2.5.22, 2.6.9 and 4.1.1. Newest Bundler is still 4.1.1. Main had not moved, so this run worked the backlog (items 6, 8 and 10) and the untested cells.
4+
5+
**Harness:** one loopback server in front of the repo's stand-in (`tests/nokogiri/patch_service.rb`): ten gems for a `rails new` app on Rails 8.0 with Bundler 2.6.9 (114 gems, 9 platforms, no `CHECKSUMS`, `path vendor/bundle`), and five gems (rack, rake, json, racc, nokogiri with 8 prebuilds) for a small project on a shared gem home with a `RUBY VERSION` lock. #2313 needs no mock: a hand-written manifest and `apply --offline`.
6+
7+
**Re-triage:** #2269 and #2283 were filed on this same main and have fix work claimed; nothing to re-check. #1109 carries `agent:needs-human`. Nothing closed.
8+
9+
**Cells**
10+
11+
| Cell | Result |
12+
| --- | --- |
13+
| Hosted, Rails 8 app, 2.6.9, 10 gems (5 transitive, 3 native, 3 from prebuilds): scan, frozen install, lock stable, `rails runner`, deployment clone, `vex`, `pristine`, `outdated`, `update --all`, `add` / `remove`, rollback, frozen install, `pristine` | pass: pair byte-exact |
14+
| Agent, Rails 8 app, 2.6.9: scan, frozen install, `apply --check`, `vex`, `install --redownload` then `apply`, rollback | pass |
15+
| Vendored, Rails 8 app, 2.6.9: 6 gems vendored (nokogiri and sqlite3 from prebuilds), 3 native gems and thruster refused, frozen install, `rails runner`, deployment clone, `vex`, rollback | pass: pair byte-exact; the thruster remedy fails as in #2284 |
16+
| Vendored on a shared gem home with another rack version in it, 4.1.1 (#2075) | pass: the unlocked version is skipped |
17+
| Vendored transitive line carries `require: false`, 2.6.9 and 4.1.1 (#2084) | pass |
18+
| Vendored gems beside `get --mode hosted` for the native ones, 4.1.1: frozen install, app, `vex` (5), `remove` of one vendored gem (#2090), deployment clone, rollback | pass: pair byte-exact, range and comment of the declaration restored |
19+
| Agent, `RUBY VERSION` lock written by 2.5.22, then `update --bundler` to 4.1.1 and `lock --add-checksums`: `apply --check`, `vex`, `pristine` then `apply`, rollback | pass |
20+
| Vendored and hosted with the earlier Ruby's tree beside the current one (`ruby/3.2.0`, `ruby/3.3.0`), 4.1.1: frozen install and app on both Rubies, the re-run with Ruby 3.2 first on `PATH`, rollback | pass: pair byte-exact, the leftover is named with a working remedy |
21+
| First-time read-through: bare `scan`, `rollback`, `list`, a scan with no lock in each mode, a lock-only checkout | messages name the next step; led to #2313 |
22+
| Agent with an explicit `path` other than `vendor/bundle`, or `apply` before the first `bundle install` | **fail #2313** |
23+
24+
**Filed**
25+
- https://github.com/SocketDev/socket-patch/issues/2313: agent `apply` and `scan --mode agent` also patch every same-version copy in the `gem env` homes when the project's Bundler `path` is not `vendor/bundle` (or holds nothing yet), although Bundler never loads those copies for the project. Reproduces on main and 5.1.0 (not a regression), Bundler 2.5.22, 2.6.9, 4.1.1. With `path vendor/bundle` installed the system copy is left alone. Suspect `crawlers/ruby_crawler.rs:140`.
26+
27+
**Commented**
28+
- https://github.com/SocketDev/socket-patch/issues/2284#issuecomment-7221750634: the remedy also fails on the Rails 8 lock Bundler 2.6.9 writes (no `ruby` in `PLATFORMS`).
29+
30+
**Ruled out** (added to `known-non-bugs/bundler.md`)
31+
- `apply --offline` after `scan --mode agent` and a reinstall asks for `repair`: the scan keeps no blobs, plain `apply` works.
32+
- The "unwired packages keep their patched bytes" note for vendored-only gems the gem home holds no copy of: generic wording, nothing is patched.
33+
- The other-Ruby warning of a hosted `get` names `socket-patch scan`; re-running the `get` works as well.
34+
- The rollback side of #2313 (records kept, `rollback <purl> -g` named and working) is part of that issue.
35+
36+
**Blocked / not reached:** a Rust (`rb_sys`) gem and sass-embedded in the agent rebuild, vendored `scan --prune`, `report` (the mock has no `/telemetry` route), Ruby 3.4 / 4.0 (none under `/opt`), the remaining re-runs of backlog 6.

‎known-non-bugs/bundler.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,3 +227,7 @@ Documented limitations and verified false positives. One bullet each. Search thi
227227
- A checkout that installed a hosted branch's gems (`bundle install`, no socket-patch run) and then switches to a branch with the unpatched pair keeps the patched copies and archives in `vendor/bundle`: `bundle install` passes and the app loads patched code, but `bundle pristine` / `--redownload` on Bundler 2.6+ remove the gems and fail on the lock's checksum until each `cache/<gem>.gem` is deleted (Bundler names the file). Bundler's behaviour for any same-version gem from another source, the in-project form of the shared-gem-home note; `socket-patch rollback` on the patched branch restores the copies (2026-11-27).
228228
- A merge conflict in a hosted `Gemfile` / `Gemfile.lock`: `list` and `rollback` refuse and name the marker's line, `scan` skips every gem ("reconcile the project's lockfiles"). Resolving with the other side's lock plus `bundle install` gives the lock a scan writes. After `bundle add` on the other branch, a later `rollback` takes the transitive line and the one blank line before it, so `end` and the next `gem` line end up adjacent: cosmetic, the lock is byte-exact (2026-11-27).
229229
- After the printed "move it to a newer release" steps, each scan repeats "Not hosted pkg:gem/rack@2.2.8 … installed on this machine but this project doesn't lock it" while the old version stays in `vendor/bundle`: documented `redirect_gem_version_not_locked`, exit 0; `bundle clean` ends it (2026-11-27).
230+
- `scan --mode agent` leaves only `.socket/manifest.json` (no blobs), so `apply --offline` after a reinstall fails with "no local source … run `socket-patch repair`"; plain `apply` downloads them and works (2026-11-27).
231+
- Rollback of a project with vendored-only gems and hosted gems prints "N unwired packages keep their patched bytes in installed trees" for the vendored ones when the project's gem home holds no copy of them at all: the generic note, nothing is patched there, and `bundle install` installs upstream (2026-11-27).
232+
- A hosted `get` whose native gem sits in another Ruby's tree says "Re-run `socket-patch scan` with the Ruby that installed the gem first on `PATH`"; re-running the same `get` with that Ruby works too and patches that tree. Rollback with the other Ruby leaves it and names the `rm -rf … && bundle install` (documented) (2026-11-27).
233+
- `apply` before `bundle install` with `path vendor/bundle`: the system copies are patched (#2313), and a later `rollback` keeps the records and names `socket-patch rollback <purl> -g` per gem, which works. Don't file the rollback side separately (2026-11-27).

0 commit comments

Comments
 (0)