Using 1.9-rc2 in noticed, that quite often precompilation repeats even though there is no apparent reason for that. What I observe in my day to day usage:
- start Julia (
Revise
andTest
is loaded in startup) - activate environment
- trigger
] precompile
, precompiles stuff - close julia
- start julia again and activate same environment
- trigger
] precompile
→ precompiles some subset of the environment again
This seem somewhat erratic, sometimes I don’t need to precompile again, sometimes its precompiling a different subset of the environment.
I think this is due to some interaction with my global env and the stuff I am using
in the startup.jl
. For me a reproducible example to “set up” this problem is:
$ rm -r .julia/compiled
$ rm -r tmpenv
$ mkdir tmpenv
$ julia --startup-file=no
(@v1.9) pkg> activate tmpenv
Activating new project at `~/tmpenv`
(tmpenv) pkg> add Makie, GLMakie, CSV
Precompiling environment...
211 dependencies successfully precompiled in 144 seconds
julia> @time using Makie
5.128032 seconds (7.62 M allocations: 515.051 MiB, 2.76% gc time, 0.63% compilation time)
# eveything as expected
Next I try again with my startup file and really strange stuff happens
$ julia
[ Info: Precompiling Revise [295af30f-e4ad-537b-8983-00126c2a3abe]
# Revise and Test loaded
(@v1.9) pkg> activate tmpenv
Activating project at `~/tmpenv`
(tmpenv) pkg> precompile
# no output, Julia thinks its ready! nice!
but then, if i try to actually use a Package it does some precompiling (not in parallel unfortunate)
julia> @time using Makie
[ Info: Precompiling Makie [ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a]
[ Info: Precompiling DistributionsChainRulesCoreExt [6db1f127-056a-568b-bd49-ae61d42389fa]
77.489913 seconds (7.75 M allocations: 524.765 MiB, 0.22% gc time, 0.08% compilation time: 14% of which was recompilation)
Then, still in the same session, I trigger ] precompile
again, I get a lot of precompilation and even some warnings
(tmpenv) pkg> precompile
Precompiling environment...
✓ ImageIO
✓ Makie
7 dependencies successfully precompiled in 124 seconds. 204 already precompiled.
2 dependencies precompiled but different versions are currently loaded. Restart julia to access the new versions
1 dependency had warnings during precompilation:
┌ ShaderAbstractions [65257c39-d410-5151-9873-9b3e5be5013e]
│ ┌ Warning: The call to compilecache failed to create a usable precompiled cache file for StructArrays [09ab397b-f2b6-538f-b94a-2f83cf4a842a]
│ │ exception = Required dependency Tables [bd369af6-aec1-5ad0-b16a-f7cc5008161c] failed to load from a cache file.
│ └ @ Base loading.jl:1785
│ ┌ Warning: Module StructArrays with build ID ffffffff-ffff-ffff-000a-64231126fe01 is missing from the cache.
│ │ This may mean StructArrays [09ab397b-f2b6-538f-b94a-2f83cf4a842a] does not support precompilation but is imported by a module that does.
│ └ @ Base loading.jl:1760
└
Whats happening there? How to deal with this? I’d really like to not recompile so much because it just takes a long time…
julia> versioninfo()
Julia Version 1.9.0-rc2
Commit 72aec423c2a (2023-04-01 10:41 UTC)
Platform Info:
OS: macOS (arm64-apple-darwin21.3.0)
CPU: 8 × Apple M1
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1)
Threads: 4 on 4 virtual cores
Environment:
JULIA_NUM_THREADS = 4