-
Notifications
You must be signed in to change notification settings - Fork 147
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
Support for musl #215
Comments
That seems like a reasonable solution. “Add checking for musl” might be the tricky part; typically, the Java runtime is totally ignorant about the glibc. Short of environment sniffing, I think the easiest way to do this would probably be to try to load the glibc version, and if that fails, try the musl version. Every native variant we add makes the library larger. I suspect most people using musl are doing so by way of Alpine, and are running on x86_64. I think I'd want to dip my toes into this pond by shipping just that variant, and then wait and see if anyone asks for anything else. (ARMv8, maybe?) To tip this request on its head, an alternative approach might be to always use musl (or perhaps diet libc) and statically link it. I think that might inflate binary sizes too much, but it would be worth checking. For right now, are you able to compile the native libraries yourself on a musl-based system to get on with your project? On your musl system, you can rebuild the 64-bit Linux natives by running |
Adding checking if musl exists can be troublesome, especially if we want to be sure that we will not break anything that worked before.
This might be the way, It's safe for existing applications, I'll test it I agree with you, the x86_64 option seems to be the most wanted by most developers.
From my side, I was able to compile the library for alpine x64 without any problems. |
A little update from my side I started this issue because my application using
Today I did tests with the native library straight from the master branch and surprisingly it works:
As far as I understand the libraries were compiled without any specific glibc dependencies and now work fine with musl also. |
Interesting. The big difference between the native libraries in If I look for implementation-specific entries in the symbol table:
...I can find a result for each one in the musl source tree. But if I look for the symbols which are used by the native library in v5.2.1 and not
...I can't find any of them. I'm not very familiar with musl, and the documentation I can find is nonspecific about binary compatibility with specific glibc versions; their FAQ (Ctrl+F “Is musl compatible with glibc?”) only goes as far as to say:
I'm trying to get more automated testing in place (starting with #182, with the intent of automatically running these tests on real hardware). Maybe a reasonable approach to musl compatibility is to just keep compiling as we are now, and add automation to confirm that the library remains loadable and functional in an Alpine container. Does that sound OK to you? |
Yes, of course, that sounds good to me. Well... I am looking forward to version 5.3.0. |
Sounds good! |
Hello,
Currently I'm working on the project which will be run on the Alpine Linux.
Alpine Linux by default uses
musl
instead of GNU C Library.From what I see, the
nrjavaserial
linux libraries were precompiled usingglibc
only.Is it possible to add libs compiled with
musl
tonrjavaserial
?From what I see, the following steps will be needed:
Thanks
The text was updated successfully, but these errors were encountered: