Skip to content

Force precompile_workloads to always be a compile-time preference #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

staticfloat
Copy link
Member

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.

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.
@staticfloat
Copy link
Member Author

This closes #62

@staticfloat staticfloat requested a review from timholy May 20, 2025 06:36
Copy link

codecov bot commented May 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.47%. Comparing base (990c356) to head (5603ade).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@vchuravy vchuravy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@staticfloat
Copy link
Member Author

That did work in my testing, I figured that @KristofferC had a good reason for wanting to invalidate the world.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants