Skip to content

fix: restore cached binaries into the gem dir - #33

Merged
Thejus-Paul merged 1 commit into
mainfrom
fix/restore-gem-dir-binaries
Sep 23, 2026
Merged

Thejus-Paul merged 1 commit into
mainfrom
fix/restore-gem-dir-binaries

Conversation

@Thejus-Paul

Copy link
Copy Markdown
Member

No issue filed for this.

A Rails app using the prebake plugin failed to boot in CI after a fresh bundle install. Loading the http gem stopped with "cannot find 'llhttp-ext' library", even though llhttp-ffi had installed without errors. Apps using sassc directly hit the same wall when it could not open libsass. Both gems load their compiled library from a fixed spot inside the gem's own folder, and a prebake cache hit never put a copy there, so installs that looked complete could not load.

A cache hit now puts those libraries where a normal compile from source leaves them, so both gems load exactly as they do without prebake. Apps already broken by an earlier release need the affected gem reinstalled once.

A source build leaves compiled binaries in the gem dir as well as in
extension_dir: ffi-compiler builds in place under ext/, and RubyGems
copies extconf output into lib/. A cache hit only wrote extension_dir,
so gems that dlopen a fixed path inside the gem dir failed to load.
llhttp-ffi on ffi-compiler 1.3.2 raised "cannot find 'llhttp-ext'
library", which breaks Rails boot for apps on http 5.x, and raw sassc
2.4.0 could not open lib/sassc/libsass.so.

Hosted cached gems keep those binaries at their gem dir paths, so the
extractor now copies anything under ext/ or lib/ back to the same path
in the gem dir. Other paths are left alone, because self-hosted cached
gems put extension_dir binaries at the gem root, where no build would
leave them.

The sassc troubleshooting entry claimed the error reproduces without
prebake. It does not on Ruby 4.0.5, whose RubyGems still copies into
lib/, so the entry now points at upgrading and a one-off bundle
pristine.
@Thejus-Paul Thejus-Paul self-assigned this Sep 23, 2026
@Thejus-Paul
Thejus-Paul marked this pull request as ready for review September 23, 2026 10:55
@Thejus-Paul
Thejus-Paul merged commit 3763ab9 into main Sep 23, 2026
6 checks passed
@Thejus-Paul
Thejus-Paul deleted the fix/restore-gem-dir-binaries branch September 23, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant