-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
On Musl systems, can't ccall
into a library with the soname
#36458
Comments
I installed an Alpine VM and tried out the musl binaries. Only pure Julia packages that have no dependency on a ccall'ed library work. I hope it is not too difficult to fix in time for the 1.5 release. |
I spent some time digging into this, and it appears that
The reason we do this is because Possible fixes:
In my opinion, none of these are things we can put into 1.5. And (3) may even be off the table for 1.6, as it would be a breaking change for all packages, everywhere. (Even if we provided a compatibility fallback, it means that all packages that don't do the new way won't work on musl). I think (2) is my favorite solution, as the const requirement on |
ccall
when the library is given with its basenameccall
into a library with the soname
@vtjnash and I discussed this a little while back, and we decided the following would work: Change |
One concern when we were discussing this was that currently if someone tries to do something dynamic with the name it will fail with a clear error indicating that you can't do that. The concern with allowing non-const library names was that someone might do that and not realize that it won't invoke a different function name/library when the value changes. The safest thing we could do would be to evaluate the string every time and check that it hasn't changed, but then again that might be too slow. If it's just a global variable lookup, it might be ok? |
While the underlying technology is now available for this to work on |
I'd like to see this functionality become available for JLLs; what's needed for this to work, other than making the library path non-
I'm using Julia built from #37383, and have |
@jpsamaroo what does |
@giordano that worked! So I guess now packages which use JLLs should (at least for Musl) now instead pass the path to |
I assume that's @staticfloat's plan for the next iteration of the JLL wrappers |
Would it help to get a run of PkgEval (or similar) on musl and open a meta-issue to track those? |
Someone with a musl machine could run https://github.com/JuliaComputing/NewPkgEval.jl and compare it to a standard linux run. It has a pretty simple interface. |
Great that's really straight-forward. I'll do it on the weekend if nobody beats me to it. |
I gave a go but some points make me scratch my head.
To my surprise the result is a gree ok and given as success. I also got surprised that running the same NewPkgEval.run for package 'Plots' took 30 minutes. |
HDF5_jll doesn't currently support any musl platform |
Then shouldn't PkgEval return failure? That's what I'd expect but 'NewPkgEval.run([julia_version], ["HDF5"])' gives success. |
How to reproduce: in a Musl system (I used
using BinaryBuilderBase; BinaryBuilderBase.runshell(Linux(:x86_64, libc = :musl);verbose=true)
) start Julia and doThe function can be
ccall
ed if the library is given with the full path, but not if only the basename is passed, even if the library is already loaded, as shown by its presence indllist
. JLL packages use the basename of the library because they can't set aconst
with the full path, for relocatability.strace
shows thatlibcuba.so
is searched everywhere, but not where Julia should know where it is:First reported in JuliaStats/Rmath.jl#70.
The text was updated successfully, but these errors were encountered: