How to benefit from package specific @recompile_invalidations when developing the same package?

I have a package MyPackage that loads stuff in an order that ends up invalidating a lot of Makie.

using DependencyA
using Makie

Long term I would like to solve it, but for now I would just like to work around it. If I use PrecompileTools.@recompile_invalidations when my package’s requirements then things work quite well.

using DependencyA
using Makie

The recompilations take about 2 minutes, but save me at least 30 seconds for my plot to draw.

However, now whenever I modify my package, I it looks like the invalidations get recompiled (when not using Revise). I guess this is because precompilation works at the pkgimage level. (Perhaps?)

So is the only solution to isolating the invalidation recompilation from changes in MyPackage creating a new package just for this? Or is there some other way to isolate it from my changes in MyPackage?

I think you have to create a new package.

1 Like

That definitely seems to be the case. I suppose what I’m thinking is that it would be a lot more useful in case it were possible to have a private package dependency in which to put all the extra precompiles. As it is, long term this would require registering another package, although I suppose I can still speed up development by deving a dummy package locally and not commiting anything to do with that.

This section in the PrecompileTools.jl docs seems relevant: Package developers: reducing the cost of precompilation during development