Skip to content

Commit 23847ac

Browse files
authored
Add a dont_dlopen flag to build_tarballs. (#1239)
This prevents BinaryBuilder from dlopen'ing library products, while still having the JLL doing so at run time.
1 parent cf0121f commit 23847ac

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/AutoBuild.jl

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,8 @@ end
686686
verbose = false, debug = false,
687687
skip_audit = false, ignore_audit_errors = true,
688688
autofix = true, code_dir = nothing,
689-
meta_json_file = nothing, require_license = true, kwargs...)
689+
meta_json_file = nothing, require_license = true,
690+
dont_dlopen = false, kwargs...)
690691
691692
Runs the boiler plate code to download, build, and package a source package
692693
for a list of platforms. This method takes a veritable truckload of arguments,
@@ -728,6 +729,12 @@ here are the relevant actors, broken down in brief:
728729
729730
* `require_license` enables a special audit pass that requires licenses to be
730731
installed by all packages.
732+
733+
* `dont_dlopen`: don't try to `dlopen` library products. This is separate from
734+
specifying `dont_dlopen` on a `LibraryProduct` in that it still results in
735+
the generated JLL loading the library at run time, and only prevents
736+
BinaryBuilder from doing so during JLL generation.
737+
731738
"""
732739
function autobuild(dir::AbstractString,
733740
src_name::AbstractString,
@@ -744,6 +751,7 @@ function autobuild(dir::AbstractString,
744751
autofix::Bool = true,
745752
code_dir::Union{String,Nothing} = nothing,
746753
require_license::Bool = true,
754+
dont_dlopen::Bool = false,
747755
kwargs...)
748756
@nospecialize
749757

@@ -901,10 +909,12 @@ function autobuild(dir::AbstractString,
901909
# only `FileProduct`s.
902910
error("Cannot have $(typeof(p)) for AnyPlatform")
903911
end
904-
if !satisfied(p, dest_prefix; verbose=verbose, platform=platform)
912+
if !satisfied(p, dest_prefix; verbose=verbose, platform=platform,
913+
skip_dlopen=dont_dlopen)
905914
if !verbose
906915
# If we never got a chance to see the verbose output, give it here:
907-
locate(p, dest_prefix; verbose=true, platform=platform)
916+
locate(p, dest_prefix; verbose=true, platform=platform,
917+
skip_dlopen=dont_dlopen)
908918
end
909919
@error("Built $(src_name) but $(variable_name(p)) still unsatisfied:")
910920
unsatisfied_so_die = true
@@ -917,7 +927,7 @@ function autobuild(dir::AbstractString,
917927
# We also need to capture some info about each product
918928
products_info = Dict{Product,Any}()
919929
for p in products
920-
product_path = locate(p, dest_prefix; platform=platform)
930+
product_path = locate(p, dest_prefix; platform=platform, skip_dlopen=dont_dlopen)
921931
products_info[p] = Dict("path" => relpath(product_path, dest_prefix.path))
922932
if p isa LibraryProduct || p isa FrameworkProduct
923933
products_info[p]["soname"] = something(

0 commit comments

Comments
 (0)