Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrupt serialized resolution result when using composing builds with platform bom and exclude spec #21057

Closed
KaiyuanZhao opened this issue Jun 21, 2022 · 3 comments
Assignees
Labels
a:regression This used to work in:dependency-resolution engine metadata
Milestone

Comments

@KaiyuanZhao
Copy link

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 says Corrupt 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 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

Releated to #19656

Steps to Reproduce

resolution.zip

  • unzip resolution.zip
  • cd to resolution dir
  • failed when ./gradlew :include:hammering:dependencies --configuration releaseRuntimeClasspath -S -PEXCLUDE
  • succeeded when ./gradlew :include:hammering:dependencies --configuration releaseRuntimeClasspath -S
  • In order not to expose some information, I used a random dictionary to obfuscate our dependency names.

Your Environment

Windows/Linux/Mac
Java 11

@KaiyuanZhao KaiyuanZhao added a:regression This used to work to-triage labels Jun 21, 2022
@donat 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
@jbartok jbartok added in:dependency-resolution engine metadata and removed to-triage labels Jun 27, 2022
@KaiyuanZhao
Copy link
Author

#23680 solved this issue for me.
when will it be backported to 7.*? #23681

@ljacomet
Copy link
Member

@KaiyuanZhao Gradle 7.6.2 will have the fix backported.

Can you confirm that 7.6.2-20230624061709+0000 fixes the issue?

@ov7a ov7a added this to the 7.6.2 milestone Aug 8, 2023
@ov7a
Copy link
Member

ov7a commented Aug 8, 2023

@KaiyuanZhao Given the absence of a reply, I assume that issue was fixed. Feel free to ping us if you have any additional details.

@ov7a ov7a closed this as completed Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:regression This used to work in:dependency-resolution engine metadata
Projects
None yet
Development

No branches or pull requests

4 participants