Skip to content

Commit f7e011b

Browse files
authored
Add audit check about troublesome libraries (#611)
1 parent 4fb0ee7 commit f7e011b

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/Auditor.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,9 @@ function check_dynamic_linkage(oh, prefix, bin_files;
290290
else
291291
if !silent
292292
@warn("Linked library $(libname) could not be resolved and could not be auto-mapped")
293+
if is_troublesome_library_link(libname, platform)
294+
@warn("Depending on $(libname) is known to cause problems at runtime, make sure to link against the JLL library instead")
295+
end
293296
end
294297
all_ok = false
295298
end

src/auditor/dynamic_linkage.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,3 +400,20 @@ function update_linkage(prefix::Prefix, platform::Platform, path::AbstractString
400400

401401
return new_libpath
402402
end
403+
404+
405+
"""
406+
is_troublesome_library_link(libname::AbstractString, platform::Platform)
407+
408+
Return `true` if depending on `libname` is known to cause problems at runtime, `false` otherwise.
409+
"""
410+
is_troublesome_library_link(libname::AbstractString, platform::Platform) = false
411+
412+
# In https://github.com/JuliaGtk/GtkSourceWidget.jl/pull/9 we found that
413+
# depending on this libraries is an indication that system copies of libxml and
414+
# libiconv has been picked up during compilation. At runtime, the system copies
415+
# will be loaded, which are very likely to be incompatible with those provided
416+
# by JLL packages. The solution is to make sure that JLL copies of these
417+
# libraries are used.
418+
is_troublesome_library_link(libname::AbstractString, ::MacOS) =
419+
libname in ("/usr/lib/libxml2.2.dylib", "/usr/lib/libiconv.2.dylib")

0 commit comments

Comments
 (0)