Skip to content

Commit 12adf71

Browse files
committed
precompile: fix deps list for extensions relying on stdlibs
Some packages add extensions to stdlibs, so we should not have prohibited precompiling those. This broke Compat, which adds an extension to LinearAlgebra.
1 parent 941e459 commit 12adf71

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

base/precompilation.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -587,9 +587,9 @@ function _precompilepkgs(pkgs::Union{Vector{String}, Vector{PkgId}},
587587
triggers[ext] = Base.PkgId[pkg] # depends on parent package
588588
all_triggers_available = true
589589
for trigger_uuid in trigger_uuids
590-
trigger_name = env.names[trigger_uuid]
591-
if trigger_uuid in keys(env.deps)
592-
push!(triggers[ext], Base.PkgId(trigger_uuid, trigger_name))
590+
trigger_name = Base.PkgId(trigger_uuid, env.names[trigger_uuid])
591+
if trigger_uuid in keys(env.deps) || Base.in_sysimage(trigger_name)
592+
push!(triggers[ext], trigger_name)
593593
else
594594
all_triggers_available = false
595595
break
@@ -619,6 +619,7 @@ function _precompilepkgs(pkgs::Union{Vector{String}, Vector{PkgId}},
619619
for ext_a in keys(ext_to_parent)
620620
for ext_b in keys(ext_to_parent)
621621
if triggers[ext_a] triggers[ext_b]
622+
push!(triggers[ext_a], ext_b)
622623
push!(direct_deps[ext_a], ext_b)
623624
end
624625
end
@@ -1033,9 +1034,8 @@ function _precompilepkgs(pkgs::Union{Vector{String}, Vector{PkgId}},
10331034
if interrupted_or_done[]
10341035
return
10351036
end
1036-
# for extensions, any extension in our direct dependencies is one we have a right to load
1037-
# for packages, we may load any extension (all possible triggers are accounted for above)
1038-
loadable_exts = haskey(ext_to_parent, pkg) ? filter((dep)->haskey(ext_to_parent, dep), direct_deps[pkg]) : nothing
1037+
# for extensions, any extension that can trigger it needs to be accounted for here (even stdlibs, which are excluded from direct_deps)
1038+
loadable_exts = haskey(ext_to_parent, pkg) ? filter((dep)->haskey(ext_to_parent, dep), triggers[pkg]) : nothing
10391039
if _from_loading && pkg in requested_pkgids
10401040
# loading already took the cachefile_lock and printed logmsg for its explicit requests
10411041
t = @elapsed ret = begin

0 commit comments

Comments
 (0)