Skip to content

Commit

Permalink
support if cache has a mixture of depot and non-depot includes (#52346)
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth authored Dec 7, 2023
1 parent 0ba0157 commit 46ad1c1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2660,13 +2660,15 @@ end
# Find depot in DEPOT_PATH for which all @depot tags from the `includes`
# can be replaced so that they point to a file on disk each.
function resolve_depot(includes::Union{AbstractVector,AbstractSet})
if any(includes) do inc
# `all` because it's possible to have a mixture of includes inside and outside of the depot
if all(includes) do inc
!startswith(inc, "@depot")
end
return :missing_depot_tag
return :fully_outside_depot
end
for depot in DEPOT_PATH
if all(includes) do inc
# `any` because it's possible to have a mixture of includes inside and outside of the depot
if any(includes) do inc
isfile(restore_depot_path(inc, depot))
end
return depot
Expand Down Expand Up @@ -2767,8 +2769,8 @@ function parse_cache_header(f::IO, cachefile::AbstractString)
end
if depot === :no_depot_found
@debug("Unable to resolve @depot tag in cache file $cachefile", srcfiles)
elseif depot === :missing_depot_tag
@debug("Missing @depot tag for include dependencies in cache file $cachefile.", srcfiles)
elseif depot === :fully_outside_depot
@debug("All include dependencies in cache file $cachefile are outside of a depot.", srcfiles)
else
for inc in includes
inc.filename = restore_depot_path(inc.filename, depot)
Expand Down

0 comments on commit 46ad1c1

Please sign in to comment.