Skip to content

Commit 90b6fc6

Browse files
committed
bundler: 2026-11-16 run (Bundler 4.1.0; #2092, #2093)
1 parent 54bd233 commit 90b6fc6

3 files changed

Lines changed: 50 additions & 11 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[agent] 2026-11-16: Bundler (RubyGems) bug-hunt run
2+
3+
**Tested:** main `63f791d` (5.1.0; same SHA as the last runs). Bundler 4.1.0 stable came out today, so the run went to it first. Linux. Ruby 3.3.6 with Bundler 4.1.0, 4.0.18 and 2.6.9; Ruby 3.2.6 with RubyGems 4.1.0 and Bundler 4.1.0.
4+
5+
**Harness:** the standalone Python mock again, with real `rack 2.2.8`, `rake 13.0.6` (group block), `bcrypt 3.1.20` (C source), `concurrent-ruby 1.2.2` (transitive, pinned with the new `override` DSL), `nokogiri 1.16.0`, `mini_portile2 2.8.9` and `racc 1.8.1` repacked.
6+
7+
**Re-triage:** main has not moved, so nothing to re-check. #1109 is `agent:needs-human`.
8+
9+
**Cells**
10+
11+
| Cell | Result |
12+
| --- | --- |
13+
| Hosted common path on 4.1.0 with an `OVERRIDES` lock section: scan, frozen install, lock stable, app, `vex`, deployment clone, `pristine`, `--redownload`, rollback | pass, pair byte-exact, `OVERRIDES` untouched |
14+
| Vendored common path on 4.1.0, same project | pass (2 of 4 vendored; bcrypt and the group gem refused as before, #2091) |
15+
| Agent common path on 4.1.0, same project, native rebuild | pass |
16+
| Hosted and agent with a native gem on RubyGems 4.1.0 + Bundler 4.1.0 (no build logs installed any more) | pass |
17+
| Hosted with `global_gem_cache true` (downloads and extensions cached per source) | pass |
18+
| Hosted with `cooldown 7` and patched gems published yesterday: install, `bundle lock`, `bundle update <other gem>`, fresh clone | pass |
19+
| Hosted with `prune true` (4.1.0 deletes the gem home's `cache/` after each install) | scan pass; rollback **fail #2092** |
20+
| 4.1.0 default lock that lists `nokogiri (1.16.0)` beside the platform builds: hosted, agent, vendored | pass (hosted refuses nokogiri as documented and wires racc, rack and mini_portile2; pair byte-exact after rollback) |
21+
| Vendored monorepo, three Gemfiles, scan from the root: frozen installs, `list`, rollback | pass on 4.1.0 |
22+
| Agent to vendored, then `rollback` / `remove` / `vendor --revert` | **fail #2093** on 4.1.0, 4.0.18 and 2.6.9 |
23+
| Mixed vendored + hosted: `repair`, `scan --mode hosted --prune`, frozen install, `vex` | pass on 4.1.0 (pair unchanged) |
24+
25+
**Filed**
26+
- https://github.com/SocketDev/socket-patch/issues/2092 (`ux`): hosted `rollback` / `remove` leave the patched gem installed when the gem home has no `cache/` dir (Bundler 4.1 `prune`, the Rails Dockerfile's `rm -rf ruby/*/cache`). The scan replaces the copy in that state, the unwind judges a copy only by its cached archive and skips it without a warning. The "next package-manager install" note does not help: `bundle install` keeps the copy. Reproduces on 4.1.0, 4.0.18 and 2.6.9.
27+
- https://github.com/SocketDev/socket-patch/issues/2093: vendoring a gem that agent mode patched in place drops its manifest record and keeps the patch in `vendor/bundle`. After the vendored gem is unwound the app loads that copy again, still patched, and `apply --check` / `list` see nothing. `bundle pristine` restores it.
28+
29+
**Commented / closed:** nothing.
30+
31+
**Ruled out**
32+
- Hosted on the 4.1 lock installs `mini_portile2` where it was skipped before. Documented (the transitive line is in the default group).
33+
- `cooldown` and a fresh patched gem: a locked version is exempt in Bundler.
34+
- `bundle install --redownload` failing on 4.0.18 after `cache/` was deleted by hand: Bundler, not socket-patch.
35+
- `vex` from a monorepo root attests the root project only. Already listed.

‎known-non-bugs/bundler.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,7 @@ Documented limitations and verified false positives. One bullet each. Search thi
168168
- A hosted lock installed by a different Bundler than wrote it changes only `BUNDLED WITH` (and Bundler 2.5.22 drops the `bundler` CHECKSUMS line of a 4.0 lock); the hosted sections, the patched installs and `vex` are unaffected. That is Bundler (2026-11-15).
169169
- Vendored mode refusing `group … do` gems, native-extension gems and precompiled platform gems on a Rails Gemfile is by design (#340); only the missing remedy in the messages is filed (#2091). Top-level `gem "x", group: :test` is accepted (2026-11-15).
170170
- `scan --mode agent` over a hosted project keeps the hosted wiring and warns ("left the hosted wiring live"); `apply` reports the copies as already patched. By design (2026-11-15).
171+
- Hosted on a Bundler 4.1 default lock (ruby variant listed beside platform builds) wires a gem that only the ruby variant needs (`mini_portile2` for nokogiri), so it is installed on platforms that skipped it before, and its dir stays after rollback until `bundle clean`. Documented: the transitive line is in the default group and installs everywhere (2026-11-16).
172+
- Bundler 4.1 `cooldown` does not reject a hosted pin whose registry entry is newer than the window: a version the lock already pins is exempt (`locked_by_lockfile?`). Only `bundle update <that gem>` is subject to it, which #2070 covers (2026-11-16).
173+
- `bundle install --redownload` on Bundler 4.0.18 fails with "Could not find rack-2.2.8.gem for installation" after the gem home's `cache/` dir was deleted by hand. That is Bundler, with or without socket-patch; 4.1.0 with `prune` recreates the dir (2026-11-16).
174+
- Bundler 4.1 `global_gem_cache` keys downloads and compiled extensions by source, so a hosted gem and the upstream gem of the same version never share an entry (2026-11-16).

‎state/bundler.md‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
11
[agent] Progress ledger for the scheduled Bundler (RubyGems) bug-hunt routine (label pm:bundler).
22

3-
Last run: 2026-11-15, main `63f791d`, release 5.1.0, newest Bundler 4.0.24 stable and 4.1.0.beta3 prerelease (tested so far: 2.3.27, 2.4.19, 2.5.22/23, 2.6.9, 4.0.18, 4.0.24, 4.1.0.beta3). Ruby 3.1.6, 3.2.6 and 3.3.6. Second run of 11-15.
3+
Last run: 2026-11-16, main `63f791d`, release 5.1.0, newest Bundler 4.1.0 stable (released 2026-11-16; no newer prerelease) (tested so far: 2.3.27, 2.4.19, 2.5.22/23, 2.6.9, 4.0.18, 4.0.24, 4.1.0.beta3, 4.1.0). Ruby 3.1.6, 3.2.6 and 3.3.6; RubyGems 4.1.0 on 3.2.6.
44

55
The ledger was reset on 2026-11-13. The old 97 KB ledger is in this branch's history (`git show ec2d4516f:state/bundler.md`); search it with `git grep`, don't copy it back.
66

7-
Harness notes: the sandbox reaches rubygems.org but not the Socket patch API. A standalone mock of the patch API and patch registry works for all three modes (endpoints: `POST …/patches/batch`, `GET …/patches/by-package/<purl>`, `POST …/patches/package`, `GET …/patches/view/<uuid>` with `blobContent`, and a compact index under `/patch-registry/gem/<token>/<uuid>/`; copy the `/info` line from rubygems.org and swap the checksum). Build the patched gem by repacking the upstream `.gem` with its `metadata.gz` unchanged, and pass `--api-url <mock> --proxy-url <mock> --patch-server-url <mock>` to every command (without a token the CLI calls the proxy URL). For vendored mode the grant's `tarball` artifact needs `integrity.sha512` (SRI) and a second artifact `{"kind":"gem-stub-gemspec"}` serving `gem spec <patched.gem> --ruby`. Give test repos a `**/vendor/bundle/` ignore line. `--api-token fake --org test` works in place of the proxy route. For a gem with precompiled builds, `nokogiri 1.16.0` compiles from source in under a minute here. rbenv Rubies are in `/opt/ruby-3.1.6` (Bundler 2.3.27, 2.6.9), `/opt/ruby-3.2.6` (2.4.19, 4.0.18), `/opt/ruby-3.3.6` (2.5.22, 4.0.18); `gem install bundler -v 4.0.24` / `4.1.0.beta3` works there (2.6.9 on 3.3.6 too). A patched gem can also be made without Ruby: copy the upstream `.gem`, change one file in `data.tar.gz` and recompute `checksums.yaml.gz`. A realistic project: `gem install rails -v 7.1.5` into a scratch `GEM_HOME`, then `rails new app --skip-git --skip-bundle --skip-javascript --skip-hotwire --skip-asset-pipeline --skip-docker` (81 gems, installs in 30 s); patch rack, rails-html-sanitizer, puma, bootsnap, web-console, capybara.
7+
Harness notes: the sandbox reaches rubygems.org but not the Socket patch API. A standalone mock of the patch API and patch registry works for all three modes (endpoints: `POST …/patches/batch`, `GET …/patches/by-package/<purl>`, `POST …/patches/package`, `GET …/patches/view/<uuid>` with `blobContent`, and a compact index under `/patch-registry/gem/<token>/<uuid>/`; copy the `/info` line from rubygems.org and swap the checksum). Build the patched gem by repacking the upstream `.gem` with its `metadata.gz` unchanged, and pass `--api-url <mock> --proxy-url <mock> --patch-server-url <mock>` to every command (without a token the CLI calls the proxy URL). For vendored mode the grant's `tarball` artifact needs `integrity.sha512` (SRI) and a second artifact `{"kind":"gem-stub-gemspec"}` serving `gem spec <patched.gem> --ruby`. Give test repos a `**/vendor/bundle/` ignore line. `--api-token fake --org test` works in place of the proxy route. For a gem with precompiled builds, `nokogiri 1.16.0` compiles from source in under a minute here. rbenv Rubies are in `/opt/ruby-3.1.6` (Bundler 2.3.27, 2.6.9), `/opt/ruby-3.2.6` (2.4.19, 4.0.18), `/opt/ruby-3.3.6` (2.5.22, 4.0.18); `gem install bundler -v 4.1.0` / `4.0.24` works there (2.6.9 on 3.3.6 too), and `gem update --system 4.1.0` gives RubyGems 4.1 (the container is new each run). Select a Bundler with `BUNDLER_VERSION`. The sandbox refuses `rm -rf` on a path built from `$HOME`; use a new directory instead. A patched gem can also be made without Ruby: copy the upstream `.gem`, change one file in `data.tar.gz` and recompute `checksums.yaml.gz`. A realistic project: `gem install rails -v 7.1.5` into a scratch `GEM_HOME`, then `rails new app --skip-git --skip-bundle --skip-javascript --skip-hotwire --skip-asset-pipeline --skip-docker` (81 gems, installs in 30 s); patch rack, rails-html-sanitizer, puma, bootsnap, web-console, capybara.
88

99
## Coverage matrix
1010

1111
Linux only. A cell is `pass` with the Bundler versions and the date, `fail #N`, `n/a`, or `untested`.
1212

1313
| Workflow | Agent | Vendored | Hosted |
1414
| --- | --- | --- | --- |
15-
| Common path: scan, patch, fresh `bundle install`, app loads patched code, `vex`, rollback, `bundle install` again | pass 2.4.19, 2.5.22, 2.6.9, 4.0.18; Rails 7.1 app with bootsnap and a CI clone without groups on 4.0.18 (11-15) | pass 2.5.22, 2.6.9, 4.0.18, 4.1.0.beta3, CRLF pair too (11-15); `vex` warning fail #2076; on a Rails Gemfile 5 of 7 gems are refused with no remedy, fail #2091 | pass 2.3.27 to 4.0.24, 4.1.0.beta3 (11-14); Rails 7.1 app on 2.5.22, 2.6.9, 4.0.18, cross-Bundler installs and `bundle cache` too (11-15) |
15+
| Common path: scan, patch, fresh `bundle install`, app loads patched code, `vex`, rollback, `bundle install` again | pass 2.4.19, 2.5.22, 2.6.9, 4.0.18, 4.1.0 (11-16); Rails 7.1 app with bootsnap and a CI clone without groups on 4.0.18 (11-15) | pass 2.5.22, 2.6.9, 4.0.18, 4.1.0, CRLF pair too (11-16); `vex` warning fail #2076; on a Rails Gemfile 5 of 7 gems are refused with no remedy, fail #2091 | pass 2.3.27 to 4.0.24, 4.1.0 (11-16); Rails 7.1 app on 2.5.22, 2.6.9, 4.0.18, cross-Bundler installs and `bundle cache` too (11-15) |
1616
| System or user gem home (no `BUNDLE_PATH`) | pass 4.0.18, 2.5.22 with `GEM_HOME` (11-15) | fail #2075 (2.6.9, 4.0.18) | pass 4.0.18: warning, `scan` and `rollback` with `--gem-refresh-shared` (11-15); the remedy after a plain rollback / remove fail #2086 |
1717
| `bundle config set path vendor/bundle` | pass 2.6.9 (11-13) | pass 4.0.18 (11-14) | pass 2.3.27 to 4.0.18 (11-14) |
1818
| Deployment and frozen installs (`BUNDLE_DEPLOYMENT`, `BUNDLE_FROZEN`, `.bundle/config`) | pass frozen 2.6.9, 4.0.18 (11-13) | pass frozen and deployment clone, with `BUNDLE_WITHOUT` too, 4.0.18 (11-14) | pass frozen on all, deployment clone 2.5.22, 2.6.9, 4.0.18 (11-14) |
19-
| Multi-platform lock, platform gem (`-x86_64-linux`) | pass 4.0.18: Ruby-file patch applied, C patch refused as documented (11-15) | pass 4.0.18: 7-platform lock, precompiled gem beside vendored ones (11-15) | pass 4.0.18: nokogiri refused, rest installs (11-14); moved to the `ruby` platform it installs patched, standalone `vex` fail #2087 |
19+
| Multi-platform lock, platform gem (`-x86_64-linux`) | pass 4.0.18, 4.1.0: Ruby-file patch applied, C patch refused as documented (11-16) | pass 4.0.18, 4.1.0: 7-platform lock, precompiled gem beside vendored ones (11-16) | pass 4.0.18, 4.1.0: nokogiri refused, rest installs (11-16); moved to the `ruby` platform it installs patched, standalone `vex` fail #2087 |
2020
| Gem with a native extension (rebuild after patching, rollback restores the build) | pass 2.5.22, 2.6.9, 4.0.18, build failure restored too (11-15); `scan --no-gem-native-rebuild` fail #2069 | refused as documented, exit 1, other gems vendored, 4.0.24 (11-14) | pass 4.0.18, 4.0.24 (11-14) |
2121
| Patched gem that is only a transitive dependency | pass 2.6.9, 4.0.18 (11-14) | installs and reverts 4.0.18; `Bundler.require` loads it fail #2084 | pass 2.5.23 to 4.0.24 (11-14) |
2222
| Git and path sources next to a patched gem | pass 4.0.18 (11-14) | pass 4.0.24, 4.1.0.beta3 (11-14) | pass 4.0.18, 4.0.24, incl. a gem transitive through a path gem (11-14) |
2323
| `bundle update` / `bundle add` / `bundle remove` / `bundle outdated` after patching | pass 4.0.18: add, remove, clean, outdated, `--redownload` then `apply` (11-14) | pass 4.0.18: add, remove, update, outdated, `lock --add-platform`, `cache` (11-14) | add / remove pass 2.6.9 (11-13); `lock --add-platform`, `update <other gem>`, `clean`, `doctor`, `binstubs` pass 4.0.18 (11-14); outdated / update fail #2070 |
24-
| Rollback and remove restore `Gemfile` and `Gemfile.lock` byte for byte | pass (pair never touched) (11-14) | rollback, `remove`, `vendor --revert` pass 4.0.18 (11-14) | rollback and `remove` pass on all, CRLF and `vendor/cache` archives too (11-14) |
24+
| Rollback and remove restore `Gemfile` and `Gemfile.lock` byte for byte | pass (pair never touched) (11-14) | rollback, `remove`, `vendor --revert` pass 4.0.18 (11-14) | pair restored on all, CRLF and `vendor/cache` archives too (11-16); installed copy left patched when the gem home has no `cache/` dir, fail #2092 |
2525
| `vex` reports only what is really applied | pass 2.6.9, 4.0.18, after `bundle pristine` too (11-13) | attests correctly 4.0.18; false `vendored_tree_out_of_sync` fail #2076 | pass 2.6.9, 4.0.18, stale shared-home copy omitted (11-15); orphan platform dir fail #2087 |
2626
| `gems.rb` / `gems.locked` spelling | pass 2.5.22 (11-15) | refused as documented (`gemfile_not_loaded`), not re-run | pass 4.0.18 (11-14) |
2727
| Lock with a CHECKSUMS section (Bundler 2.6+) | n/a | pass 4.0.18; without the section 2.5.22, 2.6.9 (11-15) | pass 4.0.18 (11-13) |
28-
| Monorepo: several Gemfiles, nested projects, scan from the repo root | untested (agent scans one project by design) | untested | pass 4.0.18: scan, `list`, rollback from the root (11-14) |
28+
| Monorepo: several Gemfiles, nested projects, scan from the repo root | untested (agent scans one project by design) | pass 4.1.0: 3 Gemfiles, scan, frozen installs, `list`, rollback from the root (11-16) | pass 4.0.18: scan, `list`, rollback from the root (11-14) |
2929
| `setup` and the Bundler plugin it installs | n/a: `setup` and the plugin were removed in v5 (CLI_CONTRACT "…no longer published"); only `gem_bundler_plugin_stale` detection is left, untested | n/a | n/a |
3030
| Re-runs (idempotency) and `--json` output | pass 4.0.18 (11-14) | re-scan pass 2.6.9, 4.0.18 (apart from #2075) | pass 4.0.18 (11-14) |
31-
| Switching modes on one project | hosted to agent pass 4.0.18 (11-15); agent to hosted leaves the upstream archive, `pristine` / `--redownload` fail #2089 | hosted to vendored: pair and mixed state pass 4.0.24; rollback afterwards leaves patched installs, fail #2083 | hosted beside vendored gems (mixed) installs and attests 4.0.18 (11-15); any revert of the vendored gem then corrupts the lock, fail #2090 |
32-
| Bundler 4.1 prerelease | untested | pass 4.1.0.beta3 (11-14); `OVERRIDES` / `CONTENT ADDRESSES` sections not produced, untested | pass 4.1.0.beta3 (11-14); same sections untested |
31+
| Switching modes on one project | hosted to agent pass 4.0.18 (11-15); agent to hosted leaves the upstream archive, `pristine` / `--redownload` fail #2089; agent to vendored and back leaves the in-place patch with no record, fail #2093 | hosted to vendored: pair and mixed state pass 4.0.24; rollback afterwards leaves patched installs, fail #2083 | hosted beside vendored gems (mixed) installs and attests 4.0.18, 4.1.0, `repair` and `scan --prune` leave it alone (11-16); any revert of the vendored gem then corrupts the lock, fail #2090 |
32+
| Bundler 4.1 specifics (4.1.0 stable) | pass with an `OVERRIDES` lock, and on RubyGems 4.1 with a native rebuild (11-16) | pass with an `OVERRIDES` lock and the new default lock that lists the `ruby` variant beside platform builds (11-16) | pass with `OVERRIDES`, `global_gem_cache`, `cooldown` (patched gem newer than the window), RubyGems 4.1 native refresh (11-16); `prune` fail #2092; `CONTENT ADDRESSES` untested |
3333
| Bundler 1.x refused where the docs say so | untested | untested | untested |
3434

3535
## Backlog
3636

37-
1. Mixed and switched states, the rest (#2089 and #2090 came from here): agent to hosted with a native gem or a shared gem home; agent to vendored and back; hosted first and then `vendor <one purl>`; `scan --prune` and `repair` on a mixed project; a re-scan when a newer patch supersedes one of a mixed pair.
37+
1. Mixed and switched states, the rest (#2089, #2090 and #2093 came from here): agent to hosted with a native gem or a shared gem home; vendored to agent; hosted first and then `vendor <one purl>`; a re-scan when a newer patch supersedes one of a mixed pair; `repair` on a vendored project prints "No manifest; no patch artifacts to download." (check it against the contract).
3838
2. Friction pass, the rest. Still open candidates: `redirect_gem_no_checksums_section` says "bundler < 2.6 does not write one" on a 2.6.9 lock (its remedy works); `scan --mode vendored` exits 1 whenever one patched gem is refused, with next steps that read like success (noted in #2091); `remove <gem>` from a monorepo root doesn't name the sub-projects that pin it; `apply --check` says "Run `socket-patch apply` to regenerate them" for a gem `apply` refuses; the hosted next step says "a plain `bundle install` keeps the gems it already has" when the stale copy is a platform build the lock no longer names; `docs/usage.md` never mentions Ruby.
3939
3. The Rails app, the rest: a Rails 8 Gemfile (kamal, thruster, solid_*), the default dev setup with a shared rbenv gem home, `bin/setup`, a Dockerfile-style `BUNDLE_PATH=/usr/local/bundle` install, `bundle update` / `bundle update rails` with hosted pins (beyond #2070), Dependabot-style `bundle lock --update <gem>`.
4040
4. Vendored mode, the rest: `remove` / `vendor --revert` after a hosted to vendored takeover (#2083 covers `rollback` only), `scan --prune`.
4141
5. Agent mode, the rest: the system gem home under `/opt/ruby-*` itself, `apply --dry-run` starts no Ruby, a relative crawl root (#2048), an interrupted rebuild, a monorepo. Other flags the nested apply of `scan --mode agent` may drop (same cause as #2069).
4242
6. Hosted shared gem home, the rest: `--gem-refresh-shared` with two projects pinning the same gem version, `remove` of one gem out of several, `SOCKET_GEM_REFRESH_SHARED=1`.
43-
7. Bundler 4.1 lock sections `OVERRIDES` and `CONTENT ADDRESSES`: find which Gemfile or setting makes 4.1.0.beta3 write them, then hosted and vendored. Ruby 3.4 is not in the sandbox.
43+
7. Bundler 4.1, the rest: content-addressable gems (the `CONTENT ADDRESSES` lock section needs a registry that serves them; see `lockfile_generator.rb`), `override "x", with:, in:`, `bundle update` / `outdated` under `cooldown`, the OS credential store, `bundler/inline`. Ruby 3.4 is not in the sandbox.
4444
8. Deployment mode and `.bundle/config` shapes around the stale-install guard. #1109 is open and waiting on a maintainer decision; don't re-file it.
4545
9. Bundler 1.x refused where the docs say so (needs a Ruby that still runs Bundler 1.17; none in the sandbox).
46-
10. Re-check #2069, #2070, #2075, #2076, #2083, #2084, #2086, #2087, #2089, #2090 and #2091 once fixed.
46+
10. Re-check #2069, #2070, #2075, #2076, #2083, #2084, #2086, #2087, #2089, #2090, #2091, #2092 and #2093 once fixed.
4747

4848
## Known non-bugs
4949

0 commit comments

Comments
 (0)