cmake-checks-cache
cmake-checks-cache copied to clipboard
What does the workflow for CI look like when you need to regenerate the cache due to changes?
I'd love to use this, but I'm not sure how it's meant to work. If I generate the cache and then reuse it for all future builds, what happens when something is added/removed/changed to cmake that means regenerating the cache? is there some way of detecting that and generating the cache again? or just always generate the cache per-pipeline-per-os? could 32/64/arm builds result in different caches?
e.g. CheckTypeSize what if the size of the type changed since it was last cached?
when the majority of time is spent in FetchContent, does this help at all?
You will need to generate the values from time to time. The purpose of having preloaded values is that you don't have to compute them, but it also means that there is no way to find out if a value needs to be update or not.
You could have a CI job that updates this cache values on nightly or weekly basis.
Thanks for the quick reply
Unfortunately I don't see how we can use it without causing subtle bugs. running jobs nightly might be okay on main, but doing it for every branch is probably unrealistic. There's also the issue of any commit or MR invalidating the cache for a branch that day, which could then (best case) break builds.
Definitely usable on CI in the right circumstance, but I think the maintenance burden, uncertainty of what could happen when using an invalid cache, and comparatively small benefit (vs other build speed improvements) make it unsuitable for our needs as-is. Maybe I'll take a look and see if there's a safer subset we could cache.
The project is interesting though :) thanks for all the work you put in to it.