Projects

Ticket #90 (closed defect: fixed)

Opened 4 years ago

Last modified 2 years ago

macruby fails to install (problem with File.join)

Reported by: jakub.suder@… Owned by: lsansonetti@…
Priority: blocker Milestone: MacRuby 0.5
Component: MacRuby Keywords:
Cc:

Description

Current trunk version (rev. 305) fails to install on my computer. I'm running OSX 10.5.3, I have version 0.2 installed from the binary package and tried to install the latest version from source. It compiles successfully, but sudo rake install throws such exception:

(in /Users/psionides/Downloads/macruby-trunk2) ./miniruby instruby.rb --make="/usr/bin/make" --dest-dir="" --extout=".ext" --mflags="" --make-flags="" --data-mode=0644 --prog-mode=0755 --installed-list .installed.list --mantype="doc" installing binary commands /Users/psionides/Downloads/macruby-trunk2/lib/fileutils.rb:1259:in `initialize': Is a directory - /Library/Frameworks/MacRuby.framework/Versions/0.3/usr/bin/ (Errno::EPERM::ENOENT::ESRCH::EINTR::EIO::ENXIO::E2BIG::ENOEXEC::EBADF::ECHILD::EAGAIN::ENOMEM::EACCES::EFAULT::ENOTBLK::EBUSY::EEXIST::EXDEV::ENODEV::ENOTDIR::EISDIR::EINVAL::ENFILE::EMFILE::ENOTTY::ETXTBSY::EFBIG::ENOSPC::ESPIPE::EROFS::EMLINK::EPIPE::EDOM::ERANGE::EDEADLK::ENAMETOOLONG::ENOLCK::ENOSYS::ENOTEMPTY::ELOOP::ENOMSG::EIDRM::ENOSTR::ENODATA::ETIME::ENOSR::EREMOTE::ENOLINK::EPROTO::EMULTIHOP::EBADMSG::EOVERFLOW::EILSEQ::EUSERS::ENOTSOCK::EDESTADDRREQ::EMSGSIZE::EPROTOTYPE::ENOPROTOOPT::EPROTONOSUPPORT::ESOCKTNOSUPPORT::EOPNOTSUPP::EPFNOSUPPORT::EAFNOSUPPORT::EADDRINUSE::EADDRNOTAVAIL::ENETDOWN::ENETUNREACH::ENETRESET::ECONNABORTED::ECONNRESET::ENOBUFS::EISCONN::ENOTCONN::ESHUTDOWN::ETOOMANYREFS::ETIMEDOUT::ECONNREFUSED::EHOSTDOWN::EHOSTUNREACH::EALREADY::EINPROGRESS::ESTALE::EDQUOT::NOERROR)

from /Users/psionides/Downloads/macruby-trunk2/lib/fileutils.rb:1259:in `open' from /Users/psionides/Downloads/macruby-trunk2/lib/fileutils.rb:1259:in `block in copy_file' from /Users/psionides/Downloads/macruby-trunk2/lib/fileutils.rb:1258:in `open' from /Users/psionides/Downloads/macruby-trunk2/lib/fileutils.rb:1258:in `copy_file' from /Users/psionides/Downloads/macruby-trunk2/lib/fileutils.rb:462:in `copy_file' from /Users/psionides/Downloads/macruby-trunk2/lib/fileutils.rb:838:in `block in install' from /Users/psionides/Downloads/macruby-trunk2/lib/fileutils.rb:1392:in `block in fu_each_src_dest' from /Users/psionides/Downloads/macruby-trunk2/lib/fileutils.rb:1406:in `fu_each_src_dest0' from /Users/psionides/Downloads/macruby-trunk2/lib/fileutils.rb:1390:in `fu_each_src_dest' from /Users/psionides/Downloads/macruby-trunk2/lib/fileutils.rb:834:in `install' from instruby.rb:133:in `install' from instruby.rb:233:in `block in <main>' from instruby.rb:412:in `call' from instruby.rb:412:in `block (2 levels) in <main>' from instruby.rb:409:in `each' from instruby.rb:409:in `block in <main>' from instruby.rb:405:in `each' from instruby.rb:405:in `<main>'

rake aborted!

I've investigated this error, and it seems that the call "File.join(dest, File.basename(src))" in fu_each_src_dest0 function in fileutils.rb doesn't always return what it should. In this case src = 'macruby', dest = '/Library/Frameworks/MacRuby.framework/Versions/0.3/usr/bin/', but the result is '/Library/Frameworks/MacRuby.framework/Versions/0.3/usr/bin/' instead of '/Library/Frameworks/MacRuby.framework/Versions/0.3/usr/bin/macruby'. I ended up in the code of rb_file_join function in file.c, where strings are concatenated using CFStringAppend, but in this case CFStringAppend only appends the first string (.../usr/bin), and appending another (macruby) doesn't work, I don't know why.

I found that this area of code was modified in changesets 213 and 214, and when I reverted those changes, the installation passed that point at which it previously failed (although it still failed later on another path).

That's all I was able to figure out, I hope this helps...

Change History

Changed 4 years ago by jakub.suder@…

the exception in a slightly more readable form:

/Users/psionides/Downloads/macruby-trunk2/lib/fileutils.rb:1259:in `initialize': Is a directory - /Library/Frameworks/MacRuby.framework/Versions/0.3/usr/bin/
(Errno::EPERM::ENOENT::ESRCH::EINTR::EIO::ENXIO::E2BIG::ENOEXEC::EBADF::ECHILD::EAGAIN::ENOMEM::EACCES::EFAULT::ENOTBLK::EBUSY::EEXIST::EXDEV::ENODEV::ENOTDIR::EISDIR::EINVAL::ENFILE::EMFILE::ENOTTY::ETXTBSY::EFBIG::ENOSPC::ESPIPE::EROFS::EMLINK::EPIPE::EDOM::ERANGE::EDEADLK::ENAMETOOLONG::ENOLCK::ENOSYS::ENOTEMPTY::ELOOP::ENOMSG::EIDRM::ENOSTR::ENODATA::ETIME::ENOSR::EREMOTE::ENOLINK::EPROTO::EMULTIHOP::EBADMSG::EOVERFLOW::EILSEQ::EUSERS::ENOTSOCK::EDESTADDRREQ::EMSGSIZE::EPROTOTYPE::ENOPROTOOPT::EPROTONOSUPPORT::ESOCKTNOSUPPORT::EOPNOTSUPP::EPFNOSUPPORT::EAFNOSUPPORT::EADDRINUSE::EADDRNOTAVAIL::ENETDOWN::ENETUNREACH::ENETRESET::ECONNABORTED::ECONNRESET::ENOBUFS::EISCONN::ENOTCONN::ESHUTDOWN::ETOOMANYREFS::ETIMEDOUT::ECONNREFUSED::EHOSTDOWN::EHOSTUNREACH::EALREADY::EINPROGRESS::ESTALE::EDQUOT::NOERROR)

from /Users/psionides/Downloads/macruby-trunk2/lib/fileutils.rb:1259:in `open'
from /Users/psionides/Downloads/macruby-trunk2/lib/fileutils.rb:1259:in `block in copy_file'
from /Users/psionides/Downloads/macruby-trunk2/lib/fileutils.rb:1258:in `open'
from /Users/psionides/Downloads/macruby-trunk2/lib/fileutils.rb:1258:in `copy_file'
from /Users/psionides/Downloads/macruby-trunk2/lib/fileutils.rb:462:in `copy_file'
from /Users/psionides/Downloads/macruby-trunk2/lib/fileutils.rb:838:in `block in install'
from /Users/psionides/Downloads/macruby-trunk2/lib/fileutils.rb:1392:in `block in fu_each_src_dest'
from /Users/psionides/Downloads/macruby-trunk2/lib/fileutils.rb:1406:in `fu_each_src_dest0'
from /Users/psionides/Downloads/macruby-trunk2/lib/fileutils.rb:1390:in `fu_each_src_dest'
from /Users/psionides/Downloads/macruby-trunk2/lib/fileutils.rb:834:in `install'
from instruby.rb:133:in `install'
from instruby.rb:233:in `block in <main>'
from instruby.rb:412:in `call'
from instruby.rb:412:in `block (2 levels) in <main>'
from instruby.rb:409:in `each'
from instruby.rb:409:in `block in <main>'
from instruby.rb:405:in `each'
from instruby.rb:405:in `<main>'

Changed 4 years ago by lsansonetti@…

  • milestone set to MacRuby 0.3

Probably a bytestring problem.

Changed 3 years ago by lsansonetti@…

  • milestone changed from MacRuby 0.3 to MacRuby 1.0

Really not able to reproduce this. Maybe the bug was fixed indirectly.

Jakub, can you try to install trunk and see if you can still reproduce it?

Changed 3 years ago by jakub.suder@…

I've tried this now, and both 0.3 and trunk fail with the same error (although a bit different than the one above):

Adria:MacRuby-0.3 psionides$ sudo rake install
Password:
(in /Users/psionides/Downloads/MacRuby-0.3)
./miniruby instruby.rb --make="/usr/bin/make" --dest-dir="" --extout=".ext" --mflags="" --make-flags="" --data-mode=0644 --prog-mode=0755 --installed-list .installed.list --mantype="doc"
installing binary commands
/Users/psionides/Downloads/MacRuby-0.3/lib/fileutils.rb:787:in `size': No such file or directory - macruby? (Errno::ENOENT)

from /Users/psionides/Downloads/MacRuby-0.3/lib/fileutils.rb:787:in `compare_file'
from /Users/psionides/Downloads/MacRuby-0.3/lib/fileutils.rb:835:in `block in install'
from /Users/psionides/Downloads/MacRuby-0.3/lib/fileutils.rb:1392:in `block in fu_each_src_dest'
from /Users/psionides/Downloads/MacRuby-0.3/lib/fileutils.rb:1406:in `fu_each_src_dest0'
from /Users/psionides/Downloads/MacRuby-0.3/lib/fileutils.rb:1390:in `fu_each_src_dest'
from /Users/psionides/Downloads/MacRuby-0.3/lib/fileutils.rb:834:in `install'
from instruby.rb:133:in `install'
from instruby.rb:235:in `block in <main>'
from instruby.rb:428:in `call'
from instruby.rb:428:in `block (2 levels) in <main>'
from instruby.rb:425:in `each'
from instruby.rb:425:in `block in <main>'
from instruby.rb:421:in `each'
from instruby.rb:421:in `<main>'

rake aborted!
Command failed with status (1): instruby.rb --make="/usr/bin/ma...
/Users/psionides/Downloads/MacRuby-0.3/rakefile:560
(See full trace by running task with --trace)

---

("testing" branch, on the other hand, doesn't even compile, and throws a lot of errors like "error: dereferencing pointer to incomplete type" or "{standard input}:2028:non-relocatable subtraction expression, "_eASN1Error" minus "L00000000026$pb"" while compiling openssl module)

Changed 3 years ago by anonymous

  • milestone MacRuby 1.0 deleted

Milestone MacRuby 1.0 deleted

Changed 2 years ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to MacRuby 0.5

This should probably be fixed now.

Note: See TracTickets for help on using tickets.