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
Issue: 17964: Run exclude before and after dependencySubstitution to exclude rewritten dependencies #18131
Issue: 17964: Run exclude before and after dependencySubstitution to exclude rewritten dependencies #18131
Conversation
Apply the exclude spec before and after dependency substitution to ensure that redirected dependency will be excluded correctly. Signed-off-by: Attix Zhang <attix.zhang.cs@gmail.com>
|
Based on my research, the |
@attix-zhang Thanks for the contribution! I do not know why you did not see that checkbox. But it should not be a problem in this case. I agree that we can cache the substitution result, so all good there. I have started builds to verify the change has no unexpected consequence. |
Thank you @ljacomet ! Looks to me, all tests passed! (8 tests passed with re-try, not sure why) |
Indeed, all tests passed, sending it for merge. Thanks again for the contribution! |
OK, I've already triggered a build for you. |
Pre-tested commit build failed. |
@bot-gradle test and merge |
OK, I've already triggered a build for you. |
Is there any chance that we can backport it to the previous version such as Gradle 6.x? Or the recommended way is to upgrade the Gradle to 7.3+? |
The change is simple enough that we might consider a backport to 6.9.x. |
Oh yeah. Thank you! @ljacomet |
@@ -434,7 +434,6 @@ private void visitDependencies(ExcludeSpec resolutionFilter, Collection<EdgeStat | |||
try { | |||
collectAncestorsStrictVersions(incomingEdges); | |||
for (DependencyState dependencyState : dependencies(resolutionFilter)) { | |||
dependencyState = maybeSubstitute(dependencyState, resolveState.getDependencySubstitutionApplicator()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there side-effects now that the below methods (pending edge resolution, constraint activation) are operating on the un-substituted module instead of the substituted one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dependencies(resolutionFilter)
now performs the substitution. So the below method still apply to the substituted dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doh, for some reason I had it in my mind that cacheFilteredDependencyStates
was only called later on. Thanks for clarification 😄
Apply the exclude spec before and after dependency substitution to
ensure that redirected dependency will be excluded correctly.
Signed-off-by: Attix Zhang attix.zhang.cs@gmail.com
Fixes #17964
Context
Contributor Checklist
<subproject>/src/integTest
) to verify changes from a user perspective<subproject>/src/test
) to verify logic./gradlew sanityCheck
./gradlew <changed-subproject>:quickTest
Gradle Core Team Checklist