Eug
05/27/2024, 11:42 AMRené
05/29/2024, 2:14 PMpackage org.elasticsearch.test.cluster;
import org.elasticsearch.test.cluster.util.Version;
/**
* Elasticsearch feature flags. Used in conjunction with {@link org.elasticsearch.test.cluster.local.LocalSpecBuilder#feature(FeatureFlag)}
* to indicate that this feature is required and should be enabled when appropriate.
*/
public enum FeatureFlag {
TIME_SERIES_MODE("es.index_mode_feature_flag_registered=true", Version.fromString("8.0.0"), null),
FAILURE_STORE_ENABLED("es.failure_store_feature_flag_enabled=true", Version.fromString("8.12.0"), null),
SEMANTIC_TEXT_ENABLED("es.semantic_text_feature_flag_enabled=true", Version.fromString("8.15.0"), null);
public final String systemProperty;
public final Version from;
public final Version until;
FeatureFlag(String systemProperty, Version from, Version until) {
this.systemProperty = systemProperty;
this.from = from;
this.until = until;
}
}
when building with configuration-cache enabled I see this error message:
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
Caused by: java.lang.IllegalStateException: Failed to create instance of org.elasticsearch.gradle.testclusters.ElasticsearchNode$FeatureFlag with args [es.index_mode_feature_flag_registered, 8.0.0, null]
at org.gradle.configurationcache.serialization.codecs.JavaRecordCodec.decode(JavaRecordCodec.kt:47)
at org.gradle.configurationcache.serialization.codecs.JavaRecordCodec$decode$1.invokeSuspend(JavaRecordCodec.kt)
... 163 more
Caused by: java.lang.NoSuchMethodException: org.elasticsearch.gradle.testclusters.ElasticsearchNode$FeatureFlag.<init>(java.lang.String,org.elasticsearch.gradle.Version,org.elasticsearch.gradle.Version)
at org.gradle.configurationcache.serialization.codecs.JavaRecordCodec.decode(JavaRecordCodec.kt:45)
... 164 more
It seems like a general serialisation issue with gradle. Is there anyting we can do from our side to work around / fix this issue?tony
06/18/2024, 6:51 PMProject.findProperty()
(and related) APIs? Tracing that code, it looks like a holdover from the old Groovy/dynamic days, as it accesses project "properties" hierarchically from closest to farthest, all the way back to the root if necessary.
use-case: it is pretty common in a lot of repos to have subproject/gradle.properties
files to define properties that aren't global. However, properties defined there aren't available via providers.gradleProperty()
, they're only available via project.findProperty()
and whatnot.Harshit CWS
09/03/2024, 3:56 AMCould not create task 'react native google paycompileReleaseJavaWithJavac'.> In order to compile Java 9+ source, please set compileSdkVersion to 30 or above In my android/build.gradle,i have: buildscript { ext { buildToolsVersion = "34.0.0" minSdkVersion = 23 compileSdkVersion = 34 targetSdkVersion = 34 ndkVersion = "26.1.10909125" kotlinVersion = "1.9.22" } repositories { google() mavenCentral() } dependencies { classpath("com.android.tools.buildG8.2.1") // classpath("com.android.tools.build:gradle") classpath("com.facebook.react:react-native-gradle-plugin") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin") } } apply plugin: "com.facebook.react.rootproject"
Bartosz Galek
09/04/2024, 10:52 AMproject.version
after release
task (in execution phase).
It works when configuration-cache
is disabled. I marked my release
task as notCompatibleWithConfigurationCache
. When configuration-cache
is enabled, some other places have old version cached (like maven publication) - which is of course expected.
Is it possible to "invalidate" project.version
from cache?
Or "exclude" project.version
so this value alone wont be cached?
Have you stumbled upon this problem?
Example:
//...assuming maven-publish configured
version = "1"
tasks {
register("changeVersion") {
notCompatibleWithConfigurationCache("")
doLast {
version = "12345"
}
}
}
works:
./gradlew changeVersion publishToMavenLocal
doesn't work:
./gradlew changeVersion publishToMavenLocal --configuration-cache
Execution failed for task ':generateMetadataFileForPluginMavenPublication'.
> java.io.FileNotFoundException: ~/IdeaProjects/name/build/libs/name-1.jar (No such file or directory)
(name-1.jar instead of name-12345.jar)Nicklas Ansman
09/04/2024, 2:39 PMsourceSet.kotlin
as an input. But since KSP generates source code which is in turn added to the sourceset they do this:
sourceSet.kotlin.nonSelfDeps(kspTaskName)
internal fun FileCollection.nonSelfDeps(selfTaskName: String): List<Task> =
buildDependencies.getDependencies(null).filterNot {
it.name == selfTaskName
}
Calling TaskDependency.getDependencies
is a PI violation. Is there another way to achieve the same result?Javi
09/05/2024, 10:03 AMsettings.gradle.allprojects
(and all APIs like it) incompatible with project isolation? I was thinking it was a valid API 🤔Nicklas Ansman
09/05/2024, 11:20 AMAbdoulaye ISSIAKA
09/19/2024, 12:02 PMAbdoulaye ISSIAKA
09/19/2024, 12:05 PMAbdoulaye ISSIAKA
09/19/2024, 12:08 PMCould not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.> Namespace not specified. Specify a namespace in the module's build file. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace. If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant. * Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.BUILD FAILED in 8m 54s Error: Gradle task assembleDebug failed with exit code 1 Exited (1).
Bernát Gábor
09/20/2024, 9:21 PMval parallelCount = (Runtime.getRuntime().availableProcessors() / 2).takeIf { it > 0 } ?: 1
tasks.register("showParallelCount") {
group = "Verification"
description = "Show number of cores the test will be run on"
doFirst {
project.logger.warn("Tests will run on $parallelCount parallel JVMs")
}
}
Bernát Gábor
09/20/2024, 9:38 PM- Task `:jacocoTestReport` of type `org.gradle.testing.jacoco.tasks.JacocoReport`: cannot serialize Gradle script object references as these are not supported with the configuration cache.
Any ideas here?Giuseppe Barbieri
09/26/2024, 7:13 AMsignArchives
invokes Task.project
at execution time
tasks.withType<Sign>().configureEach {
onlyIf { project.hasProperty("release") }
}
How shall this be transformed?Javi
09/26/2024, 4:53 PM* What went wrong:
Execution failed for task ':semver-settings-gradle-plugin:publishPlugins'.
> Extension of type 'GradlePluginDevelopmentExtension' does not exist. Currently registered extension types: [ExtraPropertiesExtension]
TrevJonez
09/30/2024, 6:33 PMincludeBuild
projects used for gradle plugins even if the build including them is a miss?kyle
10/04/2024, 9:12 PM:subprojectFoo
and I need to find its projectDir. I know that I should probably be providing this value as a task input but... it's complicated.Javi
10/07/2024, 4:23 PMValueSource
and its params interface. This interface is taking a Property<VersionMapper>
, and this mapper extends Serializable
.
interface Params : ValueSourceParameters {
val versionMapper: Property<VersionMapper>
...
}
public fun interface VersionMapper : Serializable {
public fun map(version: GradleVersion): String
}
But I am getting the next crash with config cache enabled:
> Could not create task ':playground-kotlin-version:printSemver'.
> Could not isolate value com.javiersc.semver.project.gradle.plugin.valuesources.VersionValueSource$Params_Decorated@3cad81e8 of type VersionValueSource.Params
> Could not serialize value of type Build_gradle..
I know the issue is around this VersionMapper
because if I remove it from params, it works.Javi
10/07/2024, 6:19 PM> Could not create task ':printSemver'.
> Could not isolate value com.javiersc.semver.project.gradle.plugin.valuesources.VersionValueSource$Params_Decorated@6c6a363a of type VersionValueSource.Params
> Could not serialize value of type $Proxy80
The problem is when the script is written in Groovy instead of in Kotlin.
semver {
mapVersion { "1.0.0" }
}
Should I use something like Transformer
instead my own VersionMapper
interface? I think I would have the same issue with Transformer
as that API does not extend serializable.Arve Seljebu
10/07/2024, 6:29 PMEnvirontment
does seem to cache all environment variables:
TrackingProperties(System.getenv()) // 👈 no input of which environmental variables the task depend on
But I’m unsure how to verify this. Where should I put a test like this?
fun `should bypass environmental variables that are not task dependencies when using configuration-cache`
And are there any similar tests that I can use as a template?kyle
10/17/2024, 12:27 AMProvider<String>
on a helper object which performs a semi-expensive shell-out the the terminal to fetch the version of a tool. I don't know why I thought this, but I expected the body of the method to be cached. Instead it is invoked each time I access the method. What am I doing wrong? Ideally the callable would be invoked once and the result cached each time I access getExpensiveVersionOfLocalThing().get()
.
public Provider<String> getExpensiveVersionOfLocalThing() {
return getProviderFactory().provider(() -> {
// do expensive thing
return expensiveResult;
});
}
Martin
11/03/2024, 12:47 PMproviders.environmentVariable("FOO")
vs directly provider { System.getenv("FOO") }
given that CC is invalidated on value changes in both cases?Martin
11/04/2024, 5:19 PMProvider.map {}
allowed with the configuration cache? I'm hitting a weird use case where it doesn't carry task dependencies:
val task1 = tasks.register("mytask1", MyTask::class) {
myInput.set("input1")
myOutputFile.set(layout.buildDirectory.file("output1.txt"))
}
val task2 = tasks.register("mytask2", MyTask::class) {
myInput.set(task1.map { it.myOutputFile.get().asFile.readText() + "Suffix"})
myOutputFile.set(layout.buildDirectory.file("output2.txt"))
}
output:
build/output1.txt (No such file or directory)
Is that a bug or am I using it wrong?Clayton Walker
11/13/2024, 11:08 PMRamiro Aparicio Gallardo
11/15/2024, 2:04 PMproject.configurations.getByName("testRuntimeClasspath").allDependencies
Configuration and DependencySet can not be cached but they will also not be properly populated at task configuration time.
ResolvedComponentResult or ResolvedArtifactResult can be used via providers but those are dependencies already resolved and afaik they will not know if it comes from a catalog or not.
Is there any way to make it work with the cache?Nikolay
11/19/2024, 9:18 AMbuild.gradle.kts
files in parent folders that look like this
allprojects {
group = "unique-group-name"
}
This appears to break project isolation. Is there a recommended way of fixing this for project isolation?Kevin Brightwell
12/20/2024, 7:11 PM.gradle/configuration-cache
and then un-tar it in the repeated run” has the configuration-cache not re-used with no other information presented in the scanJason Pearson
12/28/2024, 7:11 PM--dry-run
give you an overall smaller transforms size while still providing config cache reuse?Nicklas Ansman
12/28/2024, 8:11 PMNicklas Ansman
12/28/2024, 8:12 PM