@@ -24,11 +24,15 @@ include("auditor/codesigning.jl")
24
24
# something can't be opened. Possibly use that within BinaryProvider too?
25
25
26
26
"""
27
- audit(prefix::Prefix; platform::AbstractPlatform = HostPlatform();
27
+ audit(prefix::Prefix, src_name::AbstractString = "";
28
+ io=stderr,
29
+ platform::AbstractPlatform = HostPlatform(),
28
30
verbose::Bool = false,
29
31
silent::Bool = false,
30
32
autofix::Bool = false,
31
- require_license::Bool = true)
33
+ has_csl::Bool = true,
34
+ require_license::Bool = true,
35
+ )
32
36
33
37
Audits a prefix to attempt to find deployability issues with the binary objects
34
38
that have been installed within. This auditing will check for relocatability
@@ -47,7 +51,8 @@ function audit(prefix::Prefix, src_name::AbstractString = "";
47
51
silent:: Bool = false ,
48
52
autofix:: Bool = false ,
49
53
has_csl:: Bool = true ,
50
- require_license:: Bool = true )
54
+ require_license:: Bool = true ,
55
+ )
51
56
# This would be really weird, but don't let someone set `silent` and `verbose` to true
52
57
if silent
53
58
verbose = false
@@ -107,13 +112,13 @@ function audit(prefix::Prefix, src_name::AbstractString = "";
107
112
# DO THIS ONE LAST as it can actually mutate the file, which causes the previous
108
113
# checks to freak out a little bit.
109
114
all_ok &= check_dynamic_linkage (oh, prefix, bin_files;
110
- platform, silent, verbose, autofix)
115
+ platform, silent, verbose, autofix, src_name )
111
116
end
112
117
end
113
118
end
114
119
115
120
# Ensure this file is codesigned (currently only does something on Apple platforms)
116
- all_ok &= ensure_codesigned (f, prefix, platform; verbose)
121
+ all_ok &= ensure_codesigned (f, prefix, platform; verbose, subdir = src_name )
117
122
catch e
118
123
if ! isa (e, ObjectFile. MagicMismatch)
119
124
rethrow (e)
@@ -172,7 +177,7 @@ function audit(prefix::Prefix, src_name::AbstractString = "";
172
177
# Ensure that all libraries have at least some kind of SONAME, if we're
173
178
# on that kind of platform
174
179
if ! Sys. iswindows (platform)
175
- all_ok &= ensure_soname (prefix, f, platform; verbose= verbose , autofix= autofix )
180
+ all_ok &= ensure_soname (prefix, f, platform; verbose, autofix, subdir = src_name )
176
181
end
177
182
178
183
# Ensure that this library is available at its own SONAME
@@ -306,7 +311,9 @@ function check_dynamic_linkage(oh, prefix, bin_files;
306
311
platform:: AbstractPlatform = HostPlatform (),
307
312
verbose:: Bool = false ,
308
313
silent:: Bool = false ,
309
- autofix:: Bool = true )
314
+ autofix:: Bool = true ,
315
+ src_name:: AbstractString = " " ,
316
+ )
310
317
all_ok = true
311
318
# If it's a dynamic binary, check its linkage
312
319
if isdynamic (oh)
@@ -331,7 +338,7 @@ function check_dynamic_linkage(oh, prefix, bin_files;
331
338
if verbose
332
339
@info (" Rpathify'ing default library $(libname) " )
333
340
end
334
- relink_to_rpath (prefix, platform, path (oh), libs[libname]; verbose= verbose )
341
+ relink_to_rpath (prefix, platform, path (oh), libs[libname]; verbose, subdir = src_name )
335
342
end
336
343
continue
337
344
end
@@ -345,7 +352,7 @@ function check_dynamic_linkage(oh, prefix, bin_files;
345
352
kidx = findfirst (known_bins .== lowercase (basename (libname)))
346
353
if kidx != = nothing
347
354
# If it is, point to that file instead!
348
- new_link = update_linkage (prefix, platform, path (oh), libs[libname], bin_files[kidx]; verbose= verbose )
355
+ new_link = update_linkage (prefix, platform, path (oh), libs[libname], bin_files[kidx]; verbose, subdir = src_name )
349
356
350
357
if verbose && new_link != = nothing
351
358
@info (" Linked library $(libname) has been auto-mapped to $(new_link) " )
@@ -379,7 +386,7 @@ function check_dynamic_linkage(oh, prefix, bin_files;
379
386
380
387
# If there is an identity mismatch (which only happens on macOS) fix it
381
388
if autofix
382
- fix_identity_mismatch (prefix, platform, path (oh), oh; verbose= verbose )
389
+ fix_identity_mismatch (prefix, platform, path (oh), oh; verbose, subdir = src_name )
383
390
end
384
391
end
385
392
return all_ok
0 commit comments