-
Notifications
You must be signed in to change notification settings - Fork 26
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
Unknown linux gets a failed to load NIF library error due to GLIBC version #59
Comments
Hey @samfrench 👋
It should work on most distributions - I'm using Fedora 38 on my computer and it works fine. It is being compiled with Ubuntu because it's the default runner for Linux on GitHub Actions. But perhaps we should try to use an older version of it, in order to be compatible with more distros. I don't know exactly what are the drawbacks of that.
It is already dynamically linked for targets that are compiled with GCC, but I guess the problem is that the program was compiled with a newer version that includes some API that is used by the binary, and is not available for older versions of glibc.
For what I could understand, I think the only possible solution is to everybody agrees to compile using an older version of a Linux distribution. But I don't think that's entirely feasible, because people may depend on newer versions of other dependencies. I'm going to research more if there is another way to set a "version compatible" of glibc. I would say that upgrading to a newer distribution is the easiest solution, if possible. An alternative is to precompile the project you need, using the same OS and version you need, and force Rustler to load the NIF from a path - Rustler allows that by setting the |
Thank you for the response @philss. It is detailed and addresses all of the points. That explains it about Ubuntu. I was thinking it was the most compatible or popular, but it is the default on GitHub actions. I am mainly looking at libraries others have created, so the options would be to either compile from source and install dependencies or fork the source and precompile to use this approach. I am looking to precompile as this reduces the need for the dependencies and should make it easier to install - if the library doesn't change too often. I think the direction at the moment longer term, is to use a more recent linux distribution as it works as expected. In the short term I can use the option of "load_from" as you suggest. I hadn't considered that, but this should allow the libraries to be installed on other linux distributions. I am not sure on how the older or different ones should be supported and would be interested in your findings. Even if an older one is supported the same glibc is unlikely to be compatible on all relevant older ones. Potentially this is a similar problem when Ubuntu gets upgraded as that could use a newer version and others still be relying on 2.28. |
Just to let you know that the Variants feature has landed in I'm closing the issue now. |
Thank you for this. I'll take a look. |
I have been trying out rustler with a few libraries and am getting the NIF failing to load when I am using CentOS 7. Looking into this, the targets in the application example release.yml look to all be for Ubuntu. I am wondering if this is expected to work on other linux distributions, or if Ubuntu or Ubuntu compatible ones only. I also tried on Rocky 8 - which is compatible with CentOS - and this works fine.
For more information, on startup it fails to load the NIF library.
Then when I am in an iex session I also see the same thing when running the example application.
I have looked into the GLIBC message and there are suggestions that this may be a different version for different operating systems and it is not advisable to necessarily upgrade as these are core to the OS and expected to be different. Looking at the version in CentOS 7 is lower than Rocky. Rocky 8 is using "2.28" which is why it works there.
I was wondering if the GLIBC library should either be dynamically linked or a version could be looked up or specified, if any version can be used. I know I can build from source and run it using that approach, but I was looking at the precompiled versions to simplify things where possible.
Any advice on if this can work on other linux distributions or any feedback about this is appreciated.
The text was updated successfully, but these errors were encountered: