Skip to content

Commit b6acfc7

Browse files
DilumAluthgeKristofferC
authored andcommitted
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 94bc7bf commit b6acfc7

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
@@ -1794,11 +1794,13 @@ function stale_cachefile(modpath::String, cachefile::String; ignore_loaded = fal
17941794
end
17951795
for chi in includes
17961796
f, ftime_req = chi.filename, chi.mtime
1797-
# Issue #13606: compensate for Docker images rounding mtimes
1798-
# Issue #20837: compensate for GlusterFS truncating mtimes to microseconds
1799-
# The `ftime != 1.0` condition below provides compatibility with Nix mtime.
18001797
ftime = mtime(f)
1801-
if ftime != ftime_req && ftime != floor(ftime_req) && ftime != trunc(ftime_req, digits=6) && ftime != 1.0
1798+
is_stale = ( ftime != ftime_req ) &&
1799+
( ftime != floor(ftime_req) ) && # Issue #13606, PR #13613: compensate for Docker images rounding mtimes
1800+
( ftime != trunc(ftime_req, digits=6) ) && # Issue #20837, PR #20840: compensate for GlusterFS truncating mtimes to microseconds
1801+
( ftime != 1.0 ) && # PR #43090: provide compatibility with Nix mtime.
1802+
!( 0 < (ftime_req - ftime) < 1e-6 ) # PR #45552: Compensate for Windows tar giving mtimes that may be incorrect by up to one microsecond
1803+
if is_stale
18021804
@debug "Rejecting stale cache file $cachefile (mtime $ftime_req) because file $f (mtime $ftime) has changed"
18031805
return true
18041806
end

0 commit comments

Comments
 (0)