Skip to content

Commit 4c39647

Browse files
authored
Base.stale_cachefile: allow ftime_req to be greater than ftime by up to one microsecond (to compensate for Windows tar) (#45552)
1 parent 7838124 commit 4c39647

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

base/loading.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2075,11 +2075,13 @@ get_compiletime_preferences(::Nothing) = String[]
20752075
end
20762076
for chi in includes
20772077
f, ftime_req = chi.filename, chi.mtime
2078-
# Issue #13606: compensate for Docker images rounding mtimes
2079-
# Issue #20837: compensate for GlusterFS truncating mtimes to microseconds
2080-
# The `ftime != 1.0` condition below provides compatibility with Nix mtime.
20812078
ftime = mtime(f)
2082-
if ftime != ftime_req && ftime != floor(ftime_req) && ftime != trunc(ftime_req, digits=6) && ftime != 1.0
2079+
is_stale = ( ftime != ftime_req ) &&
2080+
( ftime != floor(ftime_req) ) && # Issue #13606, PR #13613: compensate for Docker images rounding mtimes
2081+
( ftime != trunc(ftime_req, digits=6) ) && # Issue #20837, PR #20840: compensate for GlusterFS truncating mtimes to microseconds
2082+
( ftime != 1.0 ) && # PR #43090: provide compatibility with Nix mtime.
2083+
!( 0 < (ftime_req - ftime) < 1e-6 ) # PR #45552: Compensate for Windows tar giving mtimes that may be incorrect by up to one microsecond
2084+
if is_stale
20832085
@debug "Rejecting stale cache file $cachefile (mtime $ftime_req) because file $f (mtime $ftime) has changed"
20842086
return true
20852087
end

0 commit comments

Comments
 (0)