Fork me on GitHub
#cursive
<
2021-06-07
>
defa09:06:57

I’d like to debug a process on a remote machine using breakpoints but can not get the debugger to connect properly to the remove JVM. I have a nrepl remote REPL running successfully but connecting a debugger with IntelliJ IDEA “Remote JVM Debug” run stetting does not work. I have to tunnel the remote JVM socket using SSH port forwarding, maybe that is the problem?

mike_ananev11:06:57

@defa when you start a REPL (remote process) you should put to :jvm-opts parameter

"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"

mike_ananev11:06:46

and tell Idea to connect to debuger port 5005

defa14:06:07

Thanks, @mike1452, I already did that but it seems that the debugger takes a couple of minutes (!) to connect. Not sure what this is or was but not it is working. Kind of. Thanks.

defa14:06:56

Unfortunately I encountered a heisenbug… now that I’m able to debug the problem, it has gone away.

Jeff Evans14:06:05

yeah, it can be incredibly slow when the Java debugger gets involved, from my experience. I recommend waiting until your process is fully warmed up, before the error state (or whatever you’re trying to debug), then connect the debugger

Jeff Evans14:06:18

and disconnect/reconnect it liberally

Ian Fernandez15:06:43

Hello, my company moved to bazel builds for our Clojure/JVM-based projects. How do I configure Cursive / IntelliJ to recognize my classpath again?

tanzoniteblack18:06:14

how are you liking bazel? How is it set up to work with Clojure?

tanzoniteblack18:06:18

if you don’t mind me asking

Ian Fernandez18:06:28

Right now the support for bazel on IntelliJ is very very bad, the company moved from deps.edn to bazel and it broke at lot of IntelliJ classpath loading stuff

Ian Fernandez18:06:51

goto var definitions are impossible for some part of the code

cfleming02:06:49

@U9ABG0ERZ I know next to nothing about bazel (except that IntelliJ didn’t seem to support it well, as you’ve found). Are you able to set up a simple project that I could use to test this?

2
Ian Fernandez13:06:50

I'll try to setup a project 🙂

thheller16:06:02

there is a bazel plugin for intellij I think

Ian Fernandez18:06:24

yeah, there's a bazel plugin for IntelliJ but it does not loads the java classpath from the build

Ian Fernandez18:06:53

I can connect a REPL from IntelliJ but it doesn't detect modules on IntelliJ 😞

katox19:06:35

It seems that cursive doesn't like the latest tools.deps that come with Clojure (https://clojure.org/guides/getting_started#_installation_on_linux)... `clj -Sdescribe => {:version "1.10.3.855" ...};

imre19:06:23

what cursive version are you on? I'm on 1.10.3-eap1-2021.1 with latest clojure and it's grand

katox20:06:55

The same EAP + 2021.1.2. I can make it work by "use deps directly" but it it worked with the older version (it broke when I updated the clj tooling)

cfleming02:06:37

Hmm, that’s odd, I’ll look at that.

cfleming03:06:12

I can’t reproduce this. That error message is produced when this var doesn’t exist, which it does in this version (and doesn’t on very old versions of deps): https://github.com/clojure/tools.deps.alpha/blob/tools.deps.alpha-0.11.922/src/main/clojure/clojure/tools/deps/alpha/util/dir.clj#L25

cfleming03:06:28

If you look in Preferences | Build, Execution, Deployment | Build Tools | Clojure Deps do you see the correct version reported?

katox07:06:12

If I switch it back on it says

cfleming08:06:48

And it definitely doesn’t work with those settings?

katox09:06:49

No, it won't starrt the REPL if I leave it on.

cfleming23:06:51

That’s really weird. I can’t reproduce that, and I don’t have a plausible theory for how it could happen. I’ll look at the code to see what debug logging might be there, otherwise I’ll have to add some.

cfleming07:06:21

Does your project have tools.deps on its classpath for some reason?

katox08:06:58

it is not on the classpath, it is in the project root. I have no idea what's wrong where but it is not a corrupted project file. I found a 6mo old untouched deps project that did the same. If you had some debug build I can try to run it here if it helps.