Project

General

Profile

Actions

Bug #10822

closed

make-snapshot breaks during download of bundled gems

Added by vo.x (Vit Ondruch) over 9 years ago. Updated over 9 years ago.

Status:
Third Party's Issue
Assignee:
-
Target version:
-
ruby -v:
ruby-2.3.0-r49483
[ruby-core:67977]

Description

... snip ...

downloading config.sub ... done
Downloading bundled gem files...
/usr/share/rubygems/rubygems/defaults/operating_system.rb:9:in `previous_but_one_dir_to': undefined method `split' for nil:NilClass (NoMethodError)
	from /usr/share/rubygems/rubygems/defaults/operating_system.rb:30:in `default_locations'
	from /usr/share/rubygems/rubygems/defaults/operating_system.rb:47:in `default_dirs'
	from /usr/share/rubygems/rubygems/defaults/operating_system.rb:70:in `default_dir'
	from /usr/share/rubygems/rubygems/basic_specification.rb:33:in `default_specifications_dir'
	from /usr/share/rubygems/rubygems/specification.rb:770:in `load_defaults'
	from /usr/share/rubygems/rubygems.rb:1239:in `<top (required)>'
	from /tmp/ruby-snapshot20150203-18908-5qkpah/ruby-2.3.0-r49483/tool/downloader.rb:41:in `require'
	from /tmp/ruby-snapshot20150203-18908-5qkpah/ruby-2.3.0-r49483/tool/downloader.rb:41:in `download'
	from -e:4:in `<main>'
/tmp/GmEfPzNs:1423: recipe for target 'update-gems' failed
make: *** [update-gems] Error 1
prerequisites failed

This is due to Ruby picking up rbconfig.rb from the current checkout, since $(RUNRUBY) adds the current directory on the load path [1]. I don't think this is right in this case.

You can reproduce this issue with Fedora's operating_system.rb [2].

[1] https://github.com/ruby/ruby/blob/trunk/common.mk#L920
[2] http://pkgs.fedoraproject.org/cgit/ruby.git/tree/operating_system.rb

Updated by vo.x (Vit Ondruch) over 9 years ago

I fixed the Fedora's side. If you want to reproduce, the original operating system_rb is still available here:

http://pkgs.fedoraproject.org/cgit/ruby.git/tree/operating_system.rb?id=76bbf0976dbb90eb22dc6590cee81462844d4e24

Updated by nobu (Nobuyoshi Nakada) over 9 years ago

  • Status changed from Open to Third Party's Issue

Vit Ondruch wrote:

This is due to Ruby picking up rbconfig.rb from the current checkout, since $(RUNRUBY) adds the current directory on the load path [1]. I don't think this is right in this case.

It is right, the built rbconfig.rb must be loaded, not already installed one.
Why is RbConfig::CONFIG['vendordir'] nil?

Updated by vo.x (Vit Ondruch) over 9 years ago

Nobuyoshi Nakada wrote:

It is right, the built rbconfig.rb must be loaded, not already installed one.
Why is RbConfig::CONFIG['vendordir'] nil?

Because this is the rbconfig.rb file which is picked up from the checkout directory?

# cat '/tmp/ruby-snapshot20150204-19701-jaoxi6/ruby-2.3.0-r49494/rbconfig.rb' 

# This file was created by mkconfig.rb when ruby was built.  Any
# changes made to this file will be lost the next time ruby is built.

module RbConfig
  RUBY_VERSION == "2.2.0" or
    raise "ruby lib version (2.2.0) doesn't match executable version (#{RUBY_VERSION})"

  TOPDIR = File.dirname(__FILE__).chomp!("")
  DESTDIR = '' unless defined? DESTDIR
  CONFIG = {}
  CONFIG["DESTDIR"] = DESTDIR
  CONFIG["MAJOR"] = "2"
  CONFIG["MINOR"] = "3"
  CONFIG["TEENY"] = "0"
  CONFIG["PATCHLEVEL"] = "-1"
  CONFIG["ruby_install_name"] = ""
  CONFIG["EXEEXT"] = ""
  CONFIG["ruby_install_name"] = ""
  CONFIG["RUBY_INSTALL_NAME"] = ""
  CONFIG["RUBY_SO_NAME"] = ""
  CONFIG["configure_args"] = ""
  CONFIG["EXTOUT"] = "tmp"
  CONFIG["bindir"] = "$(DESTDIR)"
  CONFIG["ARCH_FLAG"] = ""
  CONFIG["CFLAGS"] = ""
  CONFIG["CPPFLAGS"] = ""
  CONFIG["CXXFLAGS"] = ""
  CONFIG["LDFLAGS"] = ""
  CONFIG["DLDFLAGS"] = ""
  CONFIG["LIBEXT"] = "a"
  CONFIG["OBJEXT"] = "o"
  CONFIG["LIBRUBY"] = "libruby.a"
  CONFIG["LIBRUBY_A"] = "libruby.a"
  CONFIG["RM"] = "rm -f"
  CONFIG["CP"] = "cp"
  CONFIG["rubyarchdir"] = "$(DESTDIR)"
  CONFIG["rubylibprefix"] = ""
  CONFIG["ruby_version"] = ""
  CONFIG["archdir"] = "$(rubyarchdir)"
  CONFIG["topdir"] = File.dirname(__FILE__)
  MAKEFILE_CONFIG = {}
  CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}
  def RbConfig::expand(val, config = CONFIG)
    newval = val.gsub(/\$\$|\$\(([^()]+)\)|\$\{([^{}]+)\}/) {
      var = $&
      if !(v = $1 || $2)
	'$'
      elsif key = config[v = v[/\A[^:]+(?=(?::(.*?)=(.*))?\z)/]]
	pat, sub = $1, $2
	config[v] = false
	config[v] = RbConfig::expand(key, config)
	key = key.gsub(/#{Regexp.quote(pat)}(?=\s|\z)/n) {sub} if pat
	key
      else
	var
      end
    }
    val.replace(newval) unless newval == val
    val
  end
  CONFIG.each_value do |val|
    RbConfig::expand(val)
  end

  # returns the absolute pathname of the ruby command.
  def RbConfig.ruby
    File.join(
      RbConfig::CONFIG["bindir"],
      RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"]
    )
  end
end
CROSS_COMPILING = nil unless defined? CROSS_COMPILING

and this is content of config.status, which is I believe used by mkconfig.rb to produce rbconfig.rb:

# cat /tmp/ruby-snapshot20150204-19701-jaoxi6/ruby-2.3.0-r49494/config.status
s,@configure_args@,|#_!!_#|,g
s,@EXTOUT@,|#_!!_#|tmp,g
s,@bindir@,|#_!!_#|,g
s,@ruby_install_name@,|#_!!_#|,g
s,@ARCH_FLAG@,|#_!!_#|,g
s,@CFLAGS@,|#_!!_#|,g
s,@CPPFLAGS@,|#_!!_#|,g
s,@CXXFLAGS@,|#_!!_#|,g
s,@LDFLAGS@,|#_!!_#|,g
s,@DLDFLAGS@,|#_!!_#|,g
s,@LIBEXT@,|#_!!_#|a,g
s,@OBJEXT@,|#_!!_#|o,g
s,@EXEEXT@,|#_!!_#|,g
s,@LIBRUBY@,|#_!!_#|libruby.a,g
s,@LIBRUBY_A@,|#_!!_#|libruby.a,g
s,@RM@,|#_!!_#|rm -f,g
s,@CP@,|#_!!_#|cp,g
s,@rubyarchdir@,|#_!!_#|,g
s,@rubylibprefix@,|#_!!_#|,g
s,@ruby_version@,|#_!!_#|,g

There is nothing to take the information from.

Please note that I am running the make-snapshot in fresh checkout if and it is doing its own export from SVN if I am not mistaken.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0