Closed jtcbrule closed 5 years ago
Same for MacOS
Also Fedora 29.
lein version
Leiningen 2.8.2 on Java 11.0.1 OpenJDK 64-Bit Server VM
The same in Arch (I'm holding the package upgrade until this issue is settled).
Same on FreeBSD.
$ lein version
Leiningen 2.8.2 on Java 1.8.0_181 OpenJDK 64-Bit Server VM
Wild guess. Could it be possibly due to https://github.com/technomancy/leiningen/commit/b54b762ac1331800a7a2b10b2cae0d6aaa469d0f ? I could see references to transport-fn
only with that commit.
Edit : Probably not. Building lein before the commit still has the issue.
I guess I made some mistake. Let me check this.
@bbatsov I can see the error with 115f70e791a85badfe8ebb93609adf9c80835bd5 where nrepl was bumped to 0.5.1 and moving to the previous commit with 00e36266684c6282ed1de5227e6ec4062d6f396e shows no error with nrepl 0.4.5 . Probably something with bumping the version?
I can't imagine what it can be. The differences between 0.4.5 and 0.5.1 are pretty small and 0.5.1 works just fine when I run it without leiningen. I'll install it a bit and debug this further.
One mistake I see I made was that I'm passing :transport
to start-server
instead of :transport-fn
, but this should not break anything - it'd simply render the config useless.
Hmm, looking closer I see something weird - why is there an invocation to nrepl.ack at all?
The only potentially related change in 0.5.0 I could find is https://github.com/nrepl/nrepl/commit/77335a912dccb8004aa7552d2a086f998e282b74 Seems the new signature is not reflected in Lein's usage of this.
//cc @pfeodrippe (in case he beats me to fixing this)
OK, so I figured this out and I'll submit a solution shortly.
I didn't notice that Lein was actually starting two nREPL servers and was making use of the ack functionality at all? Apart from the question of whether the second server is needed or not it seems there's really a regression in the commit I pointed out.
This assertion here is failing https://github.com/nrepl/nrepl/blob/master/src/clojure/nrepl/core.clj#L177
which is caused by https://github.com/nrepl/nrepl/blob/master/src/clojure/nrepl/ack.clj#L45, although at least superficially the code looks good.
In a bit of fun irony - I can't deploy the fix because of another bug:
Compiling 1 source files to /Users/bozhidar/projects/nREPL/target/classes
warning: [options] bootstrap class path not set in conjunction with -source 8
1 warning
Created /Users/bozhidar/projects/nREPL/target/nrepl-0.5.3.jar
Wrote /Users/bozhidar/projects/nREPL/pom.xml
java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.base/java.lang.String
at cemerick.pomegranate.aether$authentication.invokeStatic (aether.clj:173)
cemerick.pomegranate.aether$authentication.invoke (aether.clj:173)
cemerick.pomegranate.aether$set_authentication.invokeStatic (aether.clj:184)
cemerick.pomegranate.aether$set_authentication.invoke (aether.clj:181)
cemerick.pomegranate.aether$make_repository.invokeStatic (aether.clj:207)
cemerick.pomegranate.aether$make_repository.invoke (aether.clj:200)
cemerick.pomegranate.aether$deploy_artifacts$fn__110.invoke (aether.clj:361)
clojure.core$map$fn__4785.invoke (core.clj:2644)
clojure.lang.LazySeq.sval (LazySeq.java:40)
clojure.lang.LazySeq.seq (LazySeq.java:49)
clojure.lang.LazySeq.first (LazySeq.java:71)
π€£
Anyways, I'll downgrade my Lein and address this in a moment.
Thank you @bbatsov! I should have made a test for it o/
OK, so while my Lein PR is merged the simply workaround is to add [nrepl "0.5.3"]
to your profiles.clj
.
I'm sorry for this problem and I guess I'll learn to start testing lein repl
as a typically used just lein repl :headless
. :-)
Fix away!
@bbatsov I get this error after adding [nrepl "0.5.3"]
to ~/.lein/profiles.clj
java.lang.IllegalArgumentException: No implementation of method: :send of protocol: #'nrepl.transport/Transport found for class: clojure.tools.nrepl.middleware.render_values$wrap_renderer$reify__2280
at clojure.core$_cache_protocol_fn.invokeStatic(core_deftype.clj:583)
at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:575)
at nrepl.transport$eval326$fn__327$G__317__334.invoke(transport.clj:16)
at nrepl.middleware.session$register_session.invokeStatic(session.clj:149)
at nrepl.middleware.session$register_session.invoke(session.clj:142)
at nrepl.middleware.session$session$fn__1026.invoke(session.clj:193)
at nrepl.middleware$wrap_conj_descriptor$fn__595.invoke(middleware.clj:17)
at clojure.tools.nrepl.middleware.render_values$render_values$fn__2288.invoke(render_values.clj:42)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__2097.invoke(middleware.clj:22)
at nrepl.server$handle_STAR_.invokeStatic(server.clj:18)
at nrepl.server$handle_STAR_.invoke(server.clj:15)
at nrepl.server$handle$fn__1063.invoke(server.clj:27)
at clojure.core$binding_conveyor_fn$fn__5739.invoke(core.clj:2030)
at clojure.lang.AFn.call(AFn.java:18)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:844)
This is after the server has started.
nREPL server started on port 54424 on host 127.0.0.1 - nrepl://127.0.0.1:54424
my profiles.clj
:
{:user {:plugins [[venantius/ultra "0.5.2"]]
:dependencies [[mvxcvi/whidbey "1.3.2"]
[nrepl "0.5.3"]]}}
@lispyclouds You're using some legacy middleware that doesn't support the newest version of nREPL yet - I'm reasonably certain that removing whidbey is going to fix problem problem. Not sure if ultra
is also some middleware.
Here are some more details about the required changes that middleware authors have to do to support nREPL 0.4+ - https://nrepl.xyz/nrepl/installation.html#upgrading. Here's a bit more context if you'd like to learn more https://metaredux.com/posts/2018/10/29/nrepl-redux.html
Btw, that's the code in whidbey that needs to be updated - https://github.com/greglook/whidbey/blob/master/src/clojure/tools/nrepl/middleware/render_values.clj.
Whidbey is not really needed in nREPL 0.5+, as nREPL now supports natively the ability to specify a pretty-printer.
@bbatsov Turns out its both whidbey and ultra. Removing makes it work now. π Thanks a lot!
Experiencing the same issue even after applying the work around:
{:user {:deploy-repositories [["snapshots" :clojars]
["releases" :clojars]]
:dependencies [[nrepl "0.5.3"]]
:signing {:gpg-key "XXXXXXXX"}}}
lein repl
$ lein repl
exception in thread "Thread-1" java.lang.AssertionError: Assert failed: transport-fn
at nrepl.core$connect.invokeStatic(core.clj:168)
at nrepl.core$connect.doInvoke(core.clj:168)
at clojure.lang.RestFn.invoke(RestFn.java:457)
at nrepl.ack$send_ack.invokeStatic(ack.clj:45)
at nrepl.ack$send_ack.invoke(ack.clj:41)
at nrepl.server$start_server.invokeStatic(server.clj:146)
at nrepl.server$start_server.doInvoke(server.clj:105)
at clojure.lang.RestFn.invoke(RestFn.java:1096)
at user$eval747.invokeStatic(NO_SOURCE_FILE:0)
at user$eval747.invoke(NO_SOURCE_FILE)
at clojure.lang.Compiler.eval(Compiler.java:6927)
at clojure.lang.Compiler.eval(Compiler.java:6917)
at clojure.lang.Compiler.eval(Compiler.java:6917)
at clojure.lang.Compiler.eval(Compiler.java:6890)
at clojure.core$eval.invokeStatic(core.clj:3105)
at clojure.core$eval.invoke(core.clj:3101)
at leiningen.core.eval$fn__4211.invokeStatic(eval.clj:343)
at leiningen.core.eval$fn__4211.invoke(eval.clj:333)
at clojure.lang.MultiFn.invoke(MultiFn.java:233)
at leiningen.core.eval$eval_in_project.invokeStatic(eval.clj:367)
at leiningen.core.eval$eval_in_project.invoke(eval.clj:357)
at leiningen.repl$server$fn__5985.invoke(repl.clj:276)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.core$apply.invokeStatic(core.clj:646)
at clojure.core$with_bindings_STAR_.invokeStatic(core.clj:1881)
at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1881)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at clojure.lang.AFn.applyToHelper(AFn.java:156)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invokeStatic(core.clj:650)
at clojure.core$bound_fn_STAR_$fn__4671.doInvoke(core.clj:1911)
at clojure.lang.RestFn.invoke(RestFn.java:397)
at clojure.lang.AFn.run(AFn.java:22)
at java.lang.Thread.run(Thread.java:748)
Param | Value |
---|---|
Operating System | OS X Mojave (10.14) |
Lein Version | 2.8.2 |
Shell | Fish |
Directory | ~HOME |
project.clj present? | None |
@jayzawrotny what about on master?
@jayzawrotny For some reason the profiles.clj doesn't get properly merged outside of a project context and you're still on 0.5.2, but as @technomancy pointed out things will work just fine on Lein's master
. If you run lein
within a project you'll be fine.
Just tried master and it worked like a charm. Though I do apologize for taking up double the support effort. I wanted to report it in case another unrelated issue was masked by the original.
Thanks for the help and clarification! π
I get the following stack trace when running
lein repl
on Ubuntu 18.04 and 16.04 (Leiningen 2.8.2 on Java 1.8.0_191 OpenJDK 64-Bit Server VM):Leiningen 2.8.1 runs without error.