Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Fix rubygems 2.2+ compatibility #3582

Merged
merged 5 commits into from
Apr 21, 2015

Conversation

voxik
Copy link
Contributor

@voxik voxik commented Apr 20, 2015

This is follow up of #3237 including the fix to the last test failure on Ruby 1.8.7 and RubyGems 2.2.2.

RubyGems since version 2.2 allows to reconfigure place, where binary
extensions are stored. This might allow easier sharing of gems between
various Ruby interpreters. It can be enabled by redefining
Gem.default_ext_dir_for method.

This patch is adding support for this feature into Bundler.
The bang variant returns nil in case there was no change needed.
We don't care about extensions, just about directories. The missing
extensions might try to triger rebuild, which fails with "uninitialized
constant Gem::UserInteraction" under some versions of RubyGems.
@indirect
Copy link
Member

Maybe I'm slow, but I'm still not sure what this is fixing. Can you explain why this is needed, now that RubyGems correctly loads .rb and .so files again?

@voxik
Copy link
Contributor Author

voxik commented Apr 21, 2015

The original explanation is in #3234:

RubyGems allows since version 2.2 to reconfigure place, where binary
extensions are stored. This might allow easier sharing of gems between
various Ruby interpreters. It can be enabled by redefining
Gem.default_ext_dir_for method.

And we are using this feature in Fedora [1]. The attached test case simulates this by the s.extension_dir = '#{ext_dir}' line.

To be precise, it is not about loading, the .rb and .so files are correctly loaded, but the $LOAD_PATH might not be cleaned correctly. This patch set narrows it by using RubyGems facilities.

http://pkgs.fedoraproject.org/cgit/ruby.git/tree/operating_system.rb#n103

@voxik
Copy link
Contributor Author

voxik commented Apr 21, 2015

Just to give you example, you probably assume that this is the directory structure of RubyGems:

/usr/local/ruby/2.2.1/extensions
/usr/local/ruby/2.2.1/gems

while it can be

/usr/lib64/gems/ruby/
/usr/ruby/gems/gems/

i.e. they don't have common prefix as the current code expects.

@indirect
Copy link
Member

Got it. I understand now, thank you for explaining. And thank you for the patch!

indirect added a commit that referenced this pull request Apr 21, 2015
@indirect indirect merged commit 0ad473a into rubygems:master Apr 21, 2015
@voxik
Copy link
Contributor Author

voxik commented Apr 22, 2015

Thanks!

@coilysiren coilysiren modified the milestone: Release Archive Oct 9, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants