-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Convert remaining JLL stdlibs to LazyLibraries #58444
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
base: master
Are you sure you want to change the base?
Conversation
Unfortunately the Core.MethodError(f=Base.Libc.Libdl.var"#dlsym"(), args=("/cache/julia-buildkite-plugin/depots/53de1ea5-6dd3-4008-b976-161c9f34b0ad/artifacts/4db1e58d71ac6bbb35ecc832033264c630d5d3b3/lib/libzstd.so", :ZSTD_versionString), world=0x00000000000097b7) (LinearAlgebra is already broken for We do have a plan to fix it, but I don't know when it's going to happen since @Keno would like to revamp our ccall semantics (#57931) around the same time |
6bb0540
to
f8388c5
Compare
Ah ok. macOS M2 compared to results in #58436
Linux AMD Ryzen 9 5950X
And basic startup appears to be faster (if that makes sense?)
|
@@ -3,6 +3,6 @@ | |||
using Test, Libdl, GMP_jll | |||
|
|||
@testset "GMP_jll" begin | |||
vn = VersionNumber(unsafe_string(unsafe_load(cglobal((:__gmp_version, libgmp), Ptr{Cchar})))) | |||
vn = VersionNumber(unsafe_string(unsafe_load(cglobal(dlsym(libgmp, :__gmp_version), Ptr{Cchar})))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should/could cglobal be taught how to handle a LazyLibrary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could, the most annoying thing is just that cglobal()
is an intrinsic, not a function, so to add an overload for that involves writing C code, not just Julia code.
7fb4a84
to
46fe088
Compare
Can / should we add a test that checks the dependency list against the |
This comment was marked as resolved.
This comment was marked as resolved.
BinaryBuilder should already audit that, except for a few know broken libraries |
Right, but it would be good to make sure that we haven't fallen out-of-sync with BinaryBuilder |
46fe088
to
75229fe
Compare
I agree, I added a test that can be run on macOS or Linux. I (or someone else feeling brave) can make one for Windows as well. It already catches plenty of minor issues:
Note that there are some slight differences between macOS and Linux, so you'll have to add some conditionals for those things. |
Nice |
That should not actually be blocking. The required code dependencies should be vendored into the test directory anyways, rather than relying on changeable state elsewhere, since otherwise we can lose test coverage simply if these package files change, which should not be true of test code. |
I don't quite follow what you mean, can you be more explicit? |
a415b58
to
488c8e9
Compare
cdbfd6e
to
7bf2956
Compare
eda06e2
to
ccb1c94
Compare
ccb1c94
to
35aecff
Compare
1d13585
to
1afe38a
Compare
This converts more JLL stdlibs to use lazily-loaded libraries, and as a useful side-effect, causes them to be loaded by absolute path, isolating them all from `LD_LIBRARY_PATH`-like effects. Adds tests that audits the expressed library dependencies in our LazyLibrary JLL definitions, to ensure that we don't get out of sync with the actual binaries. Co-Authored-By: Mosè Giordano <[email protected]> Co-Authored-By: Elliot Saba <[email protected]>
1afe38a
to
3a9548b
Compare
test/trimming/basic_jll.jl
Outdated
@@ -3,7 +3,7 @@ using Zstd_jll | |||
|
|||
function @main(args::Vector{String})::Cint | |||
println(Core.stdout, "Julia! Hello, world!") | |||
fptr = dlsym(Zstd_jll.libzstd_handle, :ZSTD_versionString) | |||
fptr = dlsym(Zstd_jll.libzstd, :ZSTD_versionString) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vtjnash @topolarity @staticfloat It'd be good to figure out what to do about the trim blocker/non-blocker. Jameson/Cody, I don't know if you've discussed offline at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy (vendor) the old files into the test/trimming directory and proceed with the changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's OK by me - I still consider this a --trim
regression, but it's worth allowing it so that we can get LazyLibary in for now.
We've got a plan to fix-up LazyLibrary for --trim
soon enough and at that point we'll bump the test to use the latest standard JLL's (incl. LazyLibrary)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Pushed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting a segfault locally on macOS. Not sure why
/Users/ian/Documents/GitHub/julia/usr/bin/julia --depwarn=error /Users/ian/Documents/GitHub/julia/test/trimming/trimming.jl /Users/ian/Documents/GitHub/julia/usr/bin/hello
[98446] signal 11 (2): Segmentation fault: 11
in expression starting at none:0
jl_lookup_generic_ at /Users/ian/Documents/GitHub/julia/src/gf.c:3613 [inlined]
ijl_apply_generic at /Users/ian/Documents/GitHub/julia/src/gf.c:3686
main at /Users/ian/Documents/GitHub/julia/usr/bin/basic_jll (unknown line)
_main at /Users/ian/Documents/GitHub/julia/usr/bin/basic_jll (unknown line)
main at /Users/ian/Documents/GitHub/julia/usr/bin/basic_jll (unknown line)
Allocations: 1 (Pool: 1; Big: 0); GC: 0
ERROR: LoadError: failed process: Process(`/Users/ian/Documents/GitHub/julia/usr/bin/basic_jll`, ProcessSignaled(11)) [0]
d8c226d
to
dc4c2dc
Compare
Builds on #58405 (which I rebased, so the merge base here is master for now)
TODO:
Convert LLD_jll?No, it's an executable not a libConvert p7zip_jll?No, it's an executable not a libBlocked by --trim failuretrimming: no way toccall
into a dynamically-computed library name #57707 Instead it copies libzstd over for testing with a const path_ossl_modules_path()
returning wrong path toossl-modules
JuliaWeb/OpenSSL.jl#40