-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Base.stale_cachefile
: allow ftime_req
to be greater than ftime
by up to one microsecond (to compensate for Windows tar)
#45552
Base.stale_cachefile
: allow ftime_req
to be greater than ftime
by up to one microsecond (to compensate for Windows tar)
#45552
Conversation
Base.stale_cachefile
: allow ftime
to be greater than ftime_req
by up to one microsecond (to compensate for Windows tar)Base.stale_cachefile
: allow ftime_req
to be greater than ftime
by up to one microsecond (to compensate for Windows tar)
28db101
to
ed3876e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix makes sense, but I don't understand the root cause; why is windows' tar
fudging our timestamps?
More specially, how does it fudge it this oddly. Is it specifically rounding up (since we already handle rounding down)? |
Yeah, I would really like to understand why this is happening. As far as I can tell, all of the
It's always just that last digit that differs. |
…by up to one microsecond (to compensate for Windows tar)
ed3876e
to
be650ac
Compare
This PR modifies the
Base.stale_cachefile
function, which is used in code loading to determine whether or not a.ji
cachefile is fresh relative to its.jl
source files.In this PR, for each source file, we allow
ftime_req
(the original mtime of the source file as recorded in the header of the cachefile) to be greater thanftime
(the current mtime of the source file), but only ifftime_req - ftime
is strictly greater than zero and strictly less than one microsecond. In other words, we allow a cachefile to be considered fresh if the following condition is true:0 < (ftime_req - ftime) < 1e-6
.Motivation
I am running into the following issue:
actions/cache
action runs, which performs the following steps:tar
up the depot, upload the tarball to GitHub's servers.actions/cache
action runs, which performs the following steps: download the tarball from GitHub's servers, extract the tarball to the exact same location as before.ENV["JULIA_DEBUG"] = "all"
and doimport SomePackage
.Expected behavior: all of the cachefiles should be fresh.
Observed behavior: at least one of the cachefiles is stale. The
@debug
message shows thatftime != ftime_req
. More specifically,ftime_req > ftime
. However, in all of the tests that I have done, it has always been the case that0 < (ftime_req - ftime) < 1e-6
.This makes it impossible to use the GitHub Actions CI cache to cache the Julia precompilation cache for Windows jobs.
Interestingly enough, I only see this issue on Windows. Everything works fine on the GitHub-hosted Linux runners.