Skip to content

Commit 6a14896

Browse files
committed
[Auditor] More parallelism
1 parent 2422740 commit 6a14896

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

src/Auditor.jl

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -389,19 +389,20 @@ function check_dynamic_linkage(oh, prefix, bin_files, sandbox_lock::ReentrantLoc
389389
autofix::Bool = true,
390390
src_name::AbstractString = "",
391391
)
392-
all_ok = true
392+
all_ok = Threads.Atomic{Bool}(true)
393393
# If it's a dynamic binary, check its linkage
394394
if isdynamic(oh)
395395
rp = RPath(oh)
396396

397+
filename = relpath(path(oh), prefix.path)
397398
if verbose
398-
@info("Checking $(relpath(path(oh), prefix.path)) with RPath list $(rpaths(rp))")
399+
@info("Checking $(filename) with RPath list $(rpaths(rp))")
399400
end
400401

401402
# Look at every dynamic link, and see if we should do anything about that link...
402403
libs = find_libraries(oh)
403404
ignored_libraries = String[]
404-
for libname in keys(libs)
405+
Threads.@threads for libname in keys(libs)
405406
if should_ignore_lib(libname, oh, platform)
406407
push!(ignored_libraries, libname)
407408
continue
@@ -411,7 +412,7 @@ function check_dynamic_linkage(oh, prefix, bin_files, sandbox_lock::ReentrantLoc
411412
if is_default_lib(libname, oh)
412413
if autofix
413414
if verbose
414-
@info("Rpathify'ing default library $(libname)")
415+
@info("$(filename): Rpathify'ing default library $(libname)")
415416
end
416417
relink_to_rpath(prefix, platform, path(oh), libs[libname], sandbox_lock; verbose, subdir=src_name)
417418
end
@@ -430,41 +431,41 @@ function check_dynamic_linkage(oh, prefix, bin_files, sandbox_lock::ReentrantLoc
430431
new_link = update_linkage(prefix, platform, path(oh), libs[libname], bin_files[kidx], sandbox_lock; verbose, subdir=src_name)
431432

432433
if verbose && new_link !== nothing
433-
@info("Linked library $(libname) has been auto-mapped to $(new_link)")
434+
@info("$(filename): Linked library $(libname) has been auto-mapped to $(new_link)")
434435
end
435436
else
436437
if !silent
437-
@warn("Linked library $(libname) could not be resolved and could not be auto-mapped")
438+
@warn("$(filename): Linked library $(libname) could not be resolved and could not be auto-mapped")
438439
if is_troublesome_library_link(libname, platform)
439-
@warn("Depending on $(libname) is known to cause problems at runtime, make sure to link against the JLL library instead")
440+
@warn("$(filename): Depending on $(libname) is known to cause problems at runtime, make sure to link against the JLL library instead")
440441
end
441442
end
442-
all_ok = false
443+
all_ok[] = false
443444
end
444445
else
445446
if !silent
446-
@warn("Linked library $(libname) could not be resolved within the given prefix")
447+
@warn("$(filename): Linked library $(libname) could not be resolved within the given prefix")
447448
end
448-
all_ok = false
449+
all_ok[] = false
449450
end
450451
elseif !startswith(libs[libname], prefix.path)
451452
if !silent
452-
@warn("Linked library $(libname) (resolved path $(libs[libname])) is not within the given prefix")
453+
@warn("$(filename): Linked library $(libname) (resolved path $(libs[libname])) is not within the given prefix")
453454
end
454-
all_ok = false
455+
all_ok[] = false
455456
end
456457
end
457458

458459
if verbose && !isempty(ignored_libraries)
459-
@info("Ignored system libraries $(join(ignored_libraries, ", "))")
460+
@info("$(filename): Ignored system libraries $(join(ignored_libraries, ", "))")
460461
end
461462

462463
# If there is an identity mismatch (which only happens on macOS) fix it
463464
if autofix
464465
fix_identity_mismatch(prefix, platform, path(oh), oh, sandbox_lock; verbose, subdir=src_name)
465466
end
466467
end
467-
return all_ok
468+
return all_ok[]
468469
end
469470

470471

0 commit comments

Comments
 (0)