Skip to content

Commit 612e3d9

Browse files
DilumAluthgeKristofferC
authored and
KristofferC
committed
Base.stale_cachefile: allow ftime_req to be greater than ftime by up to one microsecond (to compensate for Windows tar) (#45552)
(cherry picked from commit 4c39647)
1 parent ae47a3d commit 612e3d9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

base/loading.jl

+6-4
Original file line numberDiff line numberDiff line change
@@ -2144,11 +2144,13 @@ end
21442144
end
21452145
for chi in includes
21462146
f, ftime_req = chi.filename, chi.mtime
2147-
# Issue #13606: compensate for Docker images rounding mtimes
2148-
# Issue #20837: compensate for GlusterFS truncating mtimes to microseconds
2149-
# The `ftime != 1.0` condition below provides compatibility with Nix mtime.
21502147
ftime = mtime(f)
2151-
if ftime != ftime_req && ftime != floor(ftime_req) && ftime != trunc(ftime_req, digits=6) && ftime != 1.0
2148+
is_stale = ( ftime != ftime_req ) &&
2149+
( ftime != floor(ftime_req) ) && # Issue #13606, PR #13613: compensate for Docker images rounding mtimes
2150+
( ftime != trunc(ftime_req, digits=6) ) && # Issue #20837, PR #20840: compensate for GlusterFS truncating mtimes to microseconds
2151+
( ftime != 1.0 ) && # PR #43090: provide compatibility with Nix mtime.
2152+
!( 0 < (ftime_req - ftime) < 1e-6 ) # PR #45552: Compensate for Windows tar giving mtimes that may be incorrect by up to one microsecond
2153+
if is_stale
21522154
@debug "Rejecting stale cache file $cachefile (mtime $ftime_req) because file $f (mtime $ftime) has changed"
21532155
return true
21542156
end

0 commit comments

Comments
 (0)