Repository navigation
fix: build from source when a gem has build options - #37
Merged
Merged
Conversation
Bundler hands the options from `bundle config build.<gem>` to Gem::Ext::Builder as build args, and `gem install <gem> -- <options>` does the same. The cache lookup never read them, so a cache hit installed a binary compiled with default options and the project's setting silently had no effect. pg with --with-pg-config is the common case. Cached binaries are always built with default options, so a gem with build args now skips the cache and goes straight to the source build.
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.
Fixes #34
A project that passes a build option to a native gem through Bundler, for example telling pg which PostgreSQL install to compile against, lost that option whenever prebake found the gem in the cache. The install reported success, but the gem that landed was a copy compiled ahead of time with default options. Nothing told the developer that their setting had no effect.
A gem with build options is now always compiled from source, so the project's setting takes effect whether or not a prebuilt copy is in the cache. Gems without build options install from the cache as before.