Bug #8432

make install ruby 2.0.0 fails with undefined method `sub!'

Added by Andrew Paterson 11 months ago. Updated 11 months ago.

[ruby-core:55101]
Status:Closed
Priority:Low
Assignee:cruby-linux
Category:build
Target version:-
ruby -v:ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux] Backport:

Description

./tool/rbinstall.rb:468 is trying to reference shebang.sub! on command scripts destined for /usr/local/bin and that's failing.

Steps:
./configure --host="arm-xilinx-linux-gnueabi"
make
make install DESTDIR=../newramdiskmnt
...
ruby --disable=gems -I/export/sata/home/apaterson/Xara/z
ZedBoardLinuxsw/ruby-2.0.0-p0 -rarm-linux-eabi-fake ./tool/rbinstall.rb --make="make" --dest-dir="../newramdiskmnt" --extout=".ext" --mflags="" --make-flags="DESTDIR=../newramdiskmnt" --data-mode=0644 --prog-mode=0755 --installed-list .installed.list --mantype="doc" --install=all --rdoc-output=".ext/rdoc"
installing binary commands: /usr/local/bin
installing base libraries: /usr/local/lib
installing arch files: /usr/local/lib/ruby/2.0.0/arm-linux-eabi
installing pkgconfig data: /usr/local/lib/pkgconfig
installing extension objects: /usr/local/lib/ruby/2.0.0/arm-linux-eabi
installing extension objects: /usr/local/lib/ruby/siteruby/2.0.0/arm-linux-eabi
installing extension objects: /usr/local/lib/ruby/vendor
ruby/2.0.0/arm-linux-eabi
installing extension headers: /usr/local/include/ruby-2.0.0/arm-linux-eabi
installing extension scripts: /usr/local/lib/ruby/2.0.0
installing extension scripts: /usr/local/lib/ruby/siteruby/2.0.0
installing extension scripts: /usr/local/lib/ruby/vendor
ruby/2.0.0
installing extension headers: /usr/local/include/ruby-2.0.0/ruby
installing rdoc: /usr/local/share/ri/2.0.0/system
installing capi-docs: /usr/local/share/doc/ruby
installing command scripts: /usr/local/bin
./tool/rbinstall.rb:468:in block (2 levels) in <main>': undefined methodsub!' for nil:NilClass (NoMethodError)
from ./tool/rbinstall.rb:248:in block in install_recursive'
from ./tool/rbinstall.rb:242:in
each'
from ./tool/rbinstall.rb:242:in install_recursive'
from ./tool/rbinstall.rb:456:in
block in '
from ./tool/rbinstall.rb:758:in call'
from ./tool/rbinstall.rb:758:in
block (2 levels) in '
from ./tool/rbinstall.rb:755:in each'
from ./tool/rbinstall.rb:755:in
block in '
from ./tool/rbinstall.rb:751:in each'
from ./tool/rbinstall.rb:751:in
'
make: *** [do-install-all] Error 1

Associated revisions

Revision 40956
Added by Nobuyoshi Nakada 11 months ago

rbinstall.rb: reject empty files

  • tool/rbinstall.rb (install_recursive): add maxdepth option.
  • tool/rbinstall.rb (bin-comm): limit depth of bindir and reject empty files. [Bug #8432]

History

#1 Updated by Nobuyoshi Nakada 11 months ago

  • Category changed from platform/linux to build
  • Status changed from Open to Feedback

It probably occurs when an empty file exists under bin directory.
Do you have it?

#2 Updated by Andrew Paterson 11 months ago

There are no empty files in the bin directory:

[apaterson@xerxes ruby-2.0.0]$ ls -l bin
total 52
drwxr-xr-x 3 apaterson apaterson 4096 May 22 05:03 ./
drwxr-xr-x 28 apaterson apaterson 12288 May 22 05:47 ../
drwxrwxr-x 2 apaterson apaterson 4096 May 22 05:03 CVS/
-rwxr-xr-x 1 apaterson apaterson 4397 Apr 2 2010 erb*
-rwxr-xr-x 1 apaterson apaterson 546 Mar 7 2011 gem*
-rwxrwxr-x 1 apaterson apaterson 316 May 22 00:43 irb*
-rwxr-xr-x 1 apaterson apaterson 1320 Nov 15 2012 rake*
-rwxr-xr-x 1 apaterson apaterson 938 Nov 26 23:28 rdoc*
-rwxr-xr-x 1 apaterson apaterson 188 Jul 30 2011 ri*
-rwxr-xr-x 1 apaterson apaterson 78 Nov 3 2012 testrb*

#3 Updated by Andrew Paterson 11 months ago

The problem is still present in p195

#4 Updated by Andrew Paterson 11 months ago

It is because there is a zero length file in a subdirectory under bin. There needs to be protection against this in rbinstall.rb

#5 Updated by Nobuyoshi Nakada 11 months ago

AndrewCPaterson (Andrew Paterson) wrote:

drwxrwxr-x 2 apaterson apaterson 4096 May 22 05:03 CVS/

Why is there CVS directory?

#6 Updated by Nobuyoshi Nakada 11 months ago

  • Priority changed from Normal to Low

#7 Updated by Nobuyoshi Nakada 11 months ago

  • Status changed from Feedback to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r40956.
Andrew, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


rbinstall.rb: reject empty files

  • tool/rbinstall.rb (install_recursive): add maxdepth option.
  • tool/rbinstall.rb (bin-comm): limit depth of bindir and reject empty files. [Bug #8432]

Also available in: Atom PDF