Force precompile_workloads to always be a compile-time preference#63
Force precompile_workloads to always be a compile-time preference#63staticfloat wants to merge 1 commit intomainfrom
precompile_workloads to always be a compile-time preference#63Conversation
In order for a preference to be considered a compile-time preference (and therefore for it to invalidate a precompilation cache file) the preference must be read during compilation of a module. The `precompile_workloads` preference was not being read during `PrecompileTools`' compilation, but during compilation of modules using `PrecompileTools` (which is harmless, but does not mark the preference as compile-time for `PrecompileTools`, of course). This adds a dummy read of the preference in order to mark it as compile-time, so that adding a `precompile_workloads = false` in your `LocalPreferences.toml` properly invalidates everything.
|
This closes #62 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #63 +/- ##
=======================================
Coverage 82.47% 82.47%
=======================================
Files 3 3
Lines 97 97
=======================================
Hits 80 80
Misses 17 17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
vchuravy
left a comment
There was a problem hiding this comment.
I am not a fan of precompile_workloads to begin with, it forces an extremely wide invalidation of the cache.
When I discussed this with @timholy back in the day, my goal with encouraging the use preferences was that invalidation would be as local as possible.
I agree that this the "right" change for #62, but the load in workload_enabled should probably then use the result of this, to tie them together explicitly.
The bigger question is, does this work reliably?
[Plots]
precompile_workload = false
|
That did work in my testing, I figured that @KristofferC had a good reason for wanting to invalidate the world. |
|
Ah, I had missed that it was specifically PrecompileTools' own setting that was at issue. I agree that the point of that setting is the one in #63 (review). However, if we disable its own precompilation locally, and other packages are |
In order for a preference to be considered a compile-time preference (and therefore for it to invalidate a precompilation cache file) the preference must be read during compilation of a module. The
precompile_workloadspreference was not being read duringPrecompileTools' compilation, but during compilation of modules usingPrecompileTools(which is harmless, but does not mark the preference as compile-time forPrecompileTools, of course).This adds a dummy read of the preference in order to mark it as compile-time, so that adding a
precompile_workloads = falsein yourLocalPreferences.tomlproperly invalidates everything.