-
-
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.
const libamd = LazyLibrary(_libamd_path, dependencies=_libamd_dependencies) | ||
const libbtf = LazyLibrary(_libbtf_path, dependencies=_libbtf_dependencies) | ||
const libcamd = LazyLibrary(_libcamd_path, dependencies=_libcamd_dependencies) | ||
const libccolamd = LazyLibrary(_libccolamd_path, dependencies=_libccolamd_dependencies) | ||
const libcholmod = LazyLibrary(_libcholmod_path, dependencies=_libcholmod_dependencies) | ||
const libcolamd = LazyLibrary(_libcolamd_path, dependencies=_libcolamd_dependencies) | ||
const libklu = LazyLibrary(_libklu_path, dependencies=_libklu_dependencies) | ||
const libldl = LazyLibrary(_libldl_path, dependencies=_libldl_dependencies) | ||
const librbio = LazyLibrary(_librbio_path, dependencies=_librbio_dependencies) | ||
const libspqr = LazyLibrary(_libspqr_path, dependencies=_libspqr_dependencies) | ||
const libsuitesparseconfig = LazyLibrary(_libsuitesparseconfig_path, dependencies=_libsuitesparseconfig_dependencies) | ||
const libumfpack = LazyLibrary(_libumfpack_path, dependencies=_libumfpack_dependencies) |
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.
This is going to be tedious, but you need to express the interdependencies between each of these libraries. E.g. libamd
depends on libsuitesparseconfig
, and libcholmod
depends on libamd
, libcamd
, libccolamd
, etc...
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 used a couple of bots to produce and check the list. Just pushed. Does it look reasonable?
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? |
20f4d4f
to
a415b58
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. fixups lazify dSFMT_jll lazify GMP_jll lazify libLLVM_jll lazify MPFR_jll lazify OpenLibm_jll lazify PCRE2_jll lazify SuiteSparse_jll add small precompiles Add `is_available()` for `LibUV_jll` Add initial `stdlib_dependencies` test This allows for auditing the expressed library dependencies in our LazyLibrary JLL definitions, to ensure that we don't get out of sync with the actual binaries. fix typo add stdlib_dependencies.jl to choosetests test fixes etc. test fixes etc. more test fixes morefix missing eager_modes dep fixes
a415b58
to
488c8e9
Compare
libcurl_path::String = "" | ||
|
||
if Sys.isfreebsd() | ||
_libcurl_dependencies = 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.
All of these zero-dependency lists for FreeBSD are surprising - why is it so common for that platform?
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 libccall
into a dynamically-computed library name #57707_ossl_modules_path()
returning wrong path toossl-modules
JuliaWeb/OpenSSL.jl#40