File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -3115,9 +3115,16 @@ 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) && ! samefile (fixup_stdlib_path (includes[1 ]. filename), modpath)
3119- @debug " Rejecting cache file $cachefile because it is for file $(includes[1 ]. filename) not file $modpath "
3120- return true # cache file was compiled from a different path
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
31213128 end
31223129 for (modkey, req_modkey) in requires
31233130 # verify that `require(modkey, name(req_modkey))` ==> `req_modkey`
You can’t perform that action at this time.
0 commit comments