Skip to content

Conversation

@staticfloat
Copy link
Member

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.

@staticfloat staticfloat requested a review from topolarity May 13, 2025 14:38
@staticfloat staticfloat requested a review from giordano as a code owner May 13, 2025 14:38
@staticfloat
Copy link
Member Author

This is a step in the direction of #55478

const LIBPATH = Ref("")
const LIBPATH_list = String[]
artifact_dir::String = ""
libcurl_handle::Ptr{Cvoid} = C_NULL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing I'm slightly worried about with this move is that we lose the handle. Some time ago I wanted to use the libblastrampoline handle in a package, and realised that's gone, so I resorted to dlopening libblastrampoline again. Rest looks good to me

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that it is a slight change in internal API but I think it’s worth it, so that all users of handle-based operations must flow through the dlopen interface to allow for lazy loading

@oscardssmith
Copy link
Member

Have we figured out LazyLibrary/Juliac interop?

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.
@staticfloat
Copy link
Member Author

cmdlineargs test failure will be fixed by JuliaWeb/OpenSSL.jl#40

@IanButterworth
Copy link
Member

Is there a reason this doesn't include SuiteSparse_jll? It's quite an expensive one on macOS because of the dlpath calls

               ┌ 93.5 ms SuiteSparse_jll.__init__()
     94.6 ms  SuiteSparse_jll

@staticfloat
Copy link
Member Author

No reason, I will get them all eventually, or you can try your hand at it! It's pretty mechanical, the only part that requires any thought is filling out the dependencies arrays.

@IanButterworth
Copy link
Member

Gave it a go here #58444

@IanButterworth IanButterworth deleted the sf/lazy_libunwind branch May 28, 2025 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants