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

Gradle: Ensure Gradle configuration Cache #3126

Closed
manusa opened this issue Jun 3, 2024 · 2 comments
Closed

Gradle: Ensure Gradle configuration Cache #3126

manusa opened this issue Jun 3, 2024 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@manusa
Copy link
Member

manusa commented Jun 3, 2024

Description

Mirror of fabric8io/kubernetes-client#6038

In order to support Gradle's configuration cache, having the Project object in extensions/tasks is not allowed https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:disallowed_types. We can avoid that by injecting the ProjectLayout object directly which is legal.

There are a number of types that task instances must not reference from their fields.
These types fall into some categories as follows:

  • Live JVM state types
  • Gradle model types
  • Dependency management types

In all cases the reason these types are disallowed is that their state cannot easily be stored or recreated by the configuration cache.

Specifically

Gradle model types (e.g. Gradle, Settings, Project, SourceSet, Configuration etc…​) are usually used to carry some task input that should be explicitly and precisely declared instead.

@Sineaggi

@manusa manusa added the bug Something isn't working label Jun 3, 2024
@manusa manusa added this to the 1.17.0 milestone Jun 3, 2024
@manusa manusa moved this to Planned in Eclipse JKube Jun 5, 2024
@manusa manusa self-assigned this Jun 14, 2024
@manusa manusa moved this from Planned to In Progress in Eclipse JKube Jun 14, 2024
@manusa
Copy link
Member Author

manusa commented Jun 14, 2024

Issue can be checked with command ./gradlew --configuration-cache clean build k8sBuild in the quickstarts/gradle/spring-boot

* What went wrong:
Configuration cache problems found in this build.

1 problem was found storing the configuration cache.
- Task `:k8sBuild` of type `org.eclipse.jkube.gradle.plugin.task.KubernetesBuildTask`: invocation of 'Task.project' at execution time is unsupported.
  See https://docs.gradle.org/8.7/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution

Due to the complexity of the operations performed at GradleUtil.convertGradleProject and the requirement for multiple project entries (maybe some only available at runtime), it's going to be almost impossible to fix this issue.

I'd suggest to close as won't fix.
I'd only invest more time on this in case this feature becomes critical for some user.

@manusa manusa moved this from In Progress to Review in Eclipse JKube Jun 14, 2024
@rohanKanojia rohanKanojia closed this as not planned Won't fix, can't repro, duplicate, stale Jun 25, 2024
@github-project-automation github-project-automation bot moved this from Review to Done in Eclipse JKube Jun 25, 2024
@rohanKanojia rohanKanojia reopened this Jun 25, 2024
@github-project-automation github-project-automation bot moved this from Done to Planned in Eclipse JKube Jun 25, 2024
@rohanKanojia
Copy link
Member

I think we can close this one for now.

@rohanKanojia rohanKanojia closed this as not planned Won't fix, can't repro, duplicate, stale Jun 25, 2024
@github-project-automation github-project-automation bot moved this from Planned to Done in Eclipse JKube Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants