Zak Taccardi
02/01/2022, 11:17 PMStartParameter
is passed?
Use case is to disable the configuration cache whenever a command line gradle property is passed to workaround https://github.com/gradle/gradle/issues/19474Jendrik Johannes
02/02/2022, 9:05 AMResolvedArtifactResult
as task input (https://github.com/gradle/gradle/pull/19119). Is there an issue to track the progress and get notified once this is available? (I couldn’t find one linked from the PR.)
I am writing a task now that needs ResolvedArtifactResult
(or something similar). Can/should I declare the input of my task like this already?
@InputFiles abstract SetProperty<ResolvedArtifactResult> getResolvedArtifacts()
I guess I could set that using provider { configurations.runtimeClasspath.... }
. But I probably loose the the dependencies then. 🤔
Or should I just use the Configuration
as input directly for now?
@InputFiles abstract Provider<Configuration> getResolvedArtifacts()
Does that work (without configuration cache)?Nikolay
02/14/2022, 4:42 PMbuild.gradle.kts
file but it still reports the same erorr:
tasks.koverMergedHtmlReport {
notCompatibleWithConfigurationCache("Not Sure")
}
17 problems were found storing the configuration cache, 7 of which seem unique.
- Task `:koverMergedHtmlReport` of type `kotlinx.kover.tasks.KoverMergedHtmlReportTask`: cannot serialize object of type 'org.gradle.api.tasks.testing.Test', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
See <https://docs.gradle.org/7.4/userguide/configuration_cache.html#config_cache:requirements:task_access>
- Task `:koverMergedVerify` of type `kotlinx.kover.tasks.KoverMergedVerificationTask`: cannot serialize object of type 'org.gradle.api.tasks.testing.Test', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
See <https://docs.gradle.org/7.4/userguide/configuration_cache.html#config_cache:requirements:task_access>
- Task `:koverMergedXmlReport` of type `kotlinx.kover.tasks.KoverMergedXmlReportTask`: cannot serialize object of type 'org.gradle.api.tasks.testing.Test', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
See <https://docs.gradle.org/7.4/userguide/configuration_cache.html#config_cache:requirements:task_access>
- Task `:koverVerify` of type `kotlinx.kover.tasks.KoverVerificationTask`: cannot serialize object of type 'org.gradle.api.tasks.testing.Test', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
See <https://docs.gradle.org/7.4/userguide/configuration_cache.html#config_cache:requirements:task_access>
- Task `:utils:common:koverVerify` of type `kotlinx.kover.tasks.KoverVerificationTask`: cannot serialize object of type 'org.gradle.api.tasks.testing.Test', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
See <https://docs.gradle.org/7.4/userguide/configuration_cache.html#config_cache:requirements:task_access>
- Task `:utils:common:test` of type `org.gradle.api.tasks.testing.Test`: cannot serialize object of type 'org.gradle.api.internal.artifacts.configurations.DefaultConfiguration', a subtype of 'org.gradle.api.artifacts.Configuration', as these are not supported with the configuration cache.
See <https://docs.gradle.org/7.4/userguide/configuration_cache.html#config_cache:requirements:disallowed_types>
- Task `:utils:common:test` of type `org.gradle.api.tasks.testing.Test`: 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.4/userguide/configuration_cache.html#config_cache:requirements:disallowed_types>
Sinan Kozak
02/14/2022, 10:01 PMCalculating task graph as configuration cache cannot be reused because system property 'java.awt.headless' has changed.
Sinan Kozak
02/14/2022, 10:02 PMMartin
03/11/2022, 10:53 PMproject.rootDir
in a task in a configuration-cache compatible manner?Mike Cumings
03/31/2022, 9:13 PMgradle.taskGraph.afterTask
? (contd. in 🧵 )tony
04/01/2022, 7:17 PMfield repository of org.gradle.api.publish.maven.tasks.PublishToMavenRepository$RepositorySpec$UnsupportedRepositorySpec
It looks like it's referring to this field:
public class PublishToMavenRepository extends AbstractPublishToMaven {
private final Var<MavenArtifactRepository> repository = Transient.varOf();
but I'm not sure. I still have some trouble reading these CC issue reportseric
04/03/2022, 4:46 PMrootProject.extensions.getByType<MyPlugin>().applyJacoco
to determine whether or not it should be applied. What’s the project isolation-safe way to do this?tony
04/08/2022, 10:17 PM1 problem was found storing the configuration cache.
- Task `:app:resignDebug` of type `com.company.ReSignTask`: value 'map(org.gradle.api.file.RegularFile map(property(org.gradle.api.file.Directory, property(org.gradle.api.file.Directory, property(org.gradle.api.file.Directory, map(org.gradle.api.file.Directory flatmap(provider(task 'packageDebug', class com.android.build.gradle.tasks.PackageApplication)) check-type()))))) check-type())' failed to unpack provider
Any idea why this failure would appear in a test context but not when executed in a real context? It is admittedly a fairly complex chain of providers...
(Gradle 7.4.1, AGP 7.0.4)Gasper Kojek
04/19/2022, 10:22 AMCalculating task graph as configuration cache cannot be reused because the set of Gradle properties has changed.
How can I find out which properties (that affect configuration cache) are changed? There should be no changes, as this pops up even on builds on the same commit?CristianGM
04/22/2022, 1:29 PMval testApkDir: Provider<Directory> = ...
val builtArtifactsLoader: BuiltArtifactsLoader = ... // That's from Android Gradle Plugin
myTask.configure {
// testApk is RegularFileProperty, and I want to keep the dependency to the task generating it
testApk.value(
testApkDir.map {
it.file(builtArtifactsLoader.load(it)!!.elements.single().outputFile)
}
)
}
And then configuration cache complains that:
- Task :myTask
of type `MyTask`: value map(org.gradle.api.file.RegularFile map(property(org.gradle.api.file.Directory, property(org.gradle.api.file.Directory, property(org.gradle.api.file.Directory, map(org.gradle.api.file.Directory flatmap(provider(task 'packageDebugAndroidTest', class com.android.build.gradle.tasks.PackageApplication)) check-type()))))) check-type())
failed to unpack provider
Any clue? (I know the chain of map
and flatMap
seems quite complex)
Without CC it works perfectlytony
04/23/2022, 6:12 PMabstract class PrintMessageTask : DefaultTask() {
@get:Input
abstract val inputMessage: Property<String>
@get:OutputFile
abstract val outputFile: RegularFileProperty
@TaskAction
fun run() {
val message = inputMessage.get()
println(message)
outputFile.asFile.get().writeText(message)
}
}
project.tasks.register<PrintMessageTask>("printMessage") {
inputMessage.set(kotlin.random.Random.Default.nextInt().toString())
outputFile.set(
project.layout.buildDirectory.file(
"outputs/logs/message.txt"))
}
Do you think that task will always be up to date, or never up to date? Do you think the answer changes if you're using the configuration cache?Jonathan Schear
04/28/2022, 6:13 PMsecurity
command on macOS to fetch a password for a maven repo from the keychain.)
ValueSource seems like the right way to model such a thing:
Represents an external source of information used by a Gradle build. Examples of external sources include client environment variables, system properties, configuration files, shell commands, network services, among others.Unfortunately I'm not able to
@Inject
an instance of ExecOperations
in the constructor for a ValueSource
, and passing one in through ValueSourceParameters
gives me Could not serialize value of type DefaultExecOperations
.
Is it possible to do this in a configuration-caching-friendly way?Javi
05/12/2022, 11:24 AMproject.gradle.taskGraph.beforeTask
Is there any alternative?René
05/12/2022, 7:06 PMtony
05/12/2022, 8:07 PMThis release introduces the STABLE_CONFIGURATION_CACHE flag allowing gradual rollout of the most potentially disruptive requirements. This flag currently enables validations like detecting undeclared shared build service usage and external processes used at configuration time.I'm a bit unclear on what this means. What would happen if I enabled that flag on a build that didn't have CC on? On a build that did have it on? If I run a task that isn't compatible with CC in either of those scenarios?
Sam Edwards
05/12/2022, 8:54 PMtask.notCompatibleWithConfigurationCache()
when org.gradle.unsafe.configuration-cache-problems=warn
is set in all permutations.
This has been reproduced/confirmed by @tony and @Josh Feinberg.
Link: https://github.com/gradle/gradle/issues/20765tony
05/17/2022, 9:00 PMnotCompatibleWithConfigurationCache("")
, I'm still getting an error when invoking it while CC is on. What's up with that?
* What went wrong:
Configuration cache state could not be cached: field 'dependencyFactory$delegate' from type 'com.squareup.dependencies.gradle.task.ForbidDependenciesTask': error writing value of type 'org.gradle.internal.service.scopes.ProjectScopeServices'
...
Gianfranco Monzon
05/18/2022, 2:24 AMSettings.getProviders()
is not working (https://docs.gradle.org/7.5-rc-1/javadoc/org/gradle/api/provider/ProviderFactory.html)
def hasVpnConnection() {
//Function to check if we have connection to our VPN
}
def connectionProvider = settings.providers.provider { hasVpnConnection() }
def hasConnection = connectionProvider.get()
println "Remote cache enabled: $hasConnection"
buildCache {
remote(HttpBuildCache) {
enabled = hasConnection
push = false
url = "$url/cache/"
}
}
However, after disconnecting from the VPN, Gradle still tries to use the remote build cache.
I'm using Gradle 7.4.2 and AGP 7.1.3Chris Lee
05/19/2022, 11:11 PMMarkus Maier
05/20/2022, 6:59 AMTim van der Lippe
05/23/2022, 1:44 PMgetProject()
call in Gradle internals: https://github.com/gradle/gradle/blob/d0d8706df4f115ad9c6e9127c93ec377b5959fff/sub[…]esting-jvm/src/main/java/org/gradle/api/tasks/testing/Test.java We are triggering this warning (we have yet to figure out which task, since the gradle configuration cache error appears to hide it). Would it be possible to remove the getProject()
here and retrieve it from the task?AG
05/24/2022, 5:56 PMChi Cuong Le
05/26/2022, 8:06 PMnotCompatibleWithConfigurationCache
as follow tasks.configureEach{notCompatibleWithConfigurationCache("some reason")}
. My configuration works properly on my developer windows machine, but does not work in Jenkins agents that have Red Hat as operating system. Builds on jenkins are always failed because of jib tasks. Anyone in have similar issue and any advice for such issue?tony
05/26/2022, 11:48 PMenableFeaturePreview "STABLE_CONFIGURATION_CACHE"
as well (in an experimental branch)tony
05/27/2022, 7:29 PM@Transient
@get:PathSensitive(PathSensitivity.RELATIVE)
@get:InputFiles
lateinit var projectHealthReports: Configuration
Specifically, I've added @Transient
so that Gradle doesn't serialize the Configuration
instance. For input hashing, I want it to treat the property as a collection of files, but in the task action I use APIs only available on Configuration
Slackbot
06/09/2022, 8:28 PMJavi
06/12/2022, 4:35 PMprovider { ... }
where I calculate a version inside it based on the last git commit hash.
I have a task where I add this provider
when I register it, this task prints the version, so I would expect that if the last commit is changed (or any change in the git repo state), the configuration cache was reused but the task should print the new commit hash because the provider would be recomputed, but it is printing the old one.René
06/13/2022, 1:41 PM