-
Notifications
You must be signed in to change notification settings - Fork 202
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
Add debugging instructions to developer documentation [DOCS] #530
Conversation
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.
Great work @tues 💯
> frontend/runMain bloop.Server | ||
``` | ||
|
||
If you want to be able to stop the server with <kbd>Ctrl</kbd><kbd>C</kbd> |
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.
What about we add it to the build directly and just tell people they can do CTRL-C
to kill it?
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.
I was actually thinking about that, I guess we might. Usually I add it to my global ~/.sbt/
because I want to be able to cancel any sbt task in any project. Will do.
Did you eventually find out whether our nailgun script supports this? Would be even better to allow JDWP via the installed bloop server. |
No, unfortunately it doesn't seem to work.
so it doesn't support adding any options between
IMO it doesn't make much sense because we want to have the sources in sync with what's running in JVM. I was using it only temporarily because I had some issues running the server from sbt which I solved later. If you do see any value in this though, I can add support for additional JVM options to the Nailgun client 🙂 |
Do you mean that you don't wanna nuke the server in the background? The way i would do it is that i would spawn another bloop server in another port, and then connect to it from the bloop client so that it doesn't interrrup the other, active and hot bloop server.
I'm thinking more about normal users trying to debug what's happening. Asking them to clone the repo and do it from the sbt build (which may require importing from intellij or updating the whole build) may be too demanding. I think it would be great if we make the nailgun script work 😄. We need it anyway to control things like |
I mean I think it's better to have source code available when debugging, and obviously this source code needs to be the same as the one used to build the server being debugged. But sure, we can also make it possible to debug without cloning the repo. I'll open a new issue to improve Nailgun and update the docs when it's done. WDYT? |
Ah, I see! Alright, fair point. But I agree that having a ticket for this would be great. I wanna be able to change the jvm options of the bloop server so that I can shove my favorite Are you going to update this to include the cancelable setup? Let me know when you want another review! |
I added some commits here to add some improvements to the docs and modify the nailgun script, what do you think @tues? |
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.
Thanks, I wanted to add docs for debugging with Bloop and also debugging only bloop.Cli
instead of whole server but I have a lot of other things to do today so would probably do that tomorrow. I have some minor comments but otherwise it looks good 🙂
Edit: Oops, seems I commented on a specific commit instead of whole PR, sorry.
|
||
```sh | ||
$ sbt | ||
> frontend/ensimeRunDebug bloop.Server | ||
> set javaOptions in (frontend, run) += "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005" | ||
> frontend/runMain bloop.Server --config-dir /foo/bar |
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.
Is config dir needed for bloop.Server
? It is for bloop.Cli
, but the server seems to run fine without it.
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.
True! Forgot that we were doing server here.
@@ -131,49 +131,82 @@ get stable results. | |||
|
|||
## Debugging | |||
|
|||
When analysing a bug, it is often infeasible to rely only on tests. It might be | |||
more convenient to run Bloop and attach a debugger instead. | |||
If you're trying to catch a bug, it might ben convenient to attach a debugger |
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.
s/ben/be/
c3d2975
to
f193da5
Compare
It's not that obvious how to run Bloop server directly from sbt and how to enable debugging for forked processes. Hopefully these instructions will save people some time figuring things out.