-
Notifications
You must be signed in to change notification settings - Fork 42
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
Included builds containing build logic prevent configuration-cache reuse #21
Comments
Thanks for the report. The configuration-cache hasn't been designed to be reused on different machines, but with The error message indicates that I suspect that this is due to the following process:
You could validate this locally by:
|
Thank you for clarifying this @bigdaz. Removing
Just
And finally
Is this something could perhaps be cached on the side? Not sure if |
The If you get this working, please share the configuration for others. |
Didn't get this to fully work yet, but thought it might be worth sharing what I've tried already. - name: Cache build logic
uses: actions/cache@v4
with:
path: build-conventions/build/groovy-dsl-plugins/output/plugin-requests
key: build-logic-${{ hashFiles('build-conventions/**/*.gradle', 'gradle/libs.versions.toml') }} Results in:
Changing path to
I have also encountered an error right now when trying to run a build, but I suppose this could be a separate issue?
Additional references: |
The best way to solve this is likely to experiment locally. Something like:
The second build should reproduce the configuration cache issue you're seeing on CI. You can then experiment to see exactly what needs to be restored. I suspect the entire Also, the cache key should probably include all source files under |
build-conventions
caching
Another option to solve this would be to add a separate |
I have a small pet project that never reuses the CC, so I added the build logic directory manually: https://github.com/hfhbd/adventOfCode/pull/29/files and it does work now! So it would be nice, if this action would store the this directory (or at least the relevant parts) by default. |
Unfortunately, simply building the included build isn't enough to make CC work. You get errors like this when CC is being reused:
We have a fairly intricate setup to make CC work on CI which (roughly) works like this:
This is far from idea because we end up loading CC one extra time in step 3. when we get a cache miss but the savings still outweigh the cost. The reason for doing this (and the reason why the standard action doesn't work and why simply building the included build doesn't work) is:
I really hope Gradle makes this work on CI as we were able to cut out p50 build times in half when we got CC to work. |
What about the default includedBuild |
Hi!
Just tried out Gradle 8.6 with
gradle/actions/setup-gradle@v3
and it seems like abuild-conventions
(https://docs.gradle.org/current/samples/sample_sharing_convention_plugins_with_build_logic.html) related task input change is preventing my configuration-cache from being reused.They do seem to cache fine on local builds.
Sample job that I run:
Is there any chance this might be related to
gradle-home-cache-cleanup
#19 ?If not, is there anything else that we should cache?
I suppose build conventions falls under this category:
The text was updated successfully, but these errors were encountered: