-
Notifications
You must be signed in to change notification settings - Fork 273
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
ProtobufExtract after upgrading to Gradle 8.1 causes unexpected inputs to configuration cache #711
Comments
Given "closure4" in the screenshot, that seems likely to be: protobuf-gradle-plugin/src/main/groovy/com/google/protobuf/gradle/ProtobufExtract.groovy Lines 140 to 142 in 9d2a328
I'm not sure how best to resolve that, without looking at it more. |
@gavra0 👋 |
IIUC this method does not need to run on |
Rely on FileCollection.getElements() (available in Gradle 5.6+) to ensure no files are accessed eagerly during configuration. This also ensures configuration cache key does not depend on them. Fixes issue google#711. Test: Added "testProjectDependent proto extraction with configuration cache" with Gradle 8.1
Rely on FileCollection.getElements() (available in Gradle 5.6+) to ensure no files are accessed eagerly during configuration. This also ensures configuration cache key does not depend on them. Fixes issue google#711. Test: Added "testProjectDependent proto extraction with configuration cache" with Gradle 8.1
I've uploaded a PR that fixes this issue (confirmed in a test). |
Rely on FileCollection.getElements() (available in Gradle 5.6+) to ensure no files are accessed eagerly during configuration. This also ensures configuration cache key does not depend on them. Fixes issue #711. Test: Added "testProjectDependent proto extraction with configuration cache" with Gradle 8.1
Fixed by #713. And now I know the question is "when will we do a release?" We should probably fix #708 as well; it seems quick. @YifeiZhuang, let's try to do a release in the next week or two. |
Rely on FileCollection.getElements() (available in Gradle 5.6+) to ensure no files are accessed eagerly during configuration. This also ensures configuration cache key does not depend on them. Fixes issue google#711. Test: Added "testProjectDependent proto extraction with configuration cache" with Gradle 8.1
Any updates on a release of a fixed version? |
Rely on FileCollection.getElements() (available in Gradle 5.6+) to ensure no files are accessed eagerly during configuration. This also ensures configuration cache key does not depend on them. Fixes issue #711. Test: Added "testProjectDependent proto extraction with configuration cache" with Gradle 8.1 Co-authored-by: Ivan Gavrilovic <gavra0@users.noreply.github.com>
When we upgrade to Gradle 8.1 in github.com/androidx/androidx we found that
com.google.protobuf.gradle.ProtobufExtract$_instantiateFilteredProtos_closure4
causes../../out/androidx/datastore/datastore-sampleapp/build/intermediates/compile_app_classes_jar/debug/classes.jar
to be an input to the configuration cache calculation.What this means, if you run a build on a clean CI, then run a second build, then the second build will not hit configuration cache and will instead recalculate it from scratch again. This is very problematic for our CI usecase, but it is generally bad as it will cause a lot of invalidations of configuration cache when it is not expected.
In other similar issues with Gradle 8.1 new input to configuration cache, it has been usage of
File.exists()
that caused Gradle to consider it as an input to the configuration cache. I do not see usage of that in ProtobufExtract.groovy so maybe it is the use ofisDirectory()
that is triggering it.The text was updated successfully, but these errors were encountered: