Skip to content

Commit

Permalink
make pkg exts precompile sequentially to avoid race
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Oct 9, 2023
1 parent debcade commit 0a14a7a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,7 @@ function precompile(ctx::Context, pkgs::Vector{PackageSpec}; internal_call::Bool
# add any extensions
weakdeps = last(dep).weakdeps
pkg_exts = Dict{Base.PkgId, Vector{Base.PkgId}}()
prev_ext = nothing
for (ext_name, extdep_names) in last(dep).exts
ext_deps = Base.PkgId[]
push!(ext_deps, pkg) # depends on parent package
Expand All @@ -1133,8 +1134,13 @@ function precompile(ctx::Context, pkgs::Vector{PackageSpec}; internal_call::Bool
end
end
all_extdeps_available || continue
if prev_ext isa Base.PkgId
# also make the exts depend on eachother sequentially to avoid race
push!(ext_deps, prev_ext)
end
ext_uuid = Base.uuid5(pkg.uuid, ext_name)
ext = Base.PkgId(ext_uuid, ext_name)
prev_ext = ext
push!(pkg_specs, PackageSpec(uuid = ext_uuid, name = ext_name)) # create this here as the name cannot be looked up easily later via the uuid
filter!(!Base.in_sysimage, ext_deps)
depsmap[ext] = ext_deps
Expand Down

0 comments on commit 0a14a7a

Please sign in to comment.