You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Failed in Gradle6.9.2/7.2/7.3+/7.4+/7.5-rc
Succeeded in Gradle6.7.1/6.9.1/7.0/7.1
We have some repositories using platform to sync our app's dependencies. When we includeBuild these repositories in our app with some certain exclude spec, it always says Corrupt serialized resolution result.
I cloned Gradle7.4.2 source code and did some debugging. I found out something wrong in org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.NodeState.
In cacheFilteredDependencyStates, dependencyState = maybeSubstitute(dependencyState, resolveState.getDependencySubstitutionApplicator()); (line 512) is always creating a new DependencyState instance by return dependencyState.withTarget(details.getTarget(), details.getRuleDescriptors()); (line 634) when we using includeBuild. And then boolean sameDependencies = dependencies(newResolutionFilter).equals(oldStates); (line 355) in excludesSameDependenciesAsPreviousTraversal(ExcludeSpec newResolutionFilter) is always false.
After I tried to add a cache for dependencyState.withTarget, problem solved. This problem has been bothering us for several months. I hope you could find a suitable way to solve it. @ljacomet
donat
changed the title
Corrupt serialized resolution result when using composing builds with platform bom and exclude spec.
Corrupt serialized resolution result when using composing builds with platform bom and exclude spec
Jun 22, 2022
Expected Behavior
Resolve dependencies successfully.
Current Behavior
Caused by: java.lang.IllegalStateException: Corrupt serialized resolution result. Cannot find selected module
Context
Failed in Gradle6.9.2/7.2/7.3+/7.4+/7.5-rc
Succeeded in Gradle6.7.1/6.9.1/7.0/7.1
We have some repositories using
platform
to sync our app's dependencies. When we includeBuild these repositories in our app with some certain exclude spec, it always saysCorrupt serialized resolution result
.This is caused by pr #18131 with issue #17964
I cloned Gradle7.4.2 source code and did some debugging. I found out something wrong in
org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.NodeState
.In
cacheFilteredDependencyStates
,dependencyState = maybeSubstitute(dependencyState, resolveState.getDependencySubstitutionApplicator()); (line 512)
is always creating a newDependencyState
instance byreturn dependencyState.withTarget(details.getTarget(), details.getRuleDescriptors()); (line 634)
when we usingincludeBuild
. And thenboolean sameDependencies = dependencies(newResolutionFilter).equals(oldStates); (line 355)
inexcludesSameDependenciesAsPreviousTraversal(ExcludeSpec newResolutionFilter)
is always false.After I tried to add a cache for
dependencyState.withTarget
, problem solved. This problem has been bothering us for several months. I hope you could find a suitable way to solve it. @ljacometReleated to #19656
Steps to Reproduce
resolution.zip
resolution.zip
resolution
dir./gradlew :include:hammering:dependencies --configuration releaseRuntimeClasspath -S -PEXCLUDE
./gradlew :include:hammering:dependencies --configuration releaseRuntimeClasspath -S
Your Environment
Windows/Linux/Mac
Java 11
The text was updated successfully, but these errors were encountered: