You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As things stand, the precompile cache is clobbered very regularly; A project with Foo.jl installed at version 1.2 and a project with Foo.jl dev'ed to ~/.julia/dev also at version 1.2 will clobber eachother's cached .ji files. This is particularly frustrating when you have two branches of a package checked out in two different projects that are technically at the same version; running code in both of those projects at the same time virtually ensures that you will be precompiling every time you load code.
I propose that we introduce a path parameter, so that we call cache_file_entry(pkg, path), and hash path into pkg.uuid to generate the package slug. There are only two places where we invoke cache_file_entry() and in both places we have path information readily available. While this would potentially cause a multiplication in the number of precompiled images, I think it would be worthwhile to err on the side of saving time rather than space.
The text was updated successfully, but these errors were encountered:
How about the cache files for package Bar.jl depending on Foo.jl? Same version of Bar.jl may be used with different versions of Foo.jl including dev'ed version. I don't think it is enough to rely on package identity and path if you want to eliminate unnecessary precompilation. If you want to get rid of unnecessary precompilation (and save space), I think you need to generate cache paths based on something like hash tree. It would be pretty challenging considering the dynamic nature of package loading in Julia (see, e.g., #27418 (comment)).
If you want to error on the side of saving time, I think a better option would be to use per-project cache path. (See my jlm CLI that does that https://discourse.julialang.org/t/22849)
Thanks @tkf, I'm going to close this in favor of #27418, which has lots of great discussion already. I'll just go there and add my voice in with the crowd.
As things stand, the precompile cache is clobbered very regularly; A project with
Foo.jl
installed at version 1.2 and a project withFoo.jl
dev'ed to~/.julia/dev
also at version 1.2 will clobber eachother's cached.ji
files. This is particularly frustrating when you have two branches of a package checked out in two different projects that are technically at the same version; running code in both of those projects at the same time virtually ensures that you will be precompiling every time you load code.I propose that we introduce a
path
parameter, so that we callcache_file_entry(pkg, path)
, and hashpath
intopkg.uuid
to generate the package slug. There are only two places where we invokecache_file_entry()
and in both places we have path information readily available. While this would potentially cause a multiplication in the number of precompiled images, I think it would be worthwhile to err on the side of saving time rather than space.The text was updated successfully, but these errors were encountered: