Skip to content

Commit 50701ab

Browse files
Sacha0staticfloat
authored andcommitted
Make stale_cachefile compatible with Nix mtime (#43090)
The added condition improves compatiblity with Nix mtime. (cherry picked from commit f5e0f9d)
1 parent 960ef65 commit 50701ab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

base/loading.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1785,8 +1785,9 @@ function stale_cachefile(modpath::String, cachefile::String; ignore_loaded = fal
17851785
f, ftime_req = chi.filename, chi.mtime
17861786
# Issue #13606: compensate for Docker images rounding mtimes
17871787
# Issue #20837: compensate for GlusterFS truncating mtimes to microseconds
1788+
# The `ftime != 1.0` condition below provides compatibility with Nix mtime.
17881789
ftime = mtime(f)
1789-
if ftime != ftime_req && ftime != floor(ftime_req) && ftime != trunc(ftime_req, digits=6)
1790+
if ftime != ftime_req && ftime != floor(ftime_req) && ftime != trunc(ftime_req, digits=6) && ftime != 1.0
17901791
@debug "Rejecting stale cache file $cachefile (mtime $ftime_req) because file $f (mtime $ftime) has changed"
17911792
return true
17921793
end

0 commit comments

Comments
 (0)