Install problems under QNX

M

Martin Gagnon

Hi all,
I'm facing install problems under QNX 6.3.0. [QNX QNX-DEV 6.3.0
2004/04/29-21:23:19UTC x86pc x86]
The compile works well and the 'make test' succeeds. So that's a good
start.
However, during 'make install', I get the following error:

Ruby 1.8.5:
---------------------
...
install -c -p -m 0755 bin/rdoc /usr/local/bin/rdoc
/instruby.rb:174:in `truncate': File too large - /usr/local/bin/rdoc
(Errno::EFBIG)
from ./instruby.rb:174
from ./instruby.rb:167:in `open'
from ./instruby.rb:167
from ./instruby.rb:154:in `each'
from ./instruby.rb:154
from ./instruby.rb:64:in `install?'
from ./instruby.rb:149
make: *** [do-install-local] Error 1
---------------------
Hum... it's not even that big:
/home/martin/ruby-1.8.5# ls -l /usr/local/bin/rdoc
-rwxr-xr-x 1 root root 1541 Apr 04 19:51
/usr/local/bin/rdoc

Ruby 1.8.6:
---------------------
...
/instruby.rb:259:in `truncate': File too large - /usr/local/bin/testrb
(Errno::EFBIG)
from ./instruby.rb:259
from ./instruby.rb:142:in `open'
from ./instruby.rb:142:in `open_for_install'
from ./instruby.rb:252
from ./instruby.rb:239:in `each'
from ./instruby.rb:239
from ./instruby.rb:348:in `call'
from ./instruby.rb:348
from ./instruby.rb:345:in `each'
from ./instruby.rb:345
from ./instruby.rb:344:in `each'
from ./instruby.rb:344
make: *** [do-install-nodoc] Error 1
---------------------

So what does this really mean?
Any clue/suggestion are welcome.
My final goal is to run a Rails app on QNX.

Thank you,
Martin
 
D

Daniel Berger

Hi all,
I'm facing install problems under QNX 6.3.0. [QNX QNX-DEV 6.3.0
2004/04/29-21:23:19UTC x86pc x86]
The compile works well and the 'make test' succeeds. So that's a good
start.
However, during 'make install', I get the following error:

Ruby 1.8.5:
---------------------
..
install -c -p -m 0755 bin/rdoc /usr/local/bin/rdoc
/instruby.rb:174:in `truncate': File too large - /usr/local/bin/rdoc
(Errno::EFBIG)
from ./instruby.rb:174
from ./instruby.rb:167:in `open'
from ./instruby.rb:167
from ./instruby.rb:154:in `each'
from ./instruby.rb:154
from ./instruby.rb:64:in `install?'
from ./instruby.rb:149
make: *** [do-install-local] Error 1
---------------------
Hum... it's not even that big:
/home/martin/ruby-1.8.5# ls -l /usr/local/bin/rdoc
-rwxr-xr-x 1 root root 1541 Apr 04 19:51
/usr/local/bin/rdoc

Ruby 1.8.6:
---------------------
..
/instruby.rb:259:in `truncate': File too large - /usr/local/bin/testrb
(Errno::EFBIG)
from ./instruby.rb:259
from ./instruby.rb:142:in `open'
from ./instruby.rb:142:in `open_for_install'
from ./instruby.rb:252
from ./instruby.rb:239:in `each'
from ./instruby.rb:239
from ./instruby.rb:348:in `call'
from ./instruby.rb:348
from ./instruby.rb:345:in `each'
from ./instruby.rb:345
from ./instruby.rb:344:in `each'
from ./instruby.rb:344
make: *** [do-install-nodoc] Error 1
---------------------

So what does this really mean?
Any clue/suggestion are welcome.
My final goal is to run a Rails app on QNX.

It's coming from File#truncate, which uses your system's underlying
chsize() function. I'm not sure why that would fail. I recommend
trying Ruby 1.8.6, since the instruby.rb script has undergone some
serious changes from 1.8.5 to 1.8.6 (it's now 9k, from 6k).

You're the first person I've heard trying to run Ruby on QNX, btw. :)

Regards,

Dan
 
J

Joel VanderWerf

Martin said:
Hi all,
I'm facing install problems under QNX 6.3.0. [QNX QNX-DEV 6.3.0
2004/04/29-21:23:19UTC x86pc x86]
The compile works well and the 'make test' succeeds. So that's a good
start.
However, during 'make install', I get the following error:

I haven't tried to get ruby to work on QNX since the days of ruby-1.7
and 1.8.0 and QNX 6.2.1 (IIRC). I don't recall that error with truncate,
but there were other problems:

1. socket.so didn't build (or maybe it built but didn't run)

2. all of ext/ had to be built statically, because dynamic loading
didn't work. (This was a problem for the "official" builds of both
python and ruby from the QNX repos, as well.) Have you checked this? For
example:

$ ruby -r socket -e 1

3. There was a problem with sysread. For example, this call:

FileUtils.copy_file "a", "b"

would error with:

fileutils.rb:409:in `sysread': sysread for buffered IO (IOError)

It wasn't a total waste of time for me, even though I didn't end up
using ruby on QNX. I wrote bindings for the Cogent Datahub (a nice
publish/subscribe IPC for QNX and linux). But I only used them on linux
(with the SRR IPC kernel module).

If you do get ruby/qnx working, let us know on the list. It would still
be useful to me, at least.
 
M

Martin Gagnon

Daniel said:
trying Ruby 1.8.6, since the instruby.rb script has undergone some
serious changes from 1.8.5 to 1.8.6 (it's now 9k, from 6k).

1.8.6 fails installing /usr/local/bin/testrb. See original post for
details. ;-)

Rails would provide an easy and simple way to get data in and out of our
embedded controllers through the REST interface. It's well worth the
effort!

Thanks,
Martin
 
D

Daniel Berger

1.8.6 fails installing /usr/local/bin/testrb. See original post for
details. ;-)

Rails would provide an easy and simple way to get data in and out of our
embedded controllers through the REST interface. It's well worth the
effort!

I would try modifying instruby.rb by adding print statements in there
to verify the file name, the file size, and (especially) the size it's
trying to truncate to.

Regards,

Dan
 
M

Martin Gagnon

Joel said:
2. all of ext/ had to be built statically, because dynamic loading
didn't work. (This was a problem for the "official" builds of both
python and ruby from the QNX repos, as well.) Have you checked this? For
example:

$ ruby -r socket -e 1

This produces:
ruby: no such file to load -- socket (LoadError)
3. There was a problem with sysread. For example, this call:

FileUtils.copy_file "a", "b"

would error with:

fileutils.rb:409:in `sysread': sysread for buffered IO (IOError)

This produces:
ruby-test.rb:1:in `require': no such file to load -- fileutils
(LoadError)

I think that the install process didn't get far enough for this to work
anyway. The pieces are not where they belong yet.
If you do get ruby/qnx working, let us know on the list. It would still
be useful to me, at least.

I sure will!

Thanks,
Martin
 
M

Martin Gagnon

Daniel said:
I would try modifying instruby.rb by adding print statements in there
to verify the file name, the file size, and (especially) the size it's
trying to truncate to.

It's effectively bringing answers. instruby.rb fails when trying to
modify the shebang from the newly installed files.
IO#pos returns strange numbers. All my output prefixed 'MG:'
-------------------------------------
/home/martin/ruby-1.8.6# make install
/miniruby ./instruby.rb --dest-dir="" --extout=".ext" --make="make"
--mflags="-I /usr/qnx630/target/qnx6/usr/include" --make-flags="I
/usr/qnx630/target/qnx6/usr/include" --installed-list .installed.list
--mantype="man"
installing binary commands
installing command scripts
MG: /usr/local/bin/testrb open -> f
MG: f.pos: 8079457735797637120
MG: f.gets done | f.pos: 8079457735797637140
MG: f.read done | f.pos: 8079457735797637271
MG: f.rewind done | f.pos: 8079457735797637120
MG: truncating /usr/local/bin/testrb:
MG: f.size: 151
MG: Attempting to truncate at f.pos=8079457735797637273
/instruby.rb:272:in `truncate': File too large - /usr/local/bin/testrb
(Errno::EFBIG)
from ./instruby.rb:272
from ./instruby.rb:142:in `open'
from ./instruby.rb:142:in `open_for_install'
from ./instruby.rb:252
from ./instruby.rb:239:in `each'
from ./instruby.rb:239
from ./instruby.rb:361:in `call'
from ./instruby.rb:361
from ./instruby.rb:358:in `each'
from ./instruby.rb:358
from ./instruby.rb:357:in `each'
from ./instruby.rb:357
make: *** [do-install-nodoc] Error 1
-------------------------------------

Now, any idea why IO#pos is returning those numbers and how to get it to
work?

Thank you,
Martin
 
M

Martin Gagnon

Just noticing that the numbers returned by IO#pos are way off, but
cycling through 4 values.
This test script:
-----
f = File.open("test.txt", "r+")
puts "f.pos: #{f.pos}"
-----
produces successively:
f.pos: 1160802808249712640
f.pos: 3466645817463406592
f.pos: 5772488826677100544
f.pos: 8078331835890794496
f.pos: 1160802808249712640
f.pos: 3466645817463406592
f.pos: 5772488826677100544
f.pos: 8078331835890794496
The difference is constant: 2305843009213693952 (2^61)

And this script:
-----
3.times do
f = File.new("/home/martin/test.txt")
puts "f.pos: #{f.pos}"
end
 
D

Daniel Berger

Just noticing that the numbers returned by IO#pos are way off, but
cycling through 4 values.
This test script:
-----
f = File.open("test.txt", "r+")
puts "f.pos: #{f.pos}"
-----
produces successively:
f.pos: 1160802808249712640
f.pos: 3466645817463406592
f.pos: 5772488826677100544
f.pos: 8078331835890794496
f.pos: 1160802808249712640
f.pos: 3466645817463406592
f.pos: 5772488826677100544
f.pos: 8078331835890794496
The difference is constant: 2305843009213693952 (2^61)

And this script:
-----
3.times do
f = File.new("/home/martin/test.txt")
puts "f.pos: #{f.pos}"
end
-----
produces successively:
f.pos: 1160802808249712640
f.pos: 1160802808249712640
f.pos: 1160802808249712640

Well, it looks like IO#pos is broken on QNX. That, or QNX 6.3 has a
nasty bug that's preventing it from working.

At this point I think you're relegated to testing standalone C
programs, and comparing those against the implementation in io.c and
rubyio.h, using a debugger to see what's getting fouled up.

One idea would be to create a standalone C program that includes the
appropriate Ruby header files (I think you'll need intern.h, ruby.h
and rubyio.h), and uses rb_io_tell() to try to simulate what the Ruby
code is doing. Then, debug from there.

Sorry I can't be more helpful.

Regards,

Dan
 
J

Joel VanderWerf

Martin said:
This produces:
ruby: no such file to load -- socket (LoadError)

There might be some information in the make log in etc/socket.

Or it is possible that the make succeeded, and there is a socket.so
file, but it isn't being loaded properly. In this case, try changing
ext/Setup so that the "socket" line is not commented out, and will be
statically linked into ruby.
 
M

Martin Gagnon

Daniel said:
One idea would be to create a standalone C program that includes the
appropriate Ruby header files (I think you'll need intern.h, ruby.h
and rubyio.h), and uses rb_io_tell() to try to simulate what the Ruby
code is doing. Then, debug from there.

Sorry I can't be more helpful.

Regards,

Dan

Dan,
Thanks for your time and help.
I'll post results here.

Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top