also check build ids when checking for staleness of precompile files #3308
+40
−11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed a case (which I can't repro now) where
pkg> precompile
considered everything precompiled, but loading the package still had to recompile. When I debugged, I saw that the check at https://github.com/JuliaLang/julia/blob/fec8304a8c6e2157759b76d20339b426201a5f61/base/loading.jl#L2602-L2606 failed which caused Julia to recompile the package.However, in Pkg, we only call the 2-arg version of
stale_cachefile
which disables this check https://github.com/JuliaLang/julia/blob/fec8304a8c6e2157759b76d20339b426201a5f61/base/loading.jl#L2554-L2556This PR copies the recursive checks for staleness in https://github.com/JuliaLang/julia/blob/79ceb8dbeab1b5a47c6bd664214616c19607ffab/base/loading.jl#L1309-L1336 but it adds some caching to prevent checking this for the same package multiple times. This still leads to some slowdown. On a pretty big environment I measure before this change a "no-op" precompile to take 469ms while with this change it takes 834 ms. However, with some more caching in Base (JuliaLang/julia#48247) it now takes 578 ms which is not so bad compared to before.