Package: rake
Version: 0.9.2.2-4
Severity: normal

Hello,

I tried building a new version of ruby extension because the one in
debian is broken.

The extension is found here: https://github.com/larskanis/opengl.git

AFAICT it has no reference to local:

~/opengl $ git grep local
examples/RedBook/dof.rb:  local_view = [ 0.0 ]
examples/RedBook/dof.rb:  glLightModel(GL_LIGHT_MODEL_LOCAL_VIEWER, local_view)
examples/RedBook/fog.rb:  local_view = [0.0]
examples/RedBook/fog.rb:  glLightModel(GL_LIGHT_MODEL_LOCAL_VIEWER, local_view)
examples/RedBook/material.rb:  local_view = [ 0.0 ]
examples/RedBook/material.rb:  glLightModel(GL_LIGHT_MODEL_LOCAL_VIEWER, 
local_view)
examples/RedBook/teapots.rb:  local_view = [0.0]
examples/RedBook/teapots.rb:  glLightModel(GL_LIGHT_MODEL_LOCAL_VIEWER, 
local_view)
examples/misc/plane.rb:# *  This program demonstrates the use of local versus
examples/misc/plane.rb:    local_light = [ 1.0, 1.0, 1.0, 1.0 ];
examples/misc/plane.rb:    Gl.glLight(Gl::GL_LIGHT0, Gl::GL_POSITION, 
local_light);

but rake tries to run /usr/local/bin/rdoc1.9.1

AFAICT it only includes files from Debian installed locations and is not
contaminated by some code I would have laying around (including Q175 to
print loaded files):
~/opengl $ ruby1.9.1 -I ~/camp -rq175 /usr/bin/rake newb
/home/hramrach/camp/q175.rb:58: Use RbConfig instead of obsolete and
deprecated Config.
require: rake/version => /usr/lib/ruby/vendor_ruby/rake/version.rb
require: fileutils => /usr/lib/ruby/1.9.1/fileutils.rb
require: singleton => /usr/lib/ruby/1.9.1/singleton.rb
require: monitor => /usr/lib/ruby/1.9.1/monitor.rb
require: optparse => /usr/lib/ruby/1.9.1/optparse.rb
require: ostruct => /usr/lib/ruby/1.9.1/ostruct.rb
require: rake/ext/core => /usr/lib/ruby/vendor_ruby/rake/ext/core.rb
require: rake/invocation_exception_mixin => 
/usr/lib/ruby/vendor_ruby/rake/invocation_exception_mixin.rb
require: rake/task => /usr/lib/ruby/vendor_ruby/rake/task.rb
require: rake/early_time => /usr/lib/ruby/vendor_ruby/rake/early_time.rb
require: rake/file_task => /usr/lib/ruby/vendor_ruby/rake/file_task.rb
require: rake/file_creation_task => 
/usr/lib/ruby/vendor_ruby/rake/file_creation_task.rb
require: shellwords => /usr/lib/ruby/1.9.1/shellwords.rb
require: rake/task_manager => /usr/lib/ruby/vendor_ruby/rake/task_manager.rb
require: rake/alt_system => /usr/lib/ruby/vendor_ruby/rake/alt_system.rb
require: rake/win32 => /usr/lib/ruby/vendor_ruby/rake/win32.rb
require: rake/application => /usr/lib/ruby/vendor_ruby/rake/application.rb
require: rake/ext/module => /usr/lib/ruby/vendor_ruby/rake/ext/module.rb
require: rake/ext/string => /usr/lib/ruby/vendor_ruby/rake/ext/string.rb
require: rake/ext/time => /usr/lib/ruby/vendor_ruby/rake/ext/time.rb
require: rake/task_argument_error => 
/usr/lib/ruby/vendor_ruby/rake/task_argument_error.rb
require: rake/rule_recursion_overflow_error => 
/usr/lib/ruby/vendor_ruby/rake/rule_recursion_overflow_error.rb
require: rake/rake_module => /usr/lib/ruby/vendor_ruby/rake/rake_module.rb
require: rake/pseudo_status => /usr/lib/ruby/vendor_ruby/rake/pseudo_status.rb
require: rake/task_arguments => /usr/lib/ruby/vendor_ruby/rake/task_arguments.rb
require: rake/invocation_chain => 
/usr/lib/ruby/vendor_ruby/rake/invocation_chain.rb
require: rake/multi_task => /usr/lib/ruby/vendor_ruby/rake/multi_task.rb
require: rake/file_utils => /usr/lib/ruby/vendor_ruby/rake/file_utils.rb
require: rake/file_utils_ext => /usr/lib/ruby/vendor_ruby/rake/file_utils_ext.rb
require: rake/dsl_definition => /usr/lib/ruby/vendor_ruby/rake/dsl_definition.rb
require: rake/cloneable => /usr/lib/ruby/vendor_ruby/rake/cloneable.rb
require: rake/pathmap => /usr/lib/ruby/vendor_ruby/rake/pathmap.rb
require: rake/file_list => /usr/lib/ruby/vendor_ruby/rake/file_list.rb
require: rake/default_loader => /usr/lib/ruby/vendor_ruby/rake/default_loader.rb
require: rake/name_space => /usr/lib/ruby/vendor_ruby/rake/name_space.rb
require: rake => /usr/lib/ruby/vendor_ruby/rake.rb
require: rake/tasklib => /usr/lib/ruby/vendor_ruby/rake/tasklib.rb
require: rake/testtask => /usr/lib/ruby/vendor_ruby/rake/testtask.rb
require: psych => /usr/lib/ruby/1.9.1/psych.rb
require: yaml => /usr/lib/ruby/1.9.1/yaml.rb
require: hoe/rake => /usr/lib/ruby/vendor_ruby/hoe/rake.rb
require: hoe => /usr/lib/ruby/vendor_ruby/hoe.rb
require: rake/clean => /usr/lib/ruby/vendor_ruby/rake/clean.rb
require: pathname => /usr/lib/ruby/1.9.1/pathname.rb
require: rake/baseextensiontask => 
/usr/lib/ruby/vendor_ruby/rake/baseextensiontask.rb
require: rubygems/package_task => /usr/lib/ruby/1.9.1/rubygems/package_task.rb
require: rake/extensiontask => /usr/lib/ruby/vendor_ruby/rake/extensiontask.rb
require: /usr/lib/ruby/vendor_ruby/hoe/clean.rb => 
/usr/lib/ruby/vendor_ruby/hoe/clean.rb
require: rubygems/remote_fetcher => 
/usr/lib/ruby/1.9.1/rubygems/remote_fetcher.rb
require: /usr/lib/ruby/vendor_ruby/hoe/deps.rb => 
/usr/lib/ruby/vendor_ruby/hoe/deps.rb
require: /usr/lib/ruby/vendor_ruby/hoe/debug.rb => 
/usr/lib/ruby/vendor_ruby/hoe/debug.rb
require: /usr/lib/ruby/vendor_ruby/hoe/test.rb => 
/usr/lib/ruby/vendor_ruby/hoe/test.rb
require: /usr/lib/ruby/vendor_ruby/hoe/flay.rb => 
/usr/lib/ruby/vendor_ruby/hoe/flay.rb
require: /usr/lib/ruby/vendor_ruby/hoe/package.rb => 
/usr/lib/ruby/vendor_ruby/hoe/package.rb
require: /usr/lib/ruby/vendor_ruby/hoe/gemcutter.rb => 
/usr/lib/ruby/vendor_ruby/hoe/gemcutter.rb
require: /usr/lib/ruby/vendor_ruby/hoe/flog.rb => 
/usr/lib/ruby/vendor_ruby/hoe/flog.rb
require: /usr/lib/ruby/vendor_ruby/hoe/newb.rb => 
/usr/lib/ruby/vendor_ruby/hoe/newb.rb
require: /usr/lib/ruby/vendor_ruby/hoe/publish.rb => 
/usr/lib/ruby/vendor_ruby/hoe/publish.rb
require: /usr/lib/ruby/vendor_ruby/hoe/signing.rb => 
/usr/lib/ruby/vendor_ruby/hoe/signing.rb
require: time => /usr/lib/ruby/1.9.1/time.rb
load: /home/hramrach/opengl/Rakefile => /home/hramrach/opengl/Rakefile
sudo gem1.9.1 install rake-compiler --version ~> 0.7 --no-rdoc --no-ri
sudo gem1.9.1 install rdoc --version ~> 3.10 --no-rdoc --no-ri
sudo gem1.9.1 install glu --version ~> 8.1 --no-rdoc --no-ri
sudo gem1.9.1 install glut --version ~> 8.1 --no-rdoc --no-ri
rm -rf doc
/usr/local/bin/rdoc1.9.1 --title opengl-0.9.0 Documentation -o doc
--main README.rdoc lib History.rdoc Manifest.txt README.rdoc
examples/OrangeBook/3Dlabs-License.txt README.rdoc History.rdoc
rake aborted!
Command failed with status (127): [/usr/local/bin/rdoc1.9.1 --title
opengl-0....]

Tasks: TOP => newb => docs
(See full trace by running task with --trace)


How did it figure out to run the non-existent /usr/local/bin/rdoc1.9.1?

Thanks

Michal


-- System Information:
Debian Release: 7.6
  APT prefers stable
  APT policy: (990, 'stable'), (171, 'unstable'), (151, 'experimental'), (121, 
'precise-updates'), (121, 'precise-security'), (121, 'precise'), (101, 
'stable'), (101, 'oldstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.11-trunk-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages rake depends on:
ii  ruby                          1:1.9.3
ii  ruby1.8 [ruby-interpreter]    1.8.7.358-7.1+deb7u1
ii  ruby1.9.1 [ruby-interpreter]  1.9.3.194-8.1+deb7u2
ii  ruby2.1 [ruby-interpreter]    2.1.2-4

Versions of packages rake recommends:
ii  zip  3.0-6

rake suggests no packages.

-- no debconf information
unless Kernel.constants.include? "Q175"

require 'rbconfig'

module Kernel

  module Q175

    def self.get_exts
      exts = ["rb", Config::CONFIG["DLEXT"], Config::CONFIG["DLEXT2"]]
      exts.pop unless exts[-1].length > 0
      exts
    end

    def self.dir_separator? num
      num == File::SEPARATOR[0] ||
        ( File::ALT_SEPARATOR && num == File::ALT_SEPARATOR[0])
    end

    def self.dot? num
      num == "."[0]
    end

    def self.path_absolute? path
      (dir_separator? path[0]) || 
        ( (dot? path[0]) && (dir_separator? path[1]) )
    end

    def self.scan_single file
      if path_absolute? file
        return file if File.exists? file
      else
        $:.each{|path| abs = path + File::Separator + file ; return abs if File.exists? abs}
      end
      nil
    end

    def self.scan file
      exts = get_exts
      if exts.map{|e| Regexp.new "\\.#{e}\\Z"}.inject(false){|v,re| v || (file =~ re)} 
        files = [file]
      else
        files = exts.map{|e| "#{file}.#{e}"}
      end
      files.each{|f| 
        s = scan_single f
        return s if s
      }
      nil
    end

    def self.stdlib?
      Kernel::caller(2)[0] =~ Q175::Stdlib
    end

    Load = Kernel.instance_method :load
    Require = Kernel.instance_method :require
    Stdlib = Regexp.new "^#{Config::CONFIG['rubylibdir']}"

  end

  undef_method :load
  def load file, wrap=false
    loc = Q175::scan_single file
    res = Q175::Load.bind(self).call file, wrap
    STDERR.puts "load: #{file} => #{loc}" if res && loc && ! Q175::stdlib?
    res
  end

  undef_method :require
  def require file
    loc = Q175::scan file
    res = Q175::Require.bind(self).call file
    STDERR.puts "require: #{file} => #{loc}" if res && loc && ! Q175::stdlib?
    res
  end

end

end

if $0 == __FILE__
  ARGV.each{|name| puts "require: #{name} => #{Kernel::Q175::scan name}" }
end

Reply via email to