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.
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.
IMO it seems like a reasonable thing to do for systemic efficiency
29aca84 to
c24136d
Compare
This is based on the Pkg internal
_is_stalebut 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.