technomancy / grenchman

Sorry about the name
GNU General Public License v3.0
217 stars 8 forks source link

Grench lein broken? #34

Closed arichiardi closed 7 years ago

arichiardi commented 9 years ago

I get an error when I launch, for instance grench lein help. The conf below, this is the error I get:

Exception in thread "nREPL-worker-0" java.lang.Error: java.net.SocketException: Socket closed
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1148)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.SocketException: Socket closed
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:116)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at clojure.tools.nrepl.transport$bencode$fn__243.invoke(transport.clj:103)
    at clojure.tools.nrepl.transport.FnTransport.send(transport.clj:28)
    at clojure.tools.nrepl.middleware.render_values$wrap_renderer$reify__1138.send(render_values.clj:30)
    at cider.nrepl.middleware.track_state$make_transport$reify__15743.send(track_state.clj:186)
    at clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__679$fn__682.invoke(interruptible_eval.clj:223)
    at clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__674.invoke(interruptible_eval.clj:190)
    at clojure.lang.AFn.run(AFn.java:22)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    ... 2 more

It looks like a nrepl middleware issue. If I remove my profile.clj the error changes in:

Unknown status: 19:namespace-not-found

Can I do something to debug?

My conf:

Leiningen 2.5.3 on Java 1.8.0_66 Java HotSpot(TM) 64-Bit Server VM
nREPL server started on port 34379 on host 127.0.0.1 - nrepl://127.0.0.1:34379
REPL-y 0.3.7, nREPL 0.2.11
Clojure 1.7.0
technomancy commented 9 years ago

Are you trying to connect to a lein repl instance that is running outside a project? Connecting to a project repl won't work.

arichiardi commented 9 years ago

Yep, very weird

arichiardi commented 9 years ago

Anything to debug the issue?

technomancy commented 9 years ago

The only thing I can think of is trying to move your user profiles out of the way and see if that makes a difference.

arichiardi commented 9 years ago

Mmm this is exactly what I have written in the issue, the message changes to Unknown namespace. Sorry for the typo btw. Can you give me a working conf? Maybe I have too many up-to-date things. Thanks for you help.

technomancy commented 9 years ago

I see; I misread the original. The only namespaces that the lein subtask uses are leiningen.core.eval and leiningen.core.main, so if these namespaces are not found it means that it's connecting to an nREPL server which does not have Leiningen loaded in it.

An empty profiles.clj is a working config on my setup, provided the nREPL server is launched correctly.

arichiardi commented 9 years ago

With lein 2.5.3?

technomancy commented 8 years ago

I tried this again with lein 2.5.2 and I can reproduce the problem. It works fine on 2.5.1. I haven't been tracking the changes since 2.5.1, but I believe a new nrepl version was introduced which probably caused this problem. I would recommend getting nrepl to emit a more descriptive error message so you can tell which namespace it is that cannot be found.

ColemanGariety commented 8 years ago

Any status on this? How can I get around this bug?

technomancy commented 8 years ago

Sorry, not sure what changes in nrepl caused this. I'm not using Leiningen or Grenchman these days.

arichiardi commented 8 years ago

I confirm the problem still happens with error: Unknown status: 19:namespace-not-found

ColemanGariety commented 8 years ago

@technomancy what are you using?

technomancy commented 8 years ago

@coleman I'm semi-retired from developing, but I have some projects going on in Racket and I hack on a game in Lua in my free time. I don't really write any server-side code these days, so not a lot of call for Clojure.

hypirion commented 8 years ago

@JacksonGariety If there's interest, I can attempt to revive this project. Not necessarily in OCaml, but make a similar program nonetheless.

ColemanGariety commented 8 years ago

@hyPiRion I'm more curious what people do in leu of it. Drip doesn't seem to make any difference in start-time to me. Maybe it's configured incorrectly.

arichiardi commented 8 years ago

@JacksonGariety thanks for bringing this up, I would be interested as well.

technomancy commented 7 years ago

This is actually due to a bug in Leiningen where it has started spinning up project JVMs every time you start a repl, not just when you start a repl inside a project: https://github.com/technomancy/leiningen/commit/6234419b#commitcomment-21422061

It should be fixed in the next release of Leiningen; in the mean time you will need to start your repl server inside a project that has :eval-in :leiningen (like Leiningen itself) instead of outside a project dir.