-
Notifications
You must be signed in to change notification settings - Fork 866
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
Gradle: can't debug composite build #4865
Comments
@neilcsmith-net asked
Wasn't sure myself. What finally convinced me that there's a bug, is that, in the list discussion, @lkishalmi suggested several custom actions to try and I couldn't get it to work; suggested a few things about the build.gradle script that didn't pan out. Maybe it's just a feature request or something to document. Not a show stopper for me, but without it there's arcane steps dealing with consistency with the local maven repo which can take a while to get right; might be a big problem for working with large gradle projects. It reproduces easily with the tiny attached project, if there's an easy workaround, it would be great to know. And a simple fix, would be stupendous. The gradle docs talk about Importing into the IDE which starts
Maybe I just need to find the |
I'm sorry I had no time to play with the attached project. I'm sure that this is not a bug. NetBeans does not need any plugin (and I think in these days neither Eclipse nor IDEA needs a specific plugin) to work with Gradle. The problem is that that the |
BTW, I've discovered that if I check
then the The problem is the "and the other open...". I can use this in small situations, but with a lot of projects open, it's not what I want. I'm not stuck on this, but it's a hole in the Gradle project support and/or a hole in the Gradle documentation.
Hmm, "Can't debug composite Gradle project" doesn't feel like a feature request if composite projects are supported. |
IntelliJ docs https://www.jetbrains.com/help/idea/work-with-gradle-projects.html#gradle_composite_build IntelliJ docs starts with
or
This 2nd method says
Being able to list the included projects rather than "all open". I searched around, couldn't find anything beyond the gradle docs that say how to add a run task for composite builds. But that sure doesn't mean it's not there. |
Just played around with the attached project a bit.
The registration of a The only drawback is that the IDE would register the JDPA listener on Java projects only, so the debugger has to be manually attached from the menu, but that's possible. As this is not a standard use-case for compositing builds, I'd say that's fine. |
Starting with clean userdir/cachedir Setting those in gradle properties, when it runs I see
And then it hangs, needing to manually abort
Is #4943 related to the hang? The comment "then the registration of the JDPA listener would g through ..." seems to relate. (I'm not seeing an exception, but not doing a hint thing.) |
That's not a hang. The process waits for a debugger to be attached. Use the Debug menu and attach to localhost port 5005 with dt-socket |
Cool, it worked! Hit a breakpoint. Thanks.
Got it, so #4943 will let the attach happen? This wait explains why I couldn't get this to work in September with the real project. Looking back at the mailing list, I saw a "hang" but didn't pursue it, thinking my setup was wrong. |
No you can manually attach the debugger right now, as I've mentioned, from the Debug menu. #4943 fixes the exception, that prevent the IDE do the attach automatically. |
There were two issues.
|
Closed too soon. Using
Using |
@neilcsmith-net , @lkishalmi still needs triage (since there's a workaround, not urgent (at least for me)) |
Well, I can't reproduce this with 16-rc4 using the attached sample project and the aforementioned properties file. |
Thanks for checking. Hmm, I copied the 15 userdir. It's late here, I'll poke at it tomorrow. |
Still can't get it working. With abundance of caution, attaching zip with aforementioned properties file. Extract netbeans-16-rc4-bin.zip, start NetBeans-16-rc4 with clean userdir/cachdir Open only compose project, resolve problem.
Manually attach debugger to get job running. |
The updated project works for me as well out of the box win 16-rc4. @errael any hidden exception in the IDE log? Also it would be good if someone else could test it. |
Yes. If there are no takers, I'll ask around in dev on Monday. Haven't seen any exceptions. I tried putting a breakpoint at
looked tempting, and then at it's constructor. No breakpoint. (I tried putting a bkpt in core.windows just to be sure I was getting some). Any suggestions on things to look at? |
Looks like one expression of the problem is that some things related to execution don't make it into the project's lookup. Any idea where these missing items would be put into the lookup for the gradle project?
|
Poking around NbGradleProjectImpl, it looks like the issue is that Tried adding to
and similarly with
(Been a great opportunity to look a little deeper into the miracle that is Lookup)
|
Well, at this point, it is more interesting that how does it work for me. The registration can be easily fixed. Going to do that this week, if I happen to find some time for that. |
Agree, (un?)fortunately I can't explore that. |
Yeah, that's my issue. I'm going to take care of that. |
Following instruction from #4865 (comment) no change in symptoms. Stuck like:
Manually attaching debugger gets it to proceed. This is the one where it never worked for me and it didn't fail for you. @sdedic , @mbien If someone else could try this, only takes a few minutes. Whether it works or not, probably no reason to hold up 16u1since all the really hot stuff works. And since manually attaching the debugger works (and now I know about that), assuming that's not a problem for most people. Could someone re-open this issue? |
Apache NetBeans version
Apache NetBeans 16 release candidate
What happened
This issue discussed in dev,
https://lists.apache.org/thread/372jso34sfp42fotvfkhp2vj5r8vvq0h
The thread includes the suggestion to use a
composit build
withincludeBuild
and various suggestions on how to get debug to work. The problem is that although theRun
button works on a composite build, theDebug
button does not and results in the following error.How to reproduce
zip file has trivial projects,
lib, app, compose
that demo the issues:https://github.com/apache/netbeans/files/9847401/gradle-projects-compose.zip
Only lib can resolve, app depends on maven local
=== Lib ===
outputObserve:
Did this work correctly in an earlier version?
No / Don't know
Operating System
Linux harmony 5.19.16-76051916-generic #202210150742
166605324422.04~cf07008 SMP PREEMPT_DYNAMIC Tue O x86_64 x86_64 x86_64 GNU/LinuxJDK
openjdk version "11.0.2" 2019-01-15 OpenJDK Runtime Environment 18.9 (build 11.0.2+9) OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
Apache NetBeans packaging
Own source build
Anything else
No response
Are you willing to submit a pull request?
No
Code of Conduct
Yes
The text was updated successfully, but these errors were encountered: