Skip to content

Commit 954684f

Browse files
committed
bundler: 2026-11-17 run (agent native rebuild; #2104, #2105, #2106)
1 parent 9342839 commit 954684f

3 files changed

Lines changed: 58 additions & 19 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-17: Bundler (RubyGems) bug-hunt run
2+
3+
**Tested:** main `3b14afc` (5.1.0 is still the latest release; 12 commits since `63f791d`, among them #2098, the agent rebuild of native gems from the source gem, precompiled gems included). Linux. Ruby 3.3.6 with Bundler 4.0.18, 2.6.9 and 2.5.22. The 5.1.0 release binary was installed to date each finding.
4+
5+
**Harness:** no mock this run. Agent records were written by hand (`.socket/manifest.json` and blobs) against real gems from rubygems.org; a C patch defines a global constant in the gem's `Init_` function, so the app shows whether the binary Ruby loads carries it.
6+
7+
**Re-triage:** not done. #2083 and #2086 (the two oldest without `agent:needs-human`) need the hosted mock and the run went to the new rebuild instead. No commit since `63f791d` names either. They are first in the backlog.
8+
9+
**Cells** (agent mode, `vendor/bundle`)
10+
11+
| Cell | Result |
12+
| --- | --- |
13+
| Precompiled nokogiri 1.18.3 (`x86_64-linux-gnu`), C file patched: dry run, apply (70 s), app, `bundle install`, frozen install, `apply --check`, `vex`, rollback | pass, tree byte-exact after rollback |
14+
| Same gem, no `cache/` dir (source gem downloaded), record adds `patches/libxml2/0100-*.patch` and changes a `.rb` | pass: libxml2 rebuilt with the patch, `mini_portile2` not left in the gem home, rollback byte-exact |
15+
| Precompiled ffi 1.17.1 (ships no `ext/`), sqlite3 2.5.0, google-protobuf 4.29.3 | pass; ffi also through `bundle pristine`, `apply --check` (out of sync), `vex` (omitted), re-apply, rollback |
16+
| Precompiled pg 1.6.2, no `libpq-dev` | gem untouched, exit 1; the error hides the cause (not filed, see below) |
17+
| 26 source-built gems in one project (puma, nio4r, bcrypt, json, msgpack, bootsnap, racc, websocket-driver, date, oj, redcarpet, bigdecimal, strscan, stringio, prism, rbs, debug, stackprof, unf_ext, io-console, psych, openssl, erb, hiredis-client, cgi, digest-crc) | apply 2.5 min, app loads every patched extension but digest-crc, 26 VEX statements, rollback byte-exact |
18+
| scrypt 3.0.8 (ffi-compiler, builds in its own tree) | apply pass; rollback **fail #2104** |
19+
| digest-crc 0.6.5 (Rakefile build in its own tree) | **fail #2105** |
20+
| argon2 2.3.0 | **fail #2106** |
21+
22+
**Filed**
23+
- https://github.com/SocketDev/socket-patch/issues/2104: `rollback` of a gem that builds its library in its own tree restores the source and leaves the patched binary; the marker and the backup record no in-tree artifact. `apply --check` and `list` then report nothing. Also on 5.1.0 and Bundler 2.6.9.
24+
- https://github.com/SocketDev/socket-patch/issues/2105: the in-place rebuild of digest-crc is a no-op (its Rakefile does not depend on the sources), yet `apply` reports success, `apply --check` is in sync and `vex` emits `not_affected`. Also on 5.1.0 and Bundler 2.5.22.
25+
- https://github.com/SocketDev/socket-patch/issues/2106 (`ux`): argon2, the gem the docs name as rebuilt from its installed tree, can never be rebuilt: its `extconf.rb` renames `Makefile.real` once. The remedy says to install a compiler. Also on 5.1.0.
26+
27+
**Commented / closed:** nothing.
28+
29+
**Found, not filed (3-issue cap; first backlog item after re-triage)**
30+
- `native_extension_build_failed` for precompiled pg shows the last 20 lines of stderr, which is mkmf's option dump: the cause ("Can't find the 'libpq-fe.h header") is cut off, the `mkmf.log` it names sits in the deleted stage directory, the remedy says to install a compiler, and the text is printed twice.
31+
32+
**Ruled out**
33+
- openssl's patch "not taking effect": my record patched `Init_ossl_locks`, which is compiled out.
34+
- digest-crc's `crc12_3gpp` extension is never required by the gem; `crc32` is the one to observe.
35+
- The rebuilt nokogiri links system `liblzma` / `libz` dynamically, as `gem install --platform ruby` does.

‎known-non-bugs/bundler.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,7 @@ Documented limitations and verified false positives. One bullet each. Search thi
177177
- A hosted scan refuses `gem "rack", "~> 2.2.3", { require: false }` (a braced options hash) and a transitive line when the Gemfile has an `__END__` marker. Both write nothing for that gem and the pair still installs (2026-11-16).
178178
- A superseding patch that changes the same file as the old agent patch is handled: the file ends on the new content and `rollback` restores the original. Only files that dropped out of the patch are left behind (#2096).
179179
- A `.orig/` copy of `Gemfile` + `Gemfile.lock` inside a test project counts as a project directory for a bare hosted / vendored scan and for `rollback`. Keep backups outside the project.
180+
- A synthetic C patch that injects code into the first `Init_*` function of `openssl`'s `ext/openssl/ossl.c` shows no effect: that function (`Init_ossl_locks`) is compiled out on OpenSSL 1.1+. Test artifact; patch `Init_openssl` instead (2026-11-17).
181+
- `digest-crc`'s `crc12_3gpp_ext.so` is built but never required by the gem (there is no `lib/digest/crc12_3gpp.rb`). Use `crc32` to observe a patch; the no-op rebuild itself is #2105 (2026-11-17).
182+
- An agent rebuild of precompiled nokogiri links the system `liblzma` / `libz` and `libruby` dynamically, unlike the self-contained prebuilt binary. That is what `gem install --platform ruby` gives on the same machine; not filed (2026-11-17).
183+
- `apply --check` exits 0 after printing "Patches are OUT OF SYNC" only when piped through `tail`; the exit code read was `tail`'s. Read `${PIPESTATUS[0]}` (2026-11-17).

0 commit comments

Comments
 (0)