Skip to content

Commit

Permalink
CircleCI caching: allow ftime to be ceil(ftime_req) in Base.stale_cac…
Browse files Browse the repository at this point in the history
…hefile (#47433)

* CircleCI caching: allow ftime to be ceil(ftime_req) in Base.stale_cachefile

It appears that [caching functionalities](https://circleci.com/docs/caching/) provided by CircleCi, a leading CI/CD provider, can truncate timestamps to full seconds, resulting in re-compilations as below:
```
Rejecting stale cache file /root/.julia/compiled/v1.8/ComponentArrays/cYHSD_3rQji.ji (mtime 1.6673960929277816e9) because file /root/.julia/packages/ComponentArrays/YyD7i/src/ComponentArrays.jl 
```

This PR relaxes the `is_stale` check to be robust against rounding-to-second timestamp mutations.

I can provide a minimal CircleCI configuration file to reproduce if this is helpful.
  • Loading branch information
nrontsis authored Nov 4, 2022
1 parent 6321e47 commit bf92e83
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2260,6 +2260,7 @@ end
ftime = mtime(f)
is_stale = ( ftime != ftime_req ) &&
( ftime != floor(ftime_req) ) && # Issue #13606, PR #13613: compensate for Docker images rounding mtimes
( ftime != ceil(ftime_req) ) && # PR: #47433 Compensate for CirceCI's truncating of timestamps in its caching
( ftime != trunc(ftime_req, digits=6) ) && # Issue #20837, PR #20840: compensate for GlusterFS truncating mtimes to microseconds
( ftime != 1.0 ) && # PR #43090: provide compatibility with Nix mtime.
!( 0 < (ftime_req - ftime) < 1e-6 ) # PR #45552: Compensate for Windows tar giving mtimes that may be incorrect by up to one microsecond
Expand Down

0 comments on commit bf92e83

Please sign in to comment.