Many of us now realized that it is a pain to use multiple projects because switching projects invoke precompilation:
I suggested a “workaround” a while ago but it never got much attention:
So, allow me to advertise it again here.
I propose to add a single line in the code determining the path for the precompilation cache path (i.e.,
*.ji file) so that it is different for different system image
sys.so path. This is not the solution to #27418 per se. However, you can create a system image for each frequently used project using PackageCompiler.jl to avoid precompilation when switching the projects. Thus, the change I proposed can be used as a workaround for #27418. Note that, although I introduced it as a “workaround”, I think you’d want to have this workflow anyway to use PackageCompiler.jl with multiple projects. If we have this feature in Julia 1.2, we can implement a tool for this workflow on top of PackageCompiler.jl (or maybe include such tool in it).
As @StefanKarpinski mentioned, this is not the direct solution to #27418 but it is rather a strict subset of the solution. This is why I think there is no “long-term code debt” in this approach. We need to take the system image into account for the path to the precompilation cache anyway because the system image may include the packages imported by the package that is precompiled.
What do you think? Does this approach make sense?