Skip to content
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

Support Gradle Configuration Caching #253

Open
ZacSweers opened this issue Aug 5, 2020 · 12 comments
Open

Support Gradle Configuration Caching #253

ZacSweers opened this issue Aug 5, 2020 · 12 comments
Labels
backlog We hope to fix this feature/bug in the future feature request Request for a new feature

Comments

@ZacSweers
Copy link
Contributor

@fractalwrench and I talked about this offline, filing to track here!

https://docs.gradle.org/nightly/userguide/configuration_cache.html

@ZacSweers
Copy link
Contributor Author

I think this is done now but will let y'all make the final call on closing 👍

@Naitbit
Copy link

Naitbit commented Mar 28, 2022

Did this support regress since 2020? It doesn't appear to work on 7.2.0
com.bugsnag:bugsnag-android-gradle-plugin:7.2.0

FAILURE: Build failed with an exception.

* What went wrong:
Configuration cache state could not be cached: field 'manifestInfo' from type 'com.bugsnag.android.gradle.BugsnagReleasesTask': error writing value of type 'org.gradle.api.internal.provider.DefaultProperty'
> Configuration cache state could not be cached: field 'provider' from type 'org.gradle.api.internal.provider.MappingProvider': error writing value of type 'org.gradle.api.internal.provider.TransformBackedProvider'
   > Configuration cache state could not be cached: field 'transformer' from type 'org.gradle.api.internal.provider.TransformBackedProvider': error writing value of type 'com.bugsnag.android.gradle.BugsnagPlugin$registerBugsnagTasksForVariant$1$manifestInfoProvider$2'
      > Configuration cache state could not be cached: field '$output' from type 'com.bugsnag.android.gradle.BugsnagPlugin$registerBugsnagTasksForVariant$1$manifestInfoProvider$2': error writing value of type 'com.android.build.gradle.internal.api.ApkVariantOutputImpl'
         > Configuration cache state could not be cached: field 'services' from type 'com.android.build.gradle.internal.api.ApkVariantOutputImpl': error writing value of type 'com.android.build.gradle.internal.services.BaseServicesImpl'
            > Configuration cache state could not be cached: field 'projectServices' from type 'com.android.build.gradle.internal.services.BaseServicesImpl': error writing value of type 'com.android.build.gradle.internal.services.ProjectServices'
               > Configuration cache state could not be cached: field 'deprecationReporter' from type 'com.android.build.gradle.internal.services.ProjectServices': error writing value of type 'com.android.build.gradle.internal.errors.DeprecationReporterImpl'
                  > Configuration cache state could not be cached: field 'issueReporter' from type 'com.android.build.gradle.internal.errors.DeprecationReporterImpl': error writing value of type 'com.android.build.gradle.internal.errors.SyncIssueReporterImpl'
                     > Configuration cache state could not be cached: field 'messageReceiverImpl' from type 'com.android.build.gradle.internal.errors.SyncIssueReporterImpl': error writing value of type 'com.android.build.gradle.internal.errors.MessageReceiverImpl'
                        > Configuration cache state could not be cached: field 'mGson' from type 'com.android.build.gradle.internal.errors.MessageReceiverImpl': error writing value of type 'com.google.gson.Gson'
                           > Configuration cache state could not be cached: field 'constructorConstructor' from type 'com.google.gson.Gson': error writing value of type 'com.google.gson.internal.ConstructorConstructor'
                              > Configuration cache state could not be cached: field 'accessor' from type 'com.google.gson.internal.ConstructorConstructor': error writing value of type 'com.google.gson.internal.reflect.UnsafeReflectionAccessor'
                                 > Configuration cache state could not be cached: field 'overrideField' from type 'com.google.gson.internal.reflect.UnsafeReflectionAccessor': error writing value of type 'java.lang.reflect.Field'
                                    > Configuration cache state could not be cached: field 'root' from type 'java.lang.reflect.Field': error writing value of type 'java.lang.reflect.Field'
                                       > Configuration cache state could not be cached: field 'overrideFieldAccessor' from type 'java.lang.reflect.Field': error writing value of type 'jdk.internal.reflect.UnsafeBooleanFieldAccessorImpl'
                                          > Unable to make field protected final java.lang.reflect.Field jdk.internal.reflect.UnsafeFieldAccessorImpl.field accessible: module java.base does not "opens jdk.internal.reflect" to unnamed module @4966d1cf

@yousif-bugsnag
Copy link

HI @Naitbit,

There are still some parts of the plugin that do not support configuration caching. This is still on our backlog to address but I'm afraid I don't have any further updates at this time

@hackertronix
Copy link

@yousif-bugsnag do you have an approximate timeline for when this would be prioritized maybe?

@abigailbramble
Copy link

Hi @hackertronix - unfortunately we do not have any further updates at this time. We'll look into this when priorities allow.

@ZacSweers
Copy link
Contributor Author

Would you be open to a community-contributed PR?

@lemnik
Copy link
Contributor

lemnik commented Jul 27, 2022

As of v7.3.0 we have support for Gradle Configuration Caching for our ProGuard (R8) support (but not NDK just yet), we're still working on adding support for our other tasks.

@ZacSweers
Copy link
Contributor Author

FYI it looks like this has regressed in 7.4.0 as NdkToolchain.baseDir is incorrectly annotated as a Property<File> rather than a DirectoryProperty. Will send a PR, but it would be helpful if some tests could be added that ensured configuration cache didn't regress.

@johnkiely1
Copy link
Member

Thanks @ZacSweers, we will look into this asap.

@rohilchodankar
Copy link

With Gradle 8.1, its failing with

external process started 'git --version' 
See https://docs.gradle.org/8.1/userguide/configuration_cache.html#config_cache:requirements:external_processes

due to the following external process execution

@johnkiely1
Copy link
Member

Hi @rohilchodankar Thanks for raising, we are investigating this now.

@johnkiely1
Copy link
Member

Hey @rohilchodankar, our latest version v8.0.1 has just been released. This should address the issues you were seeing with Gradle 8.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog We hope to fix this feature/bug in the future feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

9 participants