nar
nar copied to clipboard
Question on libc.so.6
Hello
I have been using this tool and it works great.
I have been creating nar executable (with nar create --executable) on a server in AWS (Red Hat 4.8.3-9), which has been working well. Yesterday one of our clients was getting "version `GLIBC_2.7' not found" error. It turns out libc.so.6 is pointing to libc-2.5 on his machine. After trying few things, I ended up with running "nar create --executable --os linux" on my Mac pro, which solved the issue. So, my question is how nar find libc.so.6 on Mac when making executable for linux?
Thanks
That dynamic librart is part of the Linux kernel C stadard libraries. Almost all the binaries depends on that dynamic library, including node. Probably this is an issue of the OS due to a missing LD_LIBRARY_PATH env variable. The embedded node binary is already compiled, so it should work on any OS. If that package has native C++ packages dependencies, perhaps the issue is in that package. Note tha npm rebuild should be executed in thst case before npm start vis npm prestart hook.
Thank you every much for the quick response.
You mentioned "embedded node binary". Is it embedded in nar package for each OS ?
Thanks
nar can optionally embed the node binary to provide a fully isolated app container. In that case the node binary is platform specific, so you can't run in OSX a binary compiled for linux and vice versa.
You've to provide always the --os flag based on the target OS you want to run the nar container.
I am providing "--os linux" when running "nar create" my Mac pro. The client's machine does not have node installed. So, I am guessing nar has an embedded node binary for linux (linked with libc-2.5 or older). Correct ?
Yes.
I have to say the old version saved me, so please don't upgrade :)
Thank you very much for the help.
Which version?
The node binary embedded in nar seems to work with libc-2.5.so, which was released in 2006.
But you can embed any node binary version, by default is used the latest version. Therefore I can't see the problem here.
I think I need to clarify: our client has this server with libc-2.5.so (red hat 4.1.2). When I make nar executable (without specifying --os linux) on a linux server with libc-2.17.so, the file does not work on his server. But, when I make it on my Mac pro (running Darwin Kernel Version 13.4.0) with --os linux, it works. I was trying to understand how nar picks up a node binary on my Mac that works on a linux server with libc-2.5.so.
I see. The problem here is you must specify the desired node version when you create the nar archive from Linux. The default behavior of nar is embed the current runtime node binary unless you desire a different platform from runtime. Seems like you're using an old version of node in runtime in Linux.
So you should specify: --os linux --node 5.7.0. Feel free to try creating it from Linux. It should work.