Skip to content

Commit

Permalink
Make stale_cachefile compatible with Nix mtime (JuliaLang#43090)
Browse files Browse the repository at this point in the history
The added condition improves compatiblity with Nix mtime.
  • Loading branch information
Sacha0 authored Nov 19, 2021
1 parent 2c14d93 commit f5e0f9d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1915,8 +1915,9 @@ function stale_cachefile(modpath::String, cachefile::String; ignore_loaded = fal
f, ftime_req = chi.filename, chi.mtime
# Issue #13606: compensate for Docker images rounding mtimes
# Issue #20837: compensate for GlusterFS truncating mtimes to microseconds
# The `ftime != 1.0` condition below provides compatibility with Nix mtime.
ftime = mtime(f)
if ftime != ftime_req && ftime != floor(ftime_req) && ftime != trunc(ftime_req, digits=6)
if ftime != ftime_req && ftime != floor(ftime_req) && ftime != trunc(ftime_req, digits=6) && ftime != 1.0
@debug "Rejecting stale cache file $cachefile (mtime $ftime_req) because file $f (mtime $ftime) has changed"
return true
end
Expand Down

0 comments on commit f5e0f9d

Please sign in to comment.