How can I invalidate the precompilation cache in a programmable way from within julia, to force precompilation upon restart ?
You can delete the files.
Sure
, but is there are Base officially supported way ?
I need to add this to Plots in select `Plots` backend via `Preferences` (or env variable) by t-bltg · Pull Request #4566 · JuliaPlots/Plots.jl · GitHub, upon changing the backend via Preferences.
I’ve really wanted this too.
This seems to work:
rm.(Base.find_all_in_cache_path(Base.module_keys[Plots]))
Preferences.jl should address this as long as you use @load_preference during every precompilation.
If you don’t use it during a precompilation session, then Julia will not know it should check that file and will not invalidate the cache.
Would be nice to have an official API for this if people want to propose one.
Doesn’t Base.compilecache do that already?