Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question on libc.so.6 #131

Open
wenjunche opened this issue Feb 26, 2016 · 11 comments
Open

Question on libc.so.6 #131

wenjunche opened this issue Feb 26, 2016 · 11 comments
Labels

Comments

@wenjunche
Copy link

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

@h2non
Copy link
Owner

h2non commented Feb 26, 2016

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.

@wenjunche
Copy link
Author

Thank you every much for the quick response.

You mentioned "embedded node binary". Is it embedded in nar package for each OS ?

Thanks

@h2non
Copy link
Owner

h2non commented Feb 26, 2016

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.

@wenjunche
Copy link
Author

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 ?

@h2non
Copy link
Owner

h2non commented Feb 26, 2016

Yes.

@wenjunche
Copy link
Author

I have to say the old version saved me, so please don't upgrade :)

Thank you very much for the help.

@h2non
Copy link
Owner

h2non commented Feb 26, 2016

Which version?

@wenjunche
Copy link
Author

The node binary embedded in nar seems to work with libc-2.5.so, which was released in 2006.

@h2non
Copy link
Owner

h2non commented Feb 26, 2016

But you can embed any node binary version, by default is used the latest version. Therefore I can't see the problem here.

@wenjunche
Copy link
Author

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.

@h2non
Copy link
Owner

h2non commented Feb 26, 2016

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.

@h2non h2non added the question label Feb 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants