-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
When installing a gem that provides precompiled binaries, as for example google-protobuf, RubyGems is installing the MRI binary even though it only works for MRI and not TruffleRuby.
It seems that it should be aware of the Ruby engine being used and not download the compiled gem if the engine used to compile it is not the same as the local engine.
I'm willing to fix the problem but I could not find the place where RubyGems detect if the platform the gem was built is the same as the one it is being installed, so any pointers would be appreciated.
Also, the Gem::Platform object lacks information about the RUBY_ENGINE being used in the local platform and in the spec platform, so I'm not sure if we will need a change to rubygems.org to provide this information on the spec that were already pushed in order to fix this issue.
To reproduce:
Using TruffleRuby do:
$ gem install google-protobuf
Fetching google-protobuf-3.9.2-universal-darwin.gem
Successfully installed google-protobuf-3.9.2-universal-darwin
1 gem installed
You will see the universal-darwin or any OS specific version being installed if your OS is one of the supported by that gem.
I also searched for, but I could not find a way to tell RubyGems to ignore binary gems and always compile the C extensions. Do you know if we have one?
This issue is related to:
- Network problems
- Installing a library
- Publishing a library
- The command line
gem - Other
Here are my current environment details:
$ gem env version
RubyGems Environment:
- RUBYGEMS VERSION: 3.0.3
- RUBY VERSION: 2.6.2 (2019-10-03 patchlevel 0) [x86_64-darwin]
- INSTALLATION DIRECTORY: /Users/rafaelfranca/.gem/truffleruby/2.6.2
- USER INSTALLATION DIRECTORY: /Users/rafaelfranca/.gem/truffleruby/19.3.0-dev-7d425d48
- RUBY EXECUTABLE: /Users/rafaelfranca/src/truffleruby/mxbuild/truffleruby-jvm/jre/languages/ruby/bin/truffleruby
- GIT EXECUTABLE: /opt/dev/bin/user/git
- EXECUTABLE DIRECTORY: /Users/rafaelfranca/.gem/truffleruby/2.6.2/bin
- SPEC CACHE DIRECTORY: /Users/rafaelfranca/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Users/rafaelfranca/src/truffleruby/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin
- GEM PATHS:
- /Users/rafaelfranca/.gem/truffleruby/2.6.2
- /Users/rafaelfranca/src/truffleruby/mxbuild/truffleruby-jvm/jre/languages/ruby/lib/gems
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- "gem" => "--no-doc"
- :benchmark => false
- :sources => ["https://rubygems.org"]
- REMOTE SOURCES:
- https://rubygems.org
- SHELL PATH:
- /Users/rafaelfranca/.gem/truffleruby/2.6.2/bin
- /Users/rafaelfranca/src/truffleruby/mxbuild/truffleruby-jvm/jre/languages/ruby/lib/gems/bin
- /opt/rubies/truffleruby/bin
- /Users/rafaelfranca/.nix-profile/bin
- /Users/rafaelfranca/.yarn/bin
- /opt/dev/bin/user
- /Users/rafaelfranca/.nix-profile/bin
- /Users/rafaelfranca/.rbenv/shims
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /Library/Apple/usr/bin
- /Library/Apple/bin
- /usr/local/MacGPG2/bin
- /opt/X11/bin
I will abide by the code of conduct.