Repository navigation
fix: restore cached binaries into the gem dir - #33
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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.