-
-
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
add Base.isprecompiled(pkg::PkgId)
#50218
add Base.isprecompiled(pkg::PkgId)
#50218
Conversation
9e20682
to
0a0a226
Compare
Bump @KristofferC |
I would have thought this function would also be used by loading to check if a precompile file is stale before trying to precompile it. Is there a reason that couldn't be done? Perhaps it needs to return a bit more than just |
I gave that a go twice and failed twice because the At least, it will need to be broken up into an internal function that can be used inside the loading loop, I think. This is blocking making Pkg.precompile use the pidlocks. Perhaps that could be a follow on PR? |
try | ||
# update timestamp of precompilation file so that it is the first to be tried by code loading | ||
touch(path_to_try) | ||
catch ex | ||
# file might be read-only and then we fail to update timestamp, which is fine | ||
ex isa IOError || rethrow() | ||
end |
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.
being simultaneously mutating (rather than a pure check) seems out-of-character for this function
try | |
# update timestamp of precompilation file so that it is the first to be tried by code loading | |
touch(path_to_try) | |
catch ex | |
# file might be read-only and then we fail to update timestamp, which is fine | |
ex isa IOError || rethrow() | |
end |
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.
IMO it seems like a reasonable thing to do for systemic efficiency
29aca84
to
c24136d
Compare
This is based on the Pkg internal
_is_stale
but inverted, with caching optional via kwargs so that Pkg can instead use this and remain efficient.It's more generally useful, and good to keep in-line with Base functionality.