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

Enable Gradle Configuration Caching #441

Merged
merged 2 commits into from
Aug 12, 2022
Merged

Enable Gradle Configuration Caching #441

merged 2 commits into from
Aug 12, 2022

Conversation

liutikas
Copy link
Contributor

@liutikas liutikas commented Aug 9, 2022

No description provided.

@asodja asodja added @execution internal Internal change labels Aug 9, 2022
@asodja
Copy link
Member

asodja commented Aug 9, 2022

Also here, could you just sign-off the commit to make DCO check happy?

Signed-off-by: Aurimas Liutikas <aurimas@google.com>
@liutikas
Copy link
Contributor Author

liutikas commented Aug 9, 2022

Done

@asodja
Copy link
Member

asodja commented Aug 10, 2022

Thank you!

It seems we have some problems that need to be fixed before we use cc, e.g. ./gradlew test --dry-run shows:

6 problems were found storing the configuration cache.
- Task `:generateHtmlReportJavaScript` of type `com.moowork.gradle.node.npm.NpxTask`: cannot serialize object of type 'com.moowork.gradle.node.npm.NpmInstallTask', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
  See https://docs.gradle.org/7.5/userguide/configuration_cache.html#config_cache:requirements:task_access
- Task `:generateHtmlReportJavaScript` of type `com.moowork.gradle.node.npm.NpxTask`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.
  See https://docs.gradle.org/7.5/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:installAndroidSdk` of type `tasks.InstallAndroidSdkTask`: cannot serialize Gradle script object references as these are not supported with the configuration cache.
  See https://docs.gradle.org/7.5/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:npmInstall` of type `com.moowork.gradle.node.npm.NpmInstallTask`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.
  See https://docs.gradle.org/7.5/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:npmSetup` of type `com.moowork.gradle.node.npm.NpmSetupTask`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.
  See https://docs.gradle.org/7.5/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:test` of type `org.gradle.api.tasks.testing.Test`: cannot serialize Gradle script object references as these are not supported with the configuration cache.
  See https://docs.gradle.org/7.5/userguide/configuration_cache.html#config_cache:requirements:disallowed_types

So node plugin needs upgrade and there are also two issues in our scripts with AndroidStudioSystemProperties and installAndroidSdk.onlyIf(). I will leave this PR open till someone finds time to fix it.

@asodja
Copy link
Member

asodja commented Aug 10, 2022

Note to future reader: upgrade of node seems easy, onlyIf can be fixed with:

val installAndroidSdk = tasks.register<InstallAndroidSdkTask>("installAndroidSdk") {
    ...
    val autoDownloadAndroidSdk = extension.autoDownloadAndroidSdk
    onlyIf { autoDownloadAndroidSdk.get() }
}

AndroidStudioSystemProperties problem seems it needs some more attention.

@liutikas
Copy link
Contributor Author

Thank you!

It seems we have some problems that need to be fixed before we use cc, e.g. ./gradlew test --dry-run shows:

6 problems were found storing the configuration cache.
- Task `:generateHtmlReportJavaScript` of type `com.moowork.gradle.node.npm.NpxTask`: cannot serialize object of type 'com.moowork.gradle.node.npm.NpmInstallTask', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
  See https://docs.gradle.org/7.5/userguide/configuration_cache.html#config_cache:requirements:task_access
- Task `:generateHtmlReportJavaScript` of type `com.moowork.gradle.node.npm.NpxTask`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.
  See https://docs.gradle.org/7.5/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:installAndroidSdk` of type `tasks.InstallAndroidSdkTask`: cannot serialize Gradle script object references as these are not supported with the configuration cache.
  See https://docs.gradle.org/7.5/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:npmInstall` of type `com.moowork.gradle.node.npm.NpmInstallTask`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.
  See https://docs.gradle.org/7.5/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:npmSetup` of type `com.moowork.gradle.node.npm.NpmSetupTask`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.
  See https://docs.gradle.org/7.5/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:test` of type `org.gradle.api.tasks.testing.Test`: cannot serialize Gradle script object references as these are not supported with the configuration cache.
  See https://docs.gradle.org/7.5/userguide/configuration_cache.html#config_cache:requirements:disallowed_types

So node plugin needs upgrade and there are also two issues in our scripts with AndroidStudioSystemProperties and installAndroidSdk.onlyIf(). I will leave this PR open till someone finds time to fix it.

That's why my PR sets it to warn mode. This will still build and run with configuration cache when you are not invoking the problematic tasks. When these tasks are in the task graph it will just act as if configuration cache was not on. So I think it is beneficial to land my PR as is without further patches and then follow up later to fix these issues.

@asodja asodja force-pushed the patch-4 branch 2 times, most recently from 61833da to aba7576 Compare August 12, 2022 14:31
@asodja asodja merged commit 5aed1c8 into gradle:master Aug 12, 2022
@asodja
Copy link
Member

asodja commented Aug 12, 2022

Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Internal change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants