-
-
Notifications
You must be signed in to change notification settings - Fork 16
Description
Basically I have written a precompile workload that covered everything i want to precompile.
As such I do not want any of the packages I am depending on to run their precompile workloads,
because they will also include things i do not want.
I asked in slack a longer version of this:
So I have a local Julia package that is called only from a python package that it shares a mono-repo with.
Now that Julia package depends on a huge number of Julia packages mostly cos it depends on Catalyst.jl.
But the portion of their APIs it uses when called from python is actually tiny.So I have written a PreCompileTools.jl workload that more or less fully exercises that API.
Can I set things up some how to never run the preconpulation stuff for any of my dependencies, and only run the stuff for my package itself.
And still have it cache the stuff for both my package and it's dependencies that actually gets hit by my preconpilation workload?
I think it's going to net out a lot faster for me, especially in CI,
As the dependencies own precipitation stuff clearly doesn't do much for me since my first call of everything takes so much longer than my second.
Checking the logic in the code:
PrecompileTools.jl/src/workloads.jl
Lines 5 to 9 in 542d964
| if load_preference(@__MODULE__, "precompile_workloads", true) | |
| return load_preference(mod, "precompile_workload", true) | |
| else | |
| return false | |
| end |
It seems that if PrecompileTools's preference is set to false, then it is universally disabled.
So basically its ALL & PKG
I propose more complex logic,
where if the package doesn't have any setting set, it uses the overall setting.
But if it does then that overrides it.
So basically:
| ALL | PKG | enable in package? |
|---|---|---|
| FALSE | nothing | FALSE |
| TRUE | nothing | TRUE |
| FALSE | FALSE | FALSE |
| TRUE | TRUE | TRUE |
| FALSE | TRUE | TRUE |
| TRUE | FALSE | FALSE |
So the code would be:
mod_pref = load_preference(mod, "precompile_workload", nothing)
if !isnothing(mod_pref):
return mod_pref
else:
return load_preference(@__MODULE__, "precompile_workloads", true)
end