Skip to content

Commit

Permalink
Restore modname == NULL behavior for jl_load_dynamic_library (#49611
Browse files Browse the repository at this point in the history
)

Within the Julia runtime, this usage has been superseded by the new
`jl_find_library_by_addr`, but this is still used downstream.

In particular, CBinding.jl ends up using this branch to get a handle
to libjulia-internal (perhaps a bit accidentally, since the comments
in CBinding.jl suggest it intends to get a handle to the exe)

This restores the behavior to avoid downstream breakage.
  • Loading branch information
topolarity committed May 3, 2023
1 parent 5304baa commit 0fa8f4f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/dlload.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@ JL_DLLEXPORT void *jl_load_dynamic_library(const char *modname, unsigned flags,
int n_extensions = endswith_extension(modname) ? 1 : N_EXTENSIONS;
int ret;

// modname == NULL is a sentinel value requesting the handle of libjulia-internal
if (modname == NULL)
return jl_find_dynamic_library_by_addr(&jl_load_dynamic_library);

abspath = jl_isabspath(modname);
is_atpath = 0;

Expand Down

2 comments on commit 0fa8f4f

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

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

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

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

Your package evaluation job has completed - possible new issues were detected.
A full report can be found here.

Please sign in to comment.