CristianGM
06/16/2022, 9:34 AM@get:InputFiles
@get:PathSensitive(PathSensitivity.RELATIVE)
abstract val inputFiles: ConfigurableFileCollection
and I set the value like:
inputFiles.from(fileTree("src/main/resources/myfiles").sortedBy { it.name })
Why the task ouput is not changing when I add or remove files from that folder?Javi
06/16/2022, 5:20 PM// Plugin extension property
@get:InputFiles public abstract val gitDirs: ConfigurableFileCollection
// config it by adding the entire `.git` file tree
extensions.create<SemverExtension>(extensionName).apply {
val files: List<File> =
project.file("${rootProject.rootDir}/.git").walkTopDown().toList()
gitDirs.from(files)
}
I would expect that the configuration cache was discarded after changing any staged file, but it is being reused, I have even tried creating and adding a new file to git.David Chang
06/22/2022, 4:43 AMgradle.getTasks().whenTasksAdded()
along with gradle.afterProject
or project.afterEvaluate
and I'm not able to get the same taskState I'm depending on.
I'm trying to log to buildScan when a task is being skippedSlackbot
06/22/2022, 7:50 AMMatthieu Ghilain
06/22/2022, 4:03 PM` of type `org.gradle.api.DefaultTask`: cannot serialize Gradle script object references as these are not supported with the configuration cache.
See <https://docs.gradle.org/7.4.2/userguide/configuration_cache.html#config_cache:requirements:disallowed_types>
David Chang
06/23/2022, 11:50 PMTapchicoma
06/27/2022, 9:28 AMJavi
06/28/2022, 10:31 AMwithDebug(false)
using the configuration cache in the test project, the test fails, if I set withDebug(true)
it passes.
Stacktrace in the 🧵René
06/28/2022, 2:52 PMpublic class CopyRestTestsTask extends DefaultTask {
...
...
private Function<FileCollection, FileTree> additionalConfigToFileTree = FileCollection::getAsFileTree;
...
...
...
public void setAdditionalConfigToFileTree(Function<FileCollection, FileTree> additionalConfigToFileTree) {
this.additionalConfigToFileTree = additionalConfigToFileTree;
}
...
...
}
when running a build (or lets better say a test where I test the behaviour, when reusing the configuration cache I see this error:
* What went wrong:
Could not load the value of field `additionalConfigToFileTree` of task `:copyYamlTestsTask` of type `org.elasticsearch.gradle.internal.test.rest.CopyRestTestsTask`.
> org.elasticsearch.gradle.internal.test.rest.CopyRestTestsTask$$Lambda$742/0x0000000801226c48
...
...
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
Caused by: java.lang.ClassNotFoundException: org.elasticsearch.gradle.internal.test.rest.CopyRestTestsTask$$Lambda$742/0x0000000801226c48
at org.gradle.configurationcache.serialization.DefaultReadContext.readClass(Contexts.kt:263)
I wonder what the best approach for handling lambdas or should they just completely be avoided. Is there a general recommendation on how to handle those kind of scenarios?David Chang
06/28/2022, 11:22 PMRead system property 'kotlinx.coroutines.debug'
Exception
org.gradle.configurationcache.ConfigurationCacheProblemsException: Configuration cache problems found in this build.
1 problem was found storing the configuration cache.
- Plugin 'com.my-company.gradle-enterprise-plugin': read system property 'kotlinx.coroutines.debug'
See <https://docs.gradle.org/7.3.3/userguide/configuration_cache.html#config_cache:requirements:undeclared_sys_prop_read>
Caused by: org.gradle.api.InvalidUserCodeException: Read system property 'kotlinx.coroutines.debug'
at org.gradle.configurationcache.SystemPropertyAccessListener.systemPropertyQueried(SystemPropertyAccessListener.kt:92)
at org.gradle.internal.classpath.Instrumented.systemProperty(Instrumented.java:83)
at org.gradle.internal.classpath.Instrumented.systemProperty(Instrumented.java:77)
at kotlinx.coroutines.internal.SystemPropsKt__SystemPropsKt.systemProp(SystemProps.kt:17)
at kotlinx.coroutines.internal.SystemPropsKt.systemProp(Unknown Source)
at kotlinx.coroutines.DebugKt.<clinit>(Debug.kt:70)
at kotlinx.coroutines.CoroutineContextKt.newCoroutineContext(CoroutineContext.kt:20)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:49)
at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
at com.my-company.android.buildtools.Shelly.executeCommand(Shelly.kt:29)
at com.my-company.android.buildtools.Shelly.executeCommand$default(Shelly.kt:24)
at com.my-company.android.plugins.gradle.scan.CustomBuildScanEnhancements.captureOs(CustomBuildScanEnhancements.kt:128)
This is coming from our internal Shelly
tool which makes a call at line 29 to:
): Result = runBlocking { suspendingExecuteCommand(command, environment, ttl, ttlUnit) }
Which then hits https://github.com/Kotlin/kotlinx.coroutines/blob/5eca49cfcb25acefaf10ec9b997de537c653b47e/kotlinx-coroutines-core/jvm/src/Debug.kt#L70
Not entirely sure how to work around this besides using a different way to interact with shellJosh Feinberg
06/29/2022, 8:41 PMaddBuildListener
is not config cache compatible, what is the best replacement for if i want to run a function when my build is complete? previously i had
gradle.addBuildListener(object : BuildAdapter() {
override fun buildFinished(result: BuildResult) {
onComplete(logger.buildString())
}
})
but now when i try to convert to a build service i'm not sure how I can pass that onComplete
lambda into my BuildService. i've tried doing service.parameters.onComplete = buildCompleteListener
but i get that it can't serialize my objectsRyan Schmitt
07/01/2022, 12:29 AMclean
task in order to delete directories from a local Maven repository. For each project, I need the groupId
and artifactId
of each MavenPublication
so that I know which directories to delete. The problem is that those fields are simple String
fields and not properties, so their values aren't necessarily correct until the start of the execution phase (e.g. when using java-gradle-plugin
, which seems to configure the publication for the marker plugin very late). However, none of the higher-level types like MavenPublication
are serializable. Is there currently any way to do this without breaking configuration caching?Josh Feinberg
07/06/2022, 8:34 PMapply
method (https://github.com/dropbox/AffectedModuleDetector/blob/main/affectedmoduledetector[…]/dropbox/affectedmoduledetector/AffectedModuleDetectorPlugin.kt) we configure it add add the extension here (https://github.com/dropbox/AffectedModuleDetector/blob/main/affectedmoduledetector[…]in/com/dropbox/affectedmoduledetector/AffectedModuleDetector.kt). this stores properly in the cache but it fails when running again saying the extension isn't added since the apply
block isn't ran again. is there a config cacheable way to handle this?Javi
07/10/2022, 11:17 PMRené
07/12/2022, 6:08 AMtony
07/12/2022, 6:12 PM-Dorg.gradle.debug=true
doesn't invalidate the configuration cache 🤔Ryan Schmitt
07/12/2022, 11:16 PMMavenPublication
serializable, and/or to provide new APIs that are compatible with configuration caching?tony
07/18/2022, 8:34 PMnotCompatibleWithConfigurationCache()
? I'm looking at such a report (where the cache entry was discarded due to use of that API), and I can't find anything in the report about it. That would be helpful when answer questions from developers like "why was the cache entry discarded when gradle says it had no issues storing the cache?"CristianGM
07/20/2022, 11:30 PMCristianGM
07/20/2022, 11:31 PMJan Rabe
07/21/2022, 11:04 AMJavi
07/26/2022, 8:26 AMFTR, we are working on a more comprehensive solution to the whole problem of migrating scalar properties to the Provider/Property API. No timeline yet though.Is there more info about this?
guillaume le floch
07/27/2022, 7:05 AMDependencyHandler
and ConfigurationContainer
? But for project siblings ?Justin Morris
07/27/2022, 3:57 PMValueSource
. Even when using the exact example code for GitVersionValueSource
from the docs I always receive this error:
No service of type ExecOperations available in DefaultServiceRegistry.
I'm targeting Gradle 7.5.. Any thoughts?Mike Cumings
08/08/2022, 10:08 PMRyan Schmitt
08/24/2022, 2:47 AMtransient
field on a ValueSourceParameters
type? I'm getting a NotSerializableException
even though Kotlin's @Transient
annotation solved this problem for tasks with non-serializable fieldsTapchicoma
08/26/2022, 3:08 PM0 problems were found storing the configuration cache.
and then in the end of the same build:
Configuration cache entry discarded.
Mike Cumings
08/26/2022, 7:45 PMorg.gradle.unsafe.configuration-cache-problems=warn
is set, config cache issues are reported to the console but apparently also written out to disk, causing subsequent builds to fail while deserializing the config cache entry. Is there any mode of operation where config cache issues are detected and reported but do not cause the build to fail nor cause the invalid cache entry to be written to disk?Vampire
09/01/2022, 8:58 PMROOT=$(git rev-parse --show-cdup) ...
Another way would be
$(git rev-parse --show-cdup)/gradlew wrapper
but this needs significantly longer than just copying the files. 🙂Vampire
09/01/2022, 9:00 PM