Re-support fat gem #76

Merged
merged 1 commit into from May 5, 2013

Conversation

Projects
None yet
2 participants
Owner

kou commented Mar 21, 2013

Ruby 1.9 bundles RubyGems and it is required automatically before
command line "-r" option. It breaks fake.rb trick. We cannot build fat
gem without fake.rb trick because building fat gem requires two or
more Rubies and fake.rb fakes Rubies.

/tmp/rbconfig.rb:

p :rbconfig

puts caller

module RbConfig
  Config = {}
end

/tmp/fake.rb:

p :fake

Command:

% cd /tmp
% ruby -v -I . -r fake -e ''
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
:rbconfig
/usr/lib/ruby/1.9.1/rubygems.rb:31:in `require'
/usr/lib/ruby/1.9.1/rubygems.rb:31:in `<top (required)>'
<internal:gem_prelude>:1:in `require'
<internal:gem_prelude>:1:in `<compiled>'
:fake

The command output shows fake.rb that is used to change RUBY_PLATFORM,
RUBY_VERSION and so on in rake-compiler is required after
rbconfig.rb. And rbconfig.rb is required from RubyGems.

fake.rb should be required before rbconfig.rb because rbconfig.rb uses
RUBY_VERSION. So this change puts 'require "fake.rb"' into
rbconfig.rb. It ensures that fake.rb is evaluated before rbconfig.rb
body is evaluated.

@kou kou Re-support fat gem
Ruby 1.9 bundles RubyGems and it is required automatically before
command line "-r" option. It breaks fake.rb trick. We cannot build fat
gem without fake.rb trick because building fat gem requires two or
more Rubies and fake.rb fakes Rubies.

/tmp/rbconfig.rb:

    p :rbconfig

    puts caller

    module RbConfig
      Config = {}
    end

/tmp/fake.rb:

    p :fake

Command:

    % cd /tmp
    % ruby -v -I . -r fake -e ''
    ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
    :rbconfig
    /usr/lib/ruby/1.9.1/rubygems.rb:31:in `require'
    /usr/lib/ruby/1.9.1/rubygems.rb:31:in `<top (required)>'
    <internal:gem_prelude>:1:in `require'
    <internal:gem_prelude>:1:in `<compiled>'
    :fake

The command output shows fake.rb that is used to change RUBY_PLATFORM,
RUBY_VERSION and so on in rake-compiler is required after
rbconfig.rb. And rbconfig.rb is required from RubyGems.

fake.rb should be required before rbconfig.rb because rbconfig.rb uses
RUBY_VERSION. So this change puts 'require "fake.rb"' into
rbconfig.rb. It ensures that fake.rb is evaluated before rbconfig.rb
body is evaluated.
60cddaf

@luislavena luislavena added a commit that referenced this pull request May 5, 2013

@luislavena luislavena Merge pull request #76 from kou/re-support-fat-gem
Re-support fat gem
b352ada

@luislavena luislavena merged commit b352ada into rake-compiler:master May 5, 2013

1 check failed

default The Travis build failed
Details

kou deleted the unknown repository branch May 6, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment