-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
compiled extensions go to wrong directory when using gem install #9998
Comments
Haven't seen this before. What's the command, ruby version, and ruby platform? |
The error happens as soon as you do a ruby version: grpc installed using This is on raspbian jessie, we have tried on a pi2 pi3 and scaleway's arm servers. |
What I don't understand is why this only breaks on our ARM build. What @twk3 writes sounds like a |
The contents of data.tar.gz in https://rubygems.org/gems/grpc/versions/1.1.2-x86_64-linux and https://rubygems.org/gems/grpc/versions/1.1.2 (platform ruby) are identical except for the following files not included in platform ruby:
|
It looks like when the gem is build and packaged using rake, rake-compiler hardcodes using the lib directory: https://github.com/rake-compiler/rake-compiler/blob/master/lib/rake/baseextensiontask.rb#L42 But when building using rubygems, (as a result of a gem install) rubygems uses the first require path as the lib directory. |
I am able to reproduce the problem on ubuntu 16.04 with:
The last command errors out with LoadError. |
Putting |
Using the steps in #9998 (comment) I also reproduced this on grpc 1.0.0. |
@apolcyn this looks like the general case you were concerned may exist when looking into #9861. I ran into this today when testing 1.2.0.pre1 gem. It would be nice to see the fix required in 1.2.0 release on 3/20 and cherry-picked into 1.1.x for anyone not able to update to 1.2.x immediately after release. |
It seems the fix made it into 1.2.2. Yay! https://github.com/grpc/grpc/blob/v1.2.2/grpc.gemspec |
If you are installing the gem using bundle install or gem install, and need to compile the native extensions (arm for example), the extensions will compile, but will be placed in
src/ruby/bin/grpc/grpc_c.so
instead ofsrc/ruby/lib/grpc/grpc_c.so
which results in the following error when you use the gem:
This happens because rubygems uses the first require_path as one of the extension destinations: https://github.com/rubygems/rubygems/blob/af3c7bed24106cb86ad56210fcb90696d00c31d5/lib/rubygems/ext/builder.rb#L155
And in this gem, the bin directory is first:
https://github.com/grpc/grpc/blob/v1.1.2/grpc.gemspec#L27
The text was updated successfully, but these errors were encountered: