question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for Gradle Configuration Cache

See original GitHub issue

Environment:

  • Jib version: 2.8.0
  • Build tool: Gradle 6.8.1
  • OS: Mac

Description of the issue:

Gradle 6.8 has a new configuration cache feature that helps to improve build performance. Unfortunately, there are some restrictions on what plugins can use and jib is currently not compatible with this. I don´t think that jib, in particular, is bad wrt to build performance, still, I think it would be cool if it supports the configuration cache at some point 😃

Steps to reproduce:

  1. gradle --configuration-cache jib

Log output:

- Task `:html5-controller:jib` of type `com.google.cloud.tools.jib.gradle.BuildImageTask`: 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/6.8.1/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:html5-controller:jib` of type `com.google.cloud.tools.jib.gradle.BuildImageTask`: invocation of 'Task.project' at execution time is unsupported.
  See https://docs.gradle.org/6.8.1/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:14
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wwadgecommented, Oct 5, 2022

If you’re in need of workaround:

['jibDockerBuild', 'jibBuildTar', 'jib'].each { taskName ->
    getTasksByName(taskName, true).each(it -> {
        it.notCompatibleWithConfigurationCache("Jib is not compatible with configuration cache");
         }); }```
0reactions
rocketramancommented, Dec 7, 2022

Thank you @wwadge , this version seems to work for Kotlin DSL:

// workaround https://github.com/GoogleContainerTools/jib/issues/3132
tasks.filter { it.name in setOf("jibDockerBuild", "jibBuildTar", "jib") }.onEach {
  it.notCompatibleWithConfigurationCache("Jib is not compatible with configuration cache")
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration cache - Gradle User Manual
The configuration cache takes care of caching the build configuration for a particular set of tasks. In other words, the configuration cache saves...
Read more >
How to I enable Gradle configuration cache feature persistently?
The configuration cache takes care of caching the build configuration for a particular set of tasks. In other words, the configuration cache ......
Read more >
Gradle Configuration Caching — Replacing ... - ProAndroidDev
Gradle recently rolled out a new feature called the “configuration cache” aimed at “significantly improving build performance by caching the result of the ......
Read more >
Configuration caching deep dive - Medium
gradle /configuration-cache directory ). It is able to serialize all Gradle-managed types (e.g. FileCollection , Property , Provider ) and all ...
Read more >
Incompatibility issue with Gradle configuration cache #7299
The configuration cache is a feature that significantly improves build performance by caching the result of the configuration phase and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found