-
-
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
Move Libdl
into Base
#35628
Move Libdl
into Base
#35628
Conversation
85a4a5e
to
d0497c5
Compare
Could this be done more surgically --- i.e. move just |
I don't think there's much to leave; we will need both Is the reason you want to leave it in the stdlib to reduce code size? |
Yes, it's nice to be able to reduce code size just by excluding stdlibs from the build. But if the majority of the Libdl code is needed in Base anyway, I suppose it doesn't matter. |
It's also a really hefty dependency in terms of libc support, since we're going far beyond the posix spec here. Though realistically, we expect it to exist on most targets. |
It really doesn't seem like that much code to me. SLOC isn't really a useful measure (113 lines in this case), but the code itself is pretty straightforward; over half of it is just simple The one thing I think we can do to reduce it is to remove the |
Is this needed in 1.5? |
No, we can keep it for later. |
b2365ff
to
7e26f3e
Compare
Only if you don't count the demands you're placing on libdl, but since codegen/ccall already does use dlopen and doesn't (yet?) define static linking, it's not a new issue. My main concern is just that we may want to avoid using this anywhere in the stdlib, as it has been a known performance issue in the past, since some libraries (for example openblas and libgit2) are known to have very high costs to load them, and by default right now we manage to defer that to their first usage. |
Ah, yes, I can see why you would want to keep using Right now, in order to We could build a system more similar to the "implicit We already have the graph of library dependencies available to us in BB (Although the information is not yet saved/exported anywhere, but we can bake it into the JLL packages), and to hook some code in before function libfoo()
if !libfoo_is_loaded
load_libfoo()
libfoo_is_loaded = true
end
return "libfoo.so"
end Then, users would use This is all tangential to this PR of course, it's merely setting proper expectations for how we want this module to be used. Thoughts? |
We need to `dlopen()` things in Base a lot more due to using JLL packages within `Base` and the standard library. We move `Libdl` into `Base.Libc`, but continue to carry a shell `Libdl` stdlib that re-exports all relevant pieces of functionality, for backwards-compatibility.
7e26f3e
to
9376add
Compare
I believe I have addressed everyone's comments, so I'm going to merge unless someone speaks up soon. |
We need to
dlopen()
things in Base a lot more due to using JLLpackages within
Base
and the standard library. We moveLibdl
intoBase.Libc
, but continue to carry a shellLibdl
stdlib thatre-exports all relevant pieces of functionality, for
backwards-compatibility.