Skip to content

Commit

Permalink
handle if the expected cache file is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Aug 8, 2024
1 parent f0a2a7a commit 2fe5792
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3664,7 +3664,16 @@ end
ignore_loaded::Bool=false, requested_flags::CacheFlags=CacheFlags(),
reasons::Union{Dict{String,Int},Nothing}=nothing, stalecheck::Bool=true)
# n.b.: this function does nearly all of the file validation, not just those checks related to stale, so the name is potentially unclear
io = open(cachefile, "r")
io = try
open(cachefile, "r")
catch e
if e isa SystemError && e.errno == ENOENT
@debug "Rejecting cache file $cachefile for $modkey because it does not exist"
return true
else
rethrow()
end
end
try
checksum = isvalid_cache_header(io)
if iszero(checksum)
Expand Down

0 comments on commit 2fe5792

Please sign in to comment.