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

Incompatible with Gradle configuration cache #2594

Open
trevjonez opened this issue Jul 11, 2024 · 4 comments
Open

Incompatible with Gradle configuration cache #2594

trevjonez opened this issue Jul 11, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@trevjonez
Copy link

Describe the bug

The logic injected via init script is not compatible with gradle configuration caching.

Current behavior

Build invocation fails with the following error.

invocation of Task.project at execution time is unsupported.
  task:generateDepTrees of type com.jfrog.tasks.GenerateDepTrees

Exception at com.jfrog.tasks.GenerateDepTrees.getInputFile(GenerateDepTrees.java:65)
org.gradle.api.InvalidUserCodeException: Invocation of 'Task.project' by task ':generateDepTrees' at execution time is unsupported.
	at org.gradle.api.DefaultTask.getProject(DefaultTask.java:59)
	at com.jfrog.tasks.GenerateDepTrees.getInputFile(GenerateDepTrees.java:65)
	at com.jfrog.tasks.GenerateDepTrees_Decorated.getInputFile(Unknown Source)
	at org.gradle.internal.properties.bean.DefaultPropertyWalker$CachedPropertyValue.lambda$new$0(DefaultPropertyWalker.java:107)
	at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:181)
	at java.base/java.lang.Thread.run(Thread.java:840)
⌄Exception at com.jfrog.tasks.GenerateDepTrees.getRelatedProjects(GenerateDepTrees.java:128)
org.gradle.api.InvalidUserCodeException: Invocation of 'Task.project' by task ':generateDepTrees' at execution time is unsupported.
	at org.gradle.api.DefaultTask.getProject(DefaultTask.java:59)
	at com.jfrog.tasks.GenerateDepTrees.getRelatedProjects(GenerateDepTrees.java:128)
	at com.jfrog.tasks.GenerateDepTrees.getOutputFiles(GenerateDepTrees.java:80)
	at com.jfrog.tasks.GenerateDepTrees_Decorated.getOutputFiles(Unknown Source)
	at org.gradle.internal.properties.bean.DefaultPropertyWalker$CachedPropertyValue.lambda$new$0(DefaultPropertyWalker.java:107)
	at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:181)
	at java.base/java.lang.Thread.run(Thread.java:840)
⌄Exception at com.jfrog.tasks.GenerateDepTrees.getRelatedProjects(GenerateDepTrees.java:131)
org.gradle.api.InvalidUserCodeException: Invocation of 'Task.project' by task ':generateDepTrees' at execution time is unsupported.
	at org.gradle.api.DefaultTask.getProject(DefaultTask.java:59)
	at com.jfrog.tasks.GenerateDepTrees.getRelatedProjects(GenerateDepTrees.java:131)
	at com.jfrog.tasks.GenerateDepTrees.getOutputFiles(GenerateDepTrees.java:80)
	at com.jfrog.tasks.GenerateDepTrees_Decorated.getOutputFiles(Unknown Source)
	at org.gradle.internal.properties.bean.DefaultPropertyWalker$CachedPropertyValue.lambda$new$0(DefaultPropertyWalker.java:107)
	at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:181)
	at java.base/java.lang.Thread.run(Thread.java:840)

Reproduction steps

Attempt to run with the configuration cache enabled.

Expected behavior

injected build logic shouldn't fail built in validation for configuration cache.
https://docs.gradle.org/8.8/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution

likely to set you on a path toward supporting project isolation eventually as well.
https://docs.gradle.org/current/userguide/isolated_projects.html

JFrog CLI version

2.53.2

Operating system type and version

linux

JFrog Artifactory version

No response

JFrog Xray version

No response

@trevjonez trevjonez added the bug Something isn't working label Jul 11, 2024
@trevjonez
Copy link
Author

Code at issues is likely this project: https://github.com/jfrog/gradle-dep-tree

@alexanderjohn
Copy link

This is still an issue as of Jfrog-CLI version 2.71.2

@yahavi
Copy link
Member

yahavi commented Oct 30, 2024

@trevjonez @alexanderjohn
Thank you for reporting this issue!
Could you please specify the command you ran?

@trevjonez
Copy link
Author

Which ever one is this class com.jfrog.tasks.GenerateDepTrees at least for starters. It possible and likely there are other issues hidden behind this one.

Typically I will just enable configuration cache on my gradle test kit tests and iterate through the issues whenever its some new gradle warning or error like this.

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

3 participants