Gradle 3.5 released


(Eric Wendelin) #1

:rocket: Gradle 3.5 is now available

Featuring an all-new build cache, improved console, and more! Check the release notes for full details and upgrade instructions.


(Eric Wendelin) #2

(Dimitar Dimitrov) #3

We are seeing regression with code such as:

tasks.withType(Test) {
    maxParallelForks = 10
    systemProperties = System.properties + [
            'java.io.tmpdir': "${->uniqueTempDir()}" // closure in GString is late-resolved
    ]
}

With Gradle 3.4 this was working as expected and each forked test was getting its own temp dir.

When ran with Gradle 3.5 we get this:

org.gradle.api.GradleException: Unable to store input properties for task ':test'. Property 'systemProperties' with value '<lots of text>' cannot be serialized.
        at org.gradle.api.internal.changedetection.rules.InputPropertiesTaskStateChanges.<init>(InputPropertiesTaskStateChanges.java:63)
        at org.gradle.api.internal.changedetection.rules.TaskUpToDateState.<init>(TaskUpToDateState.java:50)
        at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.getStates(DefaultTaskArtifactStateRepository.java:170)
        at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.isUpToDate(DefaultTaskArtifactStateRepository.java:85)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:236)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:228)
        at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:228)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:77)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:58)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
Caused by: org.gradle.api.UncheckedIOException: java.io.NotSerializableException: org.gradle.api.tasks.testing.Test_Decorated
        at org.gradle.api.internal.changedetection.state.ValueSnapshotter.serialize(ValueSnapshotter.java:126)
        at org.gradle.api.internal.changedetection.state.ValueSnapshotter.snapshot(ValueSnapshotter.java:115)
        at org.gradle.api.internal.changedetection.state.ValueSnapshotter.snapshot(ValueSnapshotter.java:97)
        at org.gradle.api.internal.changedetection.rules.InputPropertiesTaskStateChanges.<init>(InputPropertiesTaskStateChanges.java:52)
        ... 22 more
Caused by: java.io.NotSerializableException: org.gradle.api.tasks.testing.Test_Decorated
        at org.gradle.api.internal.changedetection.state.ValueSnapshotter.serialize(ValueSnapshotter.java:123)
        ... 25 more

In case anybody has the same problem, a workaround is to disable up-to-date check for these tasks by adding outputs.upToDateWhen { false } in the task config closure.


(Andrew Richardson) #4

Build cache looks great! Any plans to extend it to native compile tasks?


#5

Hi Dimitar
I can’t reproduce this issue with a simple implementation of uniqueTempDir. Are you able to provide a reproducible example?
Thanks, Daz


(Dimitar Dimitrov) #6

Funny, I removed the workaround and now the build works with the cache enabled.
Please ignore. I’ll keep an eye on it and file an issue with repro case if it happens again.


(Dimitar Dimitrov) #7

Hi Daz,

Apologies for the false alert.

It turned out that the serialization error was there with older versions of Gradle too, but on that project we have removed the “Gradle exit code” from the requirements for successful build (so that we can use TeamCity’s “mute” feature).

I have provided an example and followup question in this thread:


(Benjamin Muschko) #8