-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Gradle plugin may check the unresolved dependencies of a configuration's copy, resulting in a StackOverflowError when combined with the nebula.resolution-rules plugin #12784
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
Conversation
@wilkinsona 2.1 or 2.x? |
Ideally neither in its current form as it introduces the use of an internal type. I need to take some time to understand the problem and consider any alternatives. |
I've pushed a branch that takes a slightly different approach and avoids the use of any internal API. However, it does still introduce the use of some incubating API:
By contrast, the current code doesn't use any internal or incubating API. So, while I think the code in my branch is slightly better than the code proposed in this pull request, it does still add some risk compared to what we currently have. @danhyun Can you please help me to understand why you've proposed this change? Can you point me to Gradle's plans for deprecating |
@wilkinsona thanks for the work! Another motivation for this PR is that plugin interactions causes Gradle to go into a tailspin, specifically interaction between Nebula's resolution/alignment functionality and the use of I spoke with some of the folks at Gradle about the usage of This PR is an attempt to let users continue to consume Nebula plugin along with Spring Boot 2 plugin in a future forward looking manner. I prefer your branch over mine for the same objection of using internals (yuck), I didn't even stop to check that that was what I was doing. (Would be a good time to add a lint rule to leave that as a warning although I've heard plugin maintainers argue that they can't get what they need otherwise :| ). I'm in favor of closing this PR if you'll include that other branch in the next release. |
@danhyun I'm still rather reluctant to move onto incubating API, certainly until we've eliminated other possibilities. I tried using your minimal sample to reproduce the problem and failed to do so. Could you please point me in the right direction? Looking at the StackOverflowError, I'm wondering if keeping track of the configurations that have already been seen would be sufficient to break the cycle. |
@wilkinsona we do keep track of configurations that we have seen, there's an issue with how a given config is created by the time it comes back to Nebula. If you step through the debugger you'll find that the configuration name doesn't match up with what it is supposed to be, namely that it's being reported as the original config when in fact we're looking at a copy of that configuration. I'll do a bit more digging to make sure that we've exhausted our options from Nebula's perspective. Here's a reliable way to reproduce what I've been seeing.
To reproduce: |
DependencyResult
to determine unresolved deps
I've switched gears a bit. We ran into the same thing in Nebula and added a check such as: To ensure that we don't spiral out of control. |
Very nice! Thanks, @danhyun. |
Thanks! I'm guessing this will get out with the 2.0.2 release next month? https://github.com/spring-projects/spring-boot/milestone/109 |
Are all items in 2.0.x milestone expected to ship with the next patch? |
An issue assigned to 2.0.x will be fixed in a 2.0.something release, but we haven't yet committed to fixing it in the next patch release. |
* gh-12784: Polish “Only analyze configurations that we've registered to check” Only analyze configurations that we've registered to check
Configuration#getResolvedConfiguration()
set to be deprecated in favor of usingDependencyResult
Future releases will have a direct method to find all unresolved deps in a more straightforward manner.