Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vendorizing google-cloud-ruby only packages google-protobuf for current OS #1592

Closed
bkoski opened this issue Jul 13, 2017 · 3 comments
Closed
Assignees

Comments

@bkoski
Copy link
Contributor

bkoski commented Jul 13, 2017

If you vendorize a gemset that includes google-cloud-ruby (bundle package --all), the vendor folder will only include the google-protobuf .gem for the current platform. This results in a missing gem error if you try to bundle install --local on another platform.

For example: if I bundle package --all on OS X, vendor/cache will include google-protobuf-3.3.0-universal-darwin.gem. If I try to run bundle install --local inside a Docker container, the install fails because google-protobuf-3.3.0-x86_64-linux.gem does not exist.

As a workaround, it's possible to manually copy the set of platform variants into vendor/cache. But it's a bit of an annoyance since this has to be done each time you update the version of the gem.

@blowmage
Copy link
Contributor

This looks like a Bundler issue to me. Can you suggest any changes we can make to support the behavior you are looking for?

My understanding is that for Bundler to support multiple platforms you need to add the platform using bundle lock, and then to package using the --all-platforms option. But in my tests this doesn't work right, as I'm seeing the same behavior described in rubygems/bundler#5863.

@bkoski
Copy link
Contributor Author

bkoski commented Jul 14, 2017

Thanks for the lead! Did some more tracing and there is a bug/undocumented quirk in bundler 1.15.1 where the --all-platforms flag doesn't work unless the specific_feature feature flag is tripped.

Here's what ended up working for me:

bundle config specific_platform true
bundle lock --add-platform=x86_64-linux
bundle package --all-platforms

This results in a vendor/cache with

google-protobuf-3.3.0-universal-darwin.gem
google-protobuf-3.3.0-x86_64-linux.gem
google-protobuf-3.3.0.gem

which works nicely because the platform-less version will compile at bundle install time on platforms without specific entries in vendor/cache.

@bkoski bkoski closed this as completed Jul 14, 2017
@blowmage
Copy link
Contributor

Glad you figured it out. Thanks for sharing the solution!

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

No branches or pull requests

2 participants