Skip to content

Commit 99191f1

Browse files
use Vector{PkgId}
1 parent 3ed1ee7 commit 99191f1

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

base/loading.jl

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2501,7 +2501,7 @@ function create_expr_cache(pkg::PkgId, input::String, output::String, output_o::
25012501
# write data over stdin to avoid the (unlikely) case of exceeding max command line size
25022502
write(io.in, """
25032503
empty!(Base.EXT_DORMITORY) # If we have a custom sysimage with `EXT_DORMITORY` prepopulated
2504-
Base.track_nested_precomp($(repr(vcat(Base.precompilation_stack, pkg.name))))
2504+
Base.track_nested_precomp($(repr_pkgid_vec(vcat(Base.precompilation_stack, pkg))))
25052505
Base.precompiling_extension = $(loading_extension)
25062506
Base.include_package_for_output($(pkg_str(pkg)), $(repr(abspath(input))), $(repr(depot_path)), $(repr(dl_load_path)),
25072507
$(repr(load_path)), $deps, $(repr(source_path(nothing))))
@@ -2510,14 +2510,25 @@ function create_expr_cache(pkg::PkgId, input::String, output::String, output_o::
25102510
return io
25112511
end
25122512

2513-
const precompilation_stack = Vector{String}()
2513+
# TODO: remove once https://github.com/JuliaLang/julia/pull/52795 is figured out
2514+
function repr_pkgid(pkg::PkgId)
2515+
if pkg.uuid === nothing
2516+
return "$(PkgId)($(repr(pkg.name)))"
2517+
else
2518+
return "$(PkgId)($(repr(pkg.uuid)), $(repr(pkg.name)))"
2519+
end
2520+
end
2521+
repr_pkgid_vec(pkgs::Vector{PkgId}) = "$(PkgId)[" * join(repr_pkgid.(pkgs), ",") * "]"
2522+
2523+
const precompilation_stack = Vector{PkgId}()
25142524
# Helpful for debugging when precompilation is unexpectedly nested.
25152525
# Enable with `JULIA_DEBUG=nested_precomp`. Note that it expected to be nested in classical code-load precompilation
25162526
# TODO: Add detection if extension precompilation is nested and error / return early?
2517-
function track_nested_precomp(pkg_names::Vector{String})
2518-
append!(Base.precompilation_stack, pkg_names)
2519-
if length(Base.precompilation_stack) > 1
2520-
@debug "Nested precompilation: $(join(Base.precompilation_stack, " > "))" _group=:nested_precomp
2527+
function track_nested_precomp(pkgs::Vector{PkgId})
2528+
append!(precompilation_stack, pkgs)
2529+
if length(precompilation_stack) > 1
2530+
list() = join(map(p->p.name, precompilation_stack), " > ")
2531+
@debug "Nested precompilation: $(list())" _group=:nested_precomp
25212532
end
25222533
end
25232534

0 commit comments

Comments
 (0)