I fail to inject nrepl middleware from the command line #10

Open
opened 1 month ago by PEZ · 3 comments
PEZ commented 1 month ago

I am trying to inject shadow-cljs nrepl middleware from the command line. (I need this for Calva jack-in/connect). I'm sorry if this is not a particularly minimal repro, but I really don't know how to minimize it further. Mostly because I don't understand the issue enough.

I'm not even sure my expectations are valid.

Reproduction

My reproduction is using this tiny project and assumes node is installed: https://github.com/PEZ/shadow-w-backend

Steps:

  1. Install npm dependencies:
    npm install
    
  2. Start the Clojure REPL and the nREPL server, injecting cider dependencies + cider and shadow nrepl middleware:
    lein update-in :dependencies conj '[nrepl,"1.0.0"]' -- update-in :dependencies conj '[cider/cider-nrepl,"0.28.5"]' -- update-in :plugins conj '[cider/cider-nrepl,"0.28.5"]' -- update-in '[:repl-options,:nrepl-middleware]' conj '[cider.nrepl/cider-middleware,shadow.cljs.devtools.server.nrepl/middleware]' -- repl :headless
    
  3. Connect to the nREPL server:
    lein repl :connect
    
  4. Start shadow-cljs server and an :app watcher
    (do (require 'shadow.cljs.devtools.server) (shadow.cljs.devtools.server/start!) (require 'shadow.cljs.devtools.api) (shadow.cljs.devtools.api/watch :app))
    
  5. Start the ClojureScript REPL and attach to it:
    (do (require 'shadow.cljs.devtools.api) (shadow.cljs.devtools.api/nrepl-select :app))
    

Now what is expected is to get output like this:

[:selected :app]

Instead I get:

:missing-nrepl-middleware

Notes

  • This works if I add the shadow nrepl middleware in project.clj
  • I get errors if I add the cider nrepl middleware in project.clj
    [WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/cider-middleware, see nrepl.middleware/set-descriptor!
    Execution error (IllegalArgumentException) at nrepl.middleware.dynamic-loader/update-stack!$fn (dynamic_loader.clj:40).
    Key must be integer
    

So my expectations here are that command line injections should be applied after the configuration is read from project.clj, and that it should be full equivalency if I configure both these middlewares either on the command line or in project.clj. Are these expectations reasonable?

I am trying to inject shadow-cljs nrepl middleware from the command line. (I need this for Calva jack-in/connect). I'm sorry if this is not a particularly minimal repro, but I really don't know how to minimize it further. Mostly because I don't understand the issue enough. I'm not even sure my expectations are valid. ## Reproduction My reproduction is using this tiny project and assumes node is installed: https://github.com/PEZ/shadow-w-backend Steps: 1. Install npm dependencies: ``` npm install ``` 2. Start the Clojure REPL and the nREPL server, injecting cider dependencies + cider and shadow nrepl middleware: ``` lein update-in :dependencies conj '[nrepl,"1.0.0"]' -- update-in :dependencies conj '[cider/cider-nrepl,"0.28.5"]' -- update-in :plugins conj '[cider/cider-nrepl,"0.28.5"]' -- update-in '[:repl-options,:nrepl-middleware]' conj '[cider.nrepl/cider-middleware,shadow.cljs.devtools.server.nrepl/middleware]' -- repl :headless ``` 3. Connect to the nREPL server: ``` lein repl :connect ``` 4. Start shadow-cljs server and an `:app` watcher ``` (do (require 'shadow.cljs.devtools.server) (shadow.cljs.devtools.server/start!) (require 'shadow.cljs.devtools.api) (shadow.cljs.devtools.api/watch :app)) ``` 5. Start the ClojureScript REPL and attach to it: ``` (do (require 'shadow.cljs.devtools.api) (shadow.cljs.devtools.api/nrepl-select :app)) ``` Now what is expected is to get output like this: ``` [:selected :app] ``` Instead I get: ``` :missing-nrepl-middleware ``` ## Notes * This works if I add the shadow nrepl middleware in `project.clj` * I get errors if I add the cider nrepl middleware in `project.clj` ``` [WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/cider-middleware, see nrepl.middleware/set-descriptor! Execution error (IllegalArgumentException) at nrepl.middleware.dynamic-loader/update-stack!$fn (dynamic_loader.clj:40). Key must be integer ``` So my expectations here are that command line injections should be applied after the configuration is read from `project.clj`, and that it should be full equivalency if I configure both these middlewares either on the command line or in `project.clj`. Are these expectations reasonable?

I guess this is difficult because there are a lot of moving parts, so let's try to break it down a bit. Middleware is one of the most unreliable things because of how many plugins try to activate it implicitly.

So maybe by identifying the individual steps we can break down the problem.

  • First, the update-in command makes a series of changes to the project map
  • Then it loads the plugins and activates their middleware
  • Then it runs the repl command, which merges in the repl profile before starting the server

Does it look like the middleware is active before the repl command runs? If you replace the repl task with pprint (using the lein-pprint plugin) you may be able to debug to see if the problem is happening upstream of that task.

If this is a new issue in 2.9.9 or 2.9.10 it may be that the fix for #5 is responsible for this breaking, although I think that should only affect composite profiles, so it seems unlikely. But it would be helpful to know.

I guess this is difficult because there are a lot of moving parts, so let's try to break it down a bit. Middleware is one of the most unreliable things because of how many plugins try to activate it implicitly. So maybe by identifying the individual steps we can break down the problem. * First, the update-in command makes a series of changes to the project map * Then it loads the plugins and activates their middleware * Then it runs the repl command, which merges in the repl profile before starting the server Does it look like the middleware is active before the repl command runs? If you replace the repl task with pprint (using the lein-pprint plugin) you may be able to debug to see if the problem is happening upstream of that task. If this is a new issue in 2.9.9 or 2.9.10 it may be that the fix for https://codeberg.org/leiningen/leiningen/issues/5 is responsible for this breaking, although I think that should only affect composite profiles, so it seems unlikely. But it would be helpful to know.
Poster

I'll try to debug a bit using those hints. Thanks!

If this is a new issue in 2.9.9 or 2.9.10 it may be that the fix for #5 is responsible for this breaking, although I think that should only affect composite profiles, so it seems unlikely. But it would be helpful to know.

That I have tried. I had a pretty old version on another machine of mine and it was the same there.

I'll try to debug a bit using those hints. Thanks! > If this is a new issue in 2.9.9 or 2.9.10 it may be that the fix for #5 is responsible for this breaking, although I think that should only affect composite profiles, so it seems unlikely. But it would be helpful to know. That I have tried. I had a pretty old version on another machine of mine and it was the same there.
Poster

pprint does seem to tell me something, even though I'm not savvy enough to interpret the message, so I'll paste the whole output to avoid deleting some clue:

$ lein update-in :dependencies conj '[nrepl,"1.0.0"]' -- update-in :dependencies conj '[cider/cider-nrepl,"0.28.5"]' -- update-in :plugins conj '[lein-pprint,"1.3.2"]' -- update-in :plugins conj '[cider/cider-nrepl,"0.28.5"]' -- update-in '[:repl-options,:nrepl-middleware]' conj '[cider.nrepl/cider-middleware,shadow.cljs.devtools.server.nrepl/middleware]' -- pprint
{:description "FIXME: write description",
 :compile-path
 "/Users/pez/Projects/tests/shadow-w-backend/target/default/classes",
 :deploy-repositories
 [["clojars"
   {:url "https://repo.clojars.org/",
    :password :gpg,
    :username :gpg}]],
 :group "lein-app",
 :resource-paths
 ("/Users/pez/Projects/tests/shadow-w-backend/dev-resources"
  "/Users/pez/Projects/tests/shadow-w-backend/resources"),
 :uberjar-merge-with
 {"META-INF/plexus/components.xml" leiningen.uberjar/components-merger,
  "data_readers.clj" leiningen.uberjar/clj-map-merger,
  #"META-INF/services/.*"
  [clojure.core/slurp
   (fn*
    [p1__7737__7739__auto__ p2__7738__7740__auto__]
    (clojure.core/str
     p1__7737__7739__auto__
     "\n"
     p2__7738__7740__auto__))
   clojure.core/spit]},
 :name "lein-app",
 :checkout-deps-shares
 [:source-paths
  :test-paths
  :resource-paths
  :compile-path
  #'leiningen.core.classpath/checkout-deps-paths],
 :source-paths ("/Users/pez/Projects/tests/shadow-w-backend/src"),
 :eval-in :subprocess,
 :repositories
 [["central"
   {:url "https://repo1.maven.org/maven2/", :snapshots false}]
  ["clojars" {:url "https://repo.clojars.org/"}]],
 :test-paths ("/Users/pez/Projects/tests/shadow-w-backend/test"),
 :target-path
 "/Users/pez/Projects/tests/shadow-w-backend/target/default",
 :prep-tasks ["javac" "compile"],
 :native-path
 "/Users/pez/Projects/tests/shadow-w-backend/target/default/native",
 :offline? false,
 :root "/Users/pez/Projects/tests/shadow-w-backend",
 :pedantic? ranges,
 :clean-targets [:target-path],
 :plugins [[lein-pprint "1.3.2"] [cider/cider-nrepl "0.28.5"]],
 :profiles
 {:uberjar
  {:aot [:all], :jvm-opts ["-Dclojure.compiler.direct-linking=true"]}},
 :plugin-repositories
 [["central"
   {:url "https://repo1.maven.org/maven2/", :snapshots false}]
  ["clojars" {:url "https://repo.clojars.org/"}]],
 :aliases {"downgrade" "upgrade"},
 :version "0.1.0-SNAPSHOT",
 :jar-exclusions [#"^\." #"\Q/.\E"],
 :main main.server,
 :global-vars {},
 :repl-options,
 {:nrepl-middleware]
  ([cider.nrepl/cider-middleware
    shadow.cljs.devtools.server.nrepl/middleware])},
 :uberjar-exclusions
 [#"(?i)^META-INF/[^/]*\.(SF|RSA|DSA)$" #"^module-info.class$"],
 :jvm-opts
 ["-XX:-OmitStackTraceInFastThrow"
  "-XX:+TieredCompilation"
  "-XX:TieredStopAtLevel=1"],
 :dependencies
 ([cider/cider-nrepl "0.28.5"]
  [cider/cider-nrepl "0.28.5"]
  [cider/cider-nrepl "0.28.5"]
  [nrepl "1.0.0"]
  [org.clojure/clojure "1.11.1"]
  [org.clojure/clojurescript "1.11.60"]
  [thheller/shadow-cljs "2.19.9"]
  [binaryage/devtools "1.0.6"]
  [reagent/reagent "1.1.1"]
  [nrepl/nrepl "0.9.0" :exclusions ([org.clojure/clojure])]
  [org.nrepl/incomplete "0.1.0" :exclusions ([org.clojure/clojure])]),
 :release-tasks
 [["vcs" "assert-committed"]
  ["change" "version" "leiningen.release/bump-version" "release"]
  ["vcs" "commit"]
  ["vcs" "tag"]
  ["deploy"]
  ["change" "version" "leiningen.release/bump-version"]
  ["vcs" "commit"]
  ["vcs" "push"]],
 :repl-options
 {:nrepl-middleware
  [cider.nrepl/wrap-apropos
   cider.nrepl/wrap-classpath
   cider.nrepl/wrap-clojuredocs
   cider.nrepl/wrap-complete
   cider.nrepl/wrap-content-type
   cider.nrepl/wrap-debug
   cider.nrepl/wrap-enlighten
   cider.nrepl/wrap-format
   cider.nrepl/wrap-info
   cider.nrepl/wrap-inspect
   cider.nrepl/wrap-macroexpand
   cider.nrepl/wrap-ns
   cider.nrepl/wrap-out
   cider.nrepl/wrap-slurp
   cider.nrepl/wrap-profile
   cider.nrepl/wrap-refresh
   cider.nrepl/wrap-resource
   cider.nrepl/wrap-spec
   cider.nrepl/wrap-stacktrace
   cider.nrepl/wrap-test
   cider.nrepl/wrap-trace
   cider.nrepl/wrap-tracker
   cider.nrepl/wrap-undef
   cider.nrepl/wrap-version
   cider.nrepl/wrap-xref
   cider.nrepl/wrap-apropos
   cider.nrepl/wrap-classpath
   cider.nrepl/wrap-clojuredocs
   cider.nrepl/wrap-complete
   cider.nrepl/wrap-content-type
   cider.nrepl/wrap-debug
   cider.nrepl/wrap-enlighten
   cider.nrepl/wrap-format
   cider.nrepl/wrap-info
   cider.nrepl/wrap-inspect
   cider.nrepl/wrap-macroexpand
   cider.nrepl/wrap-ns
   cider.nrepl/wrap-out
   cider.nrepl/wrap-slurp
   cider.nrepl/wrap-profile
   cider.nrepl/wrap-refresh
   cider.nrepl/wrap-resource
   cider.nrepl/wrap-spec
   cider.nrepl/wrap-stacktrace
   cider.nrepl/wrap-test
   cider.nrepl/wrap-trace
   cider.nrepl/wrap-tracker
   cider.nrepl/wrap-undef
   cider.nrepl/wrap-version
   cider.nrepl/wrap-xref]},
 :test-selectors {:default (constantly true)}}

I notice:

  1. [:repl-options :nrepl-middleware] appears twice
  2. the first time it appears it looks broken
  3. in the second apperance any shadow middleware is absent
  4. in the second appearance all entries are appearing twice

If I completely remove the [:repl-options :nrepl-middleware] injection, pprint still reports the last entry. Where the same cider.nrepl middlewares are included, but only once:

lein update-in :dependencies conj '[nrepl,"1.0.0"]' -- update-in :dependencies conj '[cider/cider-nrepl,"0.28.5"]' -- update-in :plugins conj '[lein-pprint,"1.3.2"]' -- update-in :plugins conj '[cider/cider-nrepl,"0.28.5"]' -- pprint
{:description "FIXME: write description",
 :compile-path
 "/Users/pez/Projects/tests/shadow-w-backend/target/default/classes",
 :deploy-repositories
 [["clojars"
   {:url "https://repo.clojars.org/",
    :password :gpg,
    :username :gpg}]],
 :group "lein-app",
 :resource-paths
 ("/Users/pez/Projects/tests/shadow-w-backend/dev-resources"
  "/Users/pez/Projects/tests/shadow-w-backend/resources"),
 :uberjar-merge-with
 {"META-INF/plexus/components.xml" leiningen.uberjar/components-merger,
  "data_readers.clj" leiningen.uberjar/clj-map-merger,
  #"META-INF/services/.*"
  [clojure.core/slurp
   (fn*
    [p1__7737__7739__auto__ p2__7738__7740__auto__]
    (clojure.core/str
     p1__7737__7739__auto__
     "\n"
     p2__7738__7740__auto__))
   clojure.core/spit]},
 :name "lein-app",
 :checkout-deps-shares
 [:source-paths
  :test-paths
  :resource-paths
  :compile-path
  #'leiningen.core.classpath/checkout-deps-paths],
 :source-paths ("/Users/pez/Projects/tests/shadow-w-backend/src"),
 :eval-in :subprocess,
 :repositories
 [["central"
   {:url "https://repo1.maven.org/maven2/", :snapshots false}]
  ["clojars" {:url "https://repo.clojars.org/"}]],
 :test-paths ("/Users/pez/Projects/tests/shadow-w-backend/test"),
 :target-path
 "/Users/pez/Projects/tests/shadow-w-backend/target/default",
 :prep-tasks ["javac" "compile"],
 :native-path
 "/Users/pez/Projects/tests/shadow-w-backend/target/default/native",
 :offline? false,
 :root "/Users/pez/Projects/tests/shadow-w-backend",
 :pedantic? ranges,
 :clean-targets [:target-path],
 :plugins [[lein-pprint "1.3.2"] [cider/cider-nrepl "0.28.5"]],
 :profiles
 {:uberjar
  {:aot [:all], :jvm-opts ["-Dclojure.compiler.direct-linking=true"]}},
 :plugin-repositories
 [["central"
   {:url "https://repo1.maven.org/maven2/", :snapshots false}]
  ["clojars" {:url "https://repo.clojars.org/"}]],
 :aliases {"downgrade" "upgrade"},
 :version "0.1.0-SNAPSHOT",
 :jar-exclusions [#"^\." #"\Q/.\E"],
 :main main.server,
 :global-vars {},
 :uberjar-exclusions
 [#"(?i)^META-INF/[^/]*\.(SF|RSA|DSA)$" #"^module-info.class$"],
 :jvm-opts
 ["-XX:-OmitStackTraceInFastThrow"
  "-XX:+TieredCompilation"
  "-XX:TieredStopAtLevel=1"],
 :dependencies
 ([cider/cider-nrepl "0.28.5"]
  [cider/cider-nrepl "0.28.5"]
  [nrepl "1.0.0"]
  [org.clojure/clojure "1.11.1"]
  [org.clojure/clojurescript "1.11.60"]
  [thheller/shadow-cljs "2.19.9"]
  [binaryage/devtools "1.0.6"]
  [reagent/reagent "1.1.1"]
  [nrepl/nrepl "0.9.0" :exclusions ([org.clojure/clojure])]
  [org.nrepl/incomplete "0.1.0" :exclusions ([org.clojure/clojure])]),
 :release-tasks
 [["vcs" "assert-committed"]
  ["change" "version" "leiningen.release/bump-version" "release"]
  ["vcs" "commit"]
  ["vcs" "tag"]
  ["deploy"]
  ["change" "version" "leiningen.release/bump-version"]
  ["vcs" "commit"]
  ["vcs" "push"]],
 :repl-options
 {:nrepl-middleware
  [cider.nrepl/wrap-apropos
   cider.nrepl/wrap-classpath
   cider.nrepl/wrap-clojuredocs
   cider.nrepl/wrap-complete
   cider.nrepl/wrap-content-type
   cider.nrepl/wrap-debug
   cider.nrepl/wrap-enlighten
   cider.nrepl/wrap-format
   cider.nrepl/wrap-info
   cider.nrepl/wrap-inspect
   cider.nrepl/wrap-macroexpand
   cider.nrepl/wrap-ns
   cider.nrepl/wrap-out
   cider.nrepl/wrap-slurp
   cider.nrepl/wrap-profile
   cider.nrepl/wrap-refresh
   cider.nrepl/wrap-resource
   cider.nrepl/wrap-spec
   cider.nrepl/wrap-stacktrace
   cider.nrepl/wrap-test
   cider.nrepl/wrap-trace
   cider.nrepl/wrap-tracker
   cider.nrepl/wrap-undef
   cider.nrepl/wrap-version
   cider.nrepl/wrap-xref]},
 :test-selectors {:default (constantly true)}}

I tested that Calva works without the [:repl-options :nrepl-middleware] injection, and it works just fine, so maybe the injection has never really worked?

`pprint` does seem to tell me something, even though I'm not savvy enough to interpret the message, so I'll paste the whole output to avoid deleting some clue: ``` $ lein update-in :dependencies conj '[nrepl,"1.0.0"]' -- update-in :dependencies conj '[cider/cider-nrepl,"0.28.5"]' -- update-in :plugins conj '[lein-pprint,"1.3.2"]' -- update-in :plugins conj '[cider/cider-nrepl,"0.28.5"]' -- update-in '[:repl-options,:nrepl-middleware]' conj '[cider.nrepl/cider-middleware,shadow.cljs.devtools.server.nrepl/middleware]' -- pprint {:description "FIXME: write description", :compile-path "/Users/pez/Projects/tests/shadow-w-backend/target/default/classes", :deploy-repositories [["clojars" {:url "https://repo.clojars.org/", :password :gpg, :username :gpg}]], :group "lein-app", :resource-paths ("/Users/pez/Projects/tests/shadow-w-backend/dev-resources" "/Users/pez/Projects/tests/shadow-w-backend/resources"), :uberjar-merge-with {"META-INF/plexus/components.xml" leiningen.uberjar/components-merger, "data_readers.clj" leiningen.uberjar/clj-map-merger, #"META-INF/services/.*" [clojure.core/slurp (fn* [p1__7737__7739__auto__ p2__7738__7740__auto__] (clojure.core/str p1__7737__7739__auto__ "\n" p2__7738__7740__auto__)) clojure.core/spit]}, :name "lein-app", :checkout-deps-shares [:source-paths :test-paths :resource-paths :compile-path #'leiningen.core.classpath/checkout-deps-paths], :source-paths ("/Users/pez/Projects/tests/shadow-w-backend/src"), :eval-in :subprocess, :repositories [["central" {:url "https://repo1.maven.org/maven2/", :snapshots false}] ["clojars" {:url "https://repo.clojars.org/"}]], :test-paths ("/Users/pez/Projects/tests/shadow-w-backend/test"), :target-path "/Users/pez/Projects/tests/shadow-w-backend/target/default", :prep-tasks ["javac" "compile"], :native-path "/Users/pez/Projects/tests/shadow-w-backend/target/default/native", :offline? false, :root "/Users/pez/Projects/tests/shadow-w-backend", :pedantic? ranges, :clean-targets [:target-path], :plugins [[lein-pprint "1.3.2"] [cider/cider-nrepl "0.28.5"]], :profiles {:uberjar {:aot [:all], :jvm-opts ["-Dclojure.compiler.direct-linking=true"]}}, :plugin-repositories [["central" {:url "https://repo1.maven.org/maven2/", :snapshots false}] ["clojars" {:url "https://repo.clojars.org/"}]], :aliases {"downgrade" "upgrade"}, :version "0.1.0-SNAPSHOT", :jar-exclusions [#"^\." #"\Q/.\E"], :main main.server, :global-vars {}, :repl-options, {:nrepl-middleware] ([cider.nrepl/cider-middleware shadow.cljs.devtools.server.nrepl/middleware])}, :uberjar-exclusions [#"(?i)^META-INF/[^/]*\.(SF|RSA|DSA)$" #"^module-info.class$"], :jvm-opts ["-XX:-OmitStackTraceInFastThrow" "-XX:+TieredCompilation" "-XX:TieredStopAtLevel=1"], :dependencies ([cider/cider-nrepl "0.28.5"] [cider/cider-nrepl "0.28.5"] [cider/cider-nrepl "0.28.5"] [nrepl "1.0.0"] [org.clojure/clojure "1.11.1"] [org.clojure/clojurescript "1.11.60"] [thheller/shadow-cljs "2.19.9"] [binaryage/devtools "1.0.6"] [reagent/reagent "1.1.1"] [nrepl/nrepl "0.9.0" :exclusions ([org.clojure/clojure])] [org.nrepl/incomplete "0.1.0" :exclusions ([org.clojure/clojure])]), :release-tasks [["vcs" "assert-committed"] ["change" "version" "leiningen.release/bump-version" "release"] ["vcs" "commit"] ["vcs" "tag"] ["deploy"] ["change" "version" "leiningen.release/bump-version"] ["vcs" "commit"] ["vcs" "push"]], :repl-options {:nrepl-middleware [cider.nrepl/wrap-apropos cider.nrepl/wrap-classpath cider.nrepl/wrap-clojuredocs cider.nrepl/wrap-complete cider.nrepl/wrap-content-type cider.nrepl/wrap-debug cider.nrepl/wrap-enlighten cider.nrepl/wrap-format cider.nrepl/wrap-info cider.nrepl/wrap-inspect cider.nrepl/wrap-macroexpand cider.nrepl/wrap-ns cider.nrepl/wrap-out cider.nrepl/wrap-slurp cider.nrepl/wrap-profile cider.nrepl/wrap-refresh cider.nrepl/wrap-resource cider.nrepl/wrap-spec cider.nrepl/wrap-stacktrace cider.nrepl/wrap-test cider.nrepl/wrap-trace cider.nrepl/wrap-tracker cider.nrepl/wrap-undef cider.nrepl/wrap-version cider.nrepl/wrap-xref cider.nrepl/wrap-apropos cider.nrepl/wrap-classpath cider.nrepl/wrap-clojuredocs cider.nrepl/wrap-complete cider.nrepl/wrap-content-type cider.nrepl/wrap-debug cider.nrepl/wrap-enlighten cider.nrepl/wrap-format cider.nrepl/wrap-info cider.nrepl/wrap-inspect cider.nrepl/wrap-macroexpand cider.nrepl/wrap-ns cider.nrepl/wrap-out cider.nrepl/wrap-slurp cider.nrepl/wrap-profile cider.nrepl/wrap-refresh cider.nrepl/wrap-resource cider.nrepl/wrap-spec cider.nrepl/wrap-stacktrace cider.nrepl/wrap-test cider.nrepl/wrap-trace cider.nrepl/wrap-tracker cider.nrepl/wrap-undef cider.nrepl/wrap-version cider.nrepl/wrap-xref]}, :test-selectors {:default (constantly true)}} ``` I notice: 1. `[:repl-options :nrepl-middleware]` appears twice 1. the first time it appears it looks broken 1. in the second apperance any shadow middleware is absent 1. in the second appearance all entries are appearing twice If I completely remove the `[:repl-options :nrepl-middleware]` injection, pprint still reports the last entry. Where the same cider.nrepl middlewares are included, but only once: ``` lein update-in :dependencies conj '[nrepl,"1.0.0"]' -- update-in :dependencies conj '[cider/cider-nrepl,"0.28.5"]' -- update-in :plugins conj '[lein-pprint,"1.3.2"]' -- update-in :plugins conj '[cider/cider-nrepl,"0.28.5"]' -- pprint {:description "FIXME: write description", :compile-path "/Users/pez/Projects/tests/shadow-w-backend/target/default/classes", :deploy-repositories [["clojars" {:url "https://repo.clojars.org/", :password :gpg, :username :gpg}]], :group "lein-app", :resource-paths ("/Users/pez/Projects/tests/shadow-w-backend/dev-resources" "/Users/pez/Projects/tests/shadow-w-backend/resources"), :uberjar-merge-with {"META-INF/plexus/components.xml" leiningen.uberjar/components-merger, "data_readers.clj" leiningen.uberjar/clj-map-merger, #"META-INF/services/.*" [clojure.core/slurp (fn* [p1__7737__7739__auto__ p2__7738__7740__auto__] (clojure.core/str p1__7737__7739__auto__ "\n" p2__7738__7740__auto__)) clojure.core/spit]}, :name "lein-app", :checkout-deps-shares [:source-paths :test-paths :resource-paths :compile-path #'leiningen.core.classpath/checkout-deps-paths], :source-paths ("/Users/pez/Projects/tests/shadow-w-backend/src"), :eval-in :subprocess, :repositories [["central" {:url "https://repo1.maven.org/maven2/", :snapshots false}] ["clojars" {:url "https://repo.clojars.org/"}]], :test-paths ("/Users/pez/Projects/tests/shadow-w-backend/test"), :target-path "/Users/pez/Projects/tests/shadow-w-backend/target/default", :prep-tasks ["javac" "compile"], :native-path "/Users/pez/Projects/tests/shadow-w-backend/target/default/native", :offline? false, :root "/Users/pez/Projects/tests/shadow-w-backend", :pedantic? ranges, :clean-targets [:target-path], :plugins [[lein-pprint "1.3.2"] [cider/cider-nrepl "0.28.5"]], :profiles {:uberjar {:aot [:all], :jvm-opts ["-Dclojure.compiler.direct-linking=true"]}}, :plugin-repositories [["central" {:url "https://repo1.maven.org/maven2/", :snapshots false}] ["clojars" {:url "https://repo.clojars.org/"}]], :aliases {"downgrade" "upgrade"}, :version "0.1.0-SNAPSHOT", :jar-exclusions [#"^\." #"\Q/.\E"], :main main.server, :global-vars {}, :uberjar-exclusions [#"(?i)^META-INF/[^/]*\.(SF|RSA|DSA)$" #"^module-info.class$"], :jvm-opts ["-XX:-OmitStackTraceInFastThrow" "-XX:+TieredCompilation" "-XX:TieredStopAtLevel=1"], :dependencies ([cider/cider-nrepl "0.28.5"] [cider/cider-nrepl "0.28.5"] [nrepl "1.0.0"] [org.clojure/clojure "1.11.1"] [org.clojure/clojurescript "1.11.60"] [thheller/shadow-cljs "2.19.9"] [binaryage/devtools "1.0.6"] [reagent/reagent "1.1.1"] [nrepl/nrepl "0.9.0" :exclusions ([org.clojure/clojure])] [org.nrepl/incomplete "0.1.0" :exclusions ([org.clojure/clojure])]), :release-tasks [["vcs" "assert-committed"] ["change" "version" "leiningen.release/bump-version" "release"] ["vcs" "commit"] ["vcs" "tag"] ["deploy"] ["change" "version" "leiningen.release/bump-version"] ["vcs" "commit"] ["vcs" "push"]], :repl-options {:nrepl-middleware [cider.nrepl/wrap-apropos cider.nrepl/wrap-classpath cider.nrepl/wrap-clojuredocs cider.nrepl/wrap-complete cider.nrepl/wrap-content-type cider.nrepl/wrap-debug cider.nrepl/wrap-enlighten cider.nrepl/wrap-format cider.nrepl/wrap-info cider.nrepl/wrap-inspect cider.nrepl/wrap-macroexpand cider.nrepl/wrap-ns cider.nrepl/wrap-out cider.nrepl/wrap-slurp cider.nrepl/wrap-profile cider.nrepl/wrap-refresh cider.nrepl/wrap-resource cider.nrepl/wrap-spec cider.nrepl/wrap-stacktrace cider.nrepl/wrap-test cider.nrepl/wrap-trace cider.nrepl/wrap-tracker cider.nrepl/wrap-undef cider.nrepl/wrap-version cider.nrepl/wrap-xref]}, :test-selectors {:default (constantly true)}} ``` I tested that Calva works without the `[:repl-options :nrepl-middleware]` injection, and it works just fine, so maybe the injection has never really worked?
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: leiningen/leiningen#10
Loading…
There is no content yet.