Slackbot
07/24/2023, 2:13 PMmelix
07/24/2023, 2:13 PMmelix
07/24/2023, 2:14 PMtask.getImage().convention(imageBuilder.flatMap(BuildNativeImageTask::getOutputFile));
task.getRuntimeArgs().convention(options.getRuntimeArgs());
task.getInternalRuntimeArgs().convention(
imageBuilder.zip(options.getPgoInstrument(), serializableBiFunctionOf((builder, pgo) -> {
if (Boolean.TRUE.equals(pgo)) {
File outputDir = builder.getOutputDirectory().get().getAsFile();
return Collections.singletonList("-XX:ProfilesDumpFile=" + new File(outputDir, "default.iprof").getAbsolutePath());
}
return Collections.emptyList();
})
));melix
07/24/2023, 2:15 PM• Taskwhich indicates that the whole task is captured...of type `org.graalvm.buildtools.gradle.tasks.NativeRunTask`: cannot serialize object of type 'org.graalvm.buildtools.gradle.tasks.BuildNativeImageTask', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.:nativeRun
melix
07/24/2023, 2:18 PMmelix
07/24/2023, 2:24 PMimageBuilder.flatMap(BuildNativeImageTask::getOutputFile) is enough to trigger the problem. A flatMap. Kill. me.melix
07/24/2023, 3:11 PM@Internal
public Provider<RegularFile> getOutputFile() {
return getOutputDirectory().map(dir -> dir.file(getExecutableName()).get());
}
which should be:
@Internal
public Provider<RegularFile> getOutputFile() {
return getOutputDirectory().zip(getExecutableName(), Directory::file);
}melix
07/24/2023, 3:11 PMmelix
07/24/2023, 3:13 PMserializableSupplierOf(() -> Collectors.<File>toList())
pass a Supplier<Collector> and wrap it into a serializable supplier because passing the collector directly fails serialization.melix
07/24/2023, 3:13 PMmelix
07/24/2023, 3:29 PMFAILURE: Build failed with an exception.
* What went wrong:
Configuration cache state could not be cached: field `spec` of `org.gradle.api.internal.tasks.execution.SelfDescribingSpec` bean found in task `:compileJava` of type `org.gradle.api.tasks.compile.JavaCompile`: error writing value of type 'org.gradle.api.internal.tasks.compile.CompilerForkUtils$$Lambda$1429/0x0000000801621430'
> Unable to make field private final java.lang.Object[] java.lang.invoke.SerializedLambda.capturedArgs accessible: module java.base does not "opens java.lang.invoke" to unnamed module @60b9f4cmelix
07/24/2023, 3:30 PM0 problems were found storing the configuration cache.)Adam
07/25/2023, 7:10 AMmelix
07/25/2023, 9:16 AMmelix
07/25/2023, 9:16 AMAdam
07/25/2023, 9:22 AMAdam
07/25/2023, 9:23 AMJavi
07/25/2023, 2:21 PMAdam
07/25/2023, 2:28 PMGradle uses its own optimized serialization mechanism and format to store the configuration cache entries.it’s used partially though - perhaps that’s where most of the problems come from?
As a fallback and to provide some aid in migrating existing tasks, some semantics of Java Serialization are supported.https://docs.gradle.org/current/userguide/configuration_cache.html