File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -3864,10 +3864,17 @@ end
38643864
38653865 # now check if this file's content hash has changed relative to its source files
38663866 if stalecheck
3867- if ! samefile (includes[1 ]. filename, modpath) && ! samefile (fixup_stdlib_path (includes[1 ]. filename), modpath)
3868- @debug " Rejecting cache file $cachefile because it is for file $(includes[1 ]. filename) not file $modpath "
3869- record_reason (reasons, " wrong source" )
3870- return true # cache file was compiled from a different path
3867+ if ! samefile (includes[1 ]. filename, modpath)
3868+ # In certain cases the path rewritten by `fixup_stdlib_path` may
3869+ # point to an unreadable directory, make sure we can `stat` the
3870+ # file before comparing it with `modpath`.
3871+ stdlib_path = fixup_stdlib_path (includes[1 ]. filename)
3872+ if ! (isreadable (stdlib_path) && samefile (stdlib_path, modpath))
3873+ ! samefile (fixup_stdlib_path (includes[1 ]. filename), modpath)
3874+ @debug " Rejecting cache file $cachefile because it is for file $(includes[1 ]. filename) not file $modpath "
3875+ record_reason (reasons, " wrong source" )
3876+ return true # cache file was compiled from a different path
3877+ end
38713878 end
38723879 for (modkey, req_modkey) in requires
38733880 # verify that `require(modkey, name(req_modkey))` ==> `req_modkey`
You can’t perform that action at this time.
0 commit comments