Bugs item #10657, was opened at 2007-05-07 12:09
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=10657&group_id=426

Category: Core
Group: 1.9.x
Status: Open
Resolution: None
Priority: 3
Submitted By: Paul Brannan (cout)
Assigned to: Nobody (None)
Summary: unable to build ruby HEAD without previously installed ruby

Initial Comment:
First, I set my PATH so that ruby is not in my path:

$ export PATH=/usr/bin:/usr/X11R6/bin:/bin
$ ruby -v
-bash: ruby: command not found

Next, I attempt to build ruby:

$ autoconf
$ ./configure
$ make clean
$ make

And I see this:

rm -f ruby
ruby ./tool/insns2vm.rb --srcdir="."
/bin/sh: line 1: ruby: command not found
make: *** [insns.inc] Error 127

There are a few problems with this:

1. Ruby is not built yet, though the tool needs to be run in order to build ruby.
2. The rule that generates insns.def and vm_opts.h removes the existing ruby interpreter, when the existing interpreter is in no way related to the output files.
3. The rule attempts to run a previously installed ruby (it searches the PATH), rather than the one about to be built, but there is no guarantee ruby has previously been installed.
4. If ruby has previously been installed, the rule attempts to run $(BASERUBY), which is not necessarily the name of the previously installed binary (it is more likely to be $(PROGRAM) rather than $(BASERUBY)).

Proposed solution:

1. Store insns.def and vm_opts.h in svn.
2. When building ruby, use the previously generated files.
3. After ruby is built, re-generate the files using the ruby interpreter that was just built.  If the new files are different, rebuild the ruby binary using the new files.



----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=10657&group_id=426