- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.7k
          LazyLibrary: Make add_dependency! always ephemeral to a given process
          #59233
        
          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
  
    LazyLibrary: Make add_dependency! always ephemeral to a given process
  
  #59233
              Conversation
38ec67b    to
    7669c4b      
    Compare
  
    87fcc6e    to
    fed86d9      
    Compare
  
    Like many registration / hook-like functions in Julia, this function is somewhat dangerous to use at compile-time. Depending on whether the `LazyLibrary` you are adding dependencies to was constructed in a prior pre-compilation process or not, your dependencies may or may not persist. This change errs on the side of consistency, and makes it so that `add_dependency!` is always an ephemeral operation that does not persist beyond the lifetime of the process. This makes it safe to temporarily register dependencies, e.g., during a sysimage build.
fed86d9    to
    ba0fe07      
    Compare
  
    | Despite JuliaLang/LinearAlgebra.jl#1407 closing, I think this might be a good change to take anyway. Possibly with a re-name to make it clear that this registration only lasts for the existing process? | 
| I'm totally in favor of anything that makes the semantics around how this interacts with  | 
Adds documentation for `Libdl.LazyLibrary` and related types.
Also extends the C calling manual with an expanded section on using
`LazyLibrary` for lazy library loading, including practical examples
of platform-specific libraries, dependency management, lazy path
construction, and initialization callbacks. Remove a few oddly confusing
or incorrect notes as well.
Also fix a `copy` oddly implemented as
`convert(Vector{LazyLibrary}, convert(Vector{Any}, LazyLibrary[]))`
from #59233 to just call `copy`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
    Adds documentation for `Libdl.LazyLibrary` and related types.
Also extends the C calling manual with an expanded section on using
`LazyLibrary` for lazy library loading, including practical examples
of platform-specific libraries, dependency management, lazy path
construction, and initialization callbacks. Remove a few oddly confusing
or incorrect notes as well.
Also fix a `copy` oddly implemented as
`convert(Vector{LazyLibrary}, convert(Vector{Any}, LazyLibrary[]))`
from #59233 to just call `copy`.
🤖 Generated with help by Claude Code.
    Adds documentation for `Libdl.LazyLibrary` and related types.
Also extends the C calling manual with an expanded section on using
`LazyLibrary` for lazy library loading, including practical examples
of platform-specific libraries, dependency management, lazy path
construction, and initialization callbacks. Remove a few oddly confusing
or incorrect notes as well.
Also fix a `copy` oddly implemented as
`convert(Vector{LazyLibrary}, convert(Vector{Any}, LazyLibrary[]))`
from #59233 to just call `copy`.
🤖 Generated with help by Claude Code.
    Adds documentation for `Libdl.LazyLibrary` and related types.
Also extends the C calling manual with an expanded section on using
`LazyLibrary` for lazy library loading, including practical examples of
platform-specific libraries, dependency management, lazy path
construction, and initialization callbacks. Remove a few oddly confusing
or incorrect notes as well.
Also fix a `copy` oddly implemented as
`convert(Vector{LazyLibrary}, convert(Vector{Any}, LazyLibrary[]))` from
#59233 to just call `copy`.
🤖 Generated with help by Claude Code.
    
Like many registration / hook-like functions in Julia, this function is somewhat dangerous to use at (pre)compile-time. Depending on whether the
LazyLibraryyou are adding dependencies to was constructed in a separate pre-compilation process or not, your dependencies may or may not persist.This change errs on the side of consistency, and makes it so that
add_dependency!is always an ephemeral operation that does not persist beyond the lifetime of the process, which makes it safe to temporarily register dependencies, e.g., during a sysimage build.(originally for JuliaLang/LinearAlgebra.jl#1407)