Skip to content

Commit c4e9213

Browse files
committed
Fix cahe rejection logic
1 parent 264f4a4 commit c4e9213

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

base/loading.jl

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3115,16 +3115,14 @@ end
31153115

31163116
# now check if this file is fresh relative to its source files
31173117
if !skip_timecheck
3118-
if !samefile(includes[1].filename, modpath)
3119-
stdlib_path = fixup_stdlib_path(includes[1].filename)
3120-
# In certain cases the path rewritten by `fixup_stdlib_path` may
3121-
# point to an unreadable directory, make sure we can `stat` the
3122-
# file before comparing it with `modpath`.
3123-
isreadable = iszero(@ccall jl_fs_access(stdlib_path::Cstring, 0x04::Cint)::Cint)
3124-
if isreadable && !samefile(stdlib_path, modpath)
3125-
@debug "Rejecting cache file $cachefile because it is for file $(includes[1].filename) not file $modpath"
3126-
return true # cache file was compiled from a different path
3127-
end
3118+
stdlib_path = fixup_stdlib_path(includes[1].filename)
3119+
# In certain cases the path rewritten by `fixup_stdlib_path` may
3120+
# point to an unreadable directory, make sure we can `stat` the
3121+
# file before comparing it with `modpath`.
3122+
isreadable = iszero(@ccall jl_fs_access(stdlib_path::Cstring, 0x04::Cint)::Cint)
3123+
if !(samefile(includes[1].filename, modpath) || (isreadable && samefile(stdlib_path, modpath)))
3124+
@debug "Rejecting cache file $cachefile because it is for file $(includes[1].filename) not file $modpath"
3125+
return true # cache file was compiled from a different path
31283126
end
31293127
for (modkey, req_modkey) in requires
31303128
# verify that `require(modkey, name(req_modkey))` ==> `req_modkey`

0 commit comments

Comments
 (0)