Skip to content

Commit 1fdc09c

Browse files
Sacha0KristofferC
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 71462c9 commit 1fdc09c

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
@@ -1866,8 +1866,9 @@ function stale_cachefile(modpath::String, cachefile::String; ignore_loaded = fal
18661866
f, ftime_req = chi.filename, chi.mtime
18671867
# Issue #13606: compensate for Docker images rounding mtimes
18681868
# Issue #20837: compensate for GlusterFS truncating mtimes to microseconds
1869+
# The `ftime != 1.0` condition below provides compatibility with Nix mtime.
18691870
ftime = mtime(f)
1870-
if ftime != ftime_req && ftime != floor(ftime_req) && ftime != trunc(ftime_req, digits=6)
1871+
if ftime != ftime_req && ftime != floor(ftime_req) && ftime != trunc(ftime_req, digits=6) && ftime != 1.0
18711872
@debug "Rejecting stale cache file $cachefile (mtime $ftime_req) because file $f (mtime $ftime) has changed"
18721873
return true
18731874
end

0 commit comments

Comments
 (0)