Compiling nailgun on Solaris

I’m trying to get nailgun running under jruby 1.3, but I can’t get it
to compile on Solaris. Has anybody had any luck, or can point me to a
compiled binary? I tried using a binary I compiled on linux, but that
didn’t work.

This is the message I get when running “make”:

Building ng client. To build a Windows binary, type ‘make ng.exe’
gcc -Wall -pedantic -s -O3 -o ng src/c/ng.c
Undefined first referenced
symbol in file
recv /var/tmp//ccYFECtY.o
send /var/tmp//ccYFECtY.o
gethostbyname /var/tmp//ccYFECtY.o
socket /var/tmp//ccYFECtY.o
connect /var/tmp//ccYFECtY.o
ld: fatal: Symbol referencing errors. No output written to ng
collect2: ld returned 1 exit status
make: *** [ng] Error 1


Chris


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

You need -lsocket -lnsl on Solaris…

oc

On Fri, Jun 12, 2009 at 8:11 PM, Chris E.[email protected]
wrote:

symbol in file
Chris


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Try for instance adding this to your Makefile:

ngsolaris: src/c/ng.c
${CC} ${CFLAGS} -lsocket -lnsl -o ng src/c/ng.c

make ngsolaris

oc

On Fri, Jun 12, 2009 at 9:29 PM, Ole Christian Rynning[email protected]
wrote:

This is the message I get when running “make”:
ld: fatal: Symbol referencing errors. No output written to ng


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Great, that worked.

Unfortunately, jruby core dumps when I try to use it:(

$ ./jruby --ng-server &
[1] 29950
NGServer started on all interfaces, port 2113.

$ ./jruby --ng -e “puts 1”
java.io.EOFException
Segmentation Fault (core dumped)
at java.io.DataInputStream.readFully(DataInputStream.java:178)
at java.io.DataInputStream.readFully(DataInputStream.java:152)
at com.martiansoftware.nailgun.NGSession.run(Unknown Source)


Chris

On Fri, Jun 12, 2009 at 3:34 PM, Ole Christian Rynning[email protected]
wrote:

You need -lsocket -lnsl on Solaris…

collect2: ld returned 1 exit status


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On Sat, Jun 13, 2009 at 5:08 AM, Ole Christian Rynning[email protected]
wrote:

http://github.com/oc/jruby/commit/372471fe4c66e245299c14298efb48e921359a73
Cool, thank you. I merged it in 81e2177.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Did this make it into 1.3.1, or do I need to do a special build to get
the changes?


Chris

On Sun, Jun 14, 2009 at 2:03 PM, Charles Oliver
Nutter[email protected] wrote:

See:


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On Tue, Jun 16, 2009 at 9:00 AM, Chris E.[email protected]
wrote:

Did this make it into 1.3.1, or do I need to do a special build to get
the changes?

No, I’m afraid it did not. Only critical fixes got into 1.3.1, and
obviously nailgun not working isn’t really critical.

You can do your own build, or check out
http://jruby.headius.com:8080/hudson for a nightly dist build. And of
course you can apply the patch that Ole came up with to the Nailgun
sources shipped with 1.3.1 and it should work fine.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

You’re right. I’ve found the bug, and fixed it. Tested on OSOL
2008.11, 2009.06 and OSX 10.5.7

getcwd(NULL,0) doesn’t conform to POSIX.1. The correct would be to use
MAXPATHLEN (from sys/param.h) – but as I do not have a Linux box
available, I chose BUFSIZE (2048) as a simpler solution. It’s usually
bigger than maxpath - which is usually 1024 anyway, and it gets freed
immediately after so I think it should be a pretty safe fix.

See:
http://github.com/oc/jruby/commit/372471fe4c66e245299c14298efb48e921359a73

oc

On Fri, Jun 12, 2009 at 9:56 PM, Chris E.[email protected]
wrote:

Segmentation Fault (core dumped)

ngsolaris: src/c/ng.c

Undefined first referenced

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email