Fork me on GitHub
#tools-deps
<
2023-08-18
>
Martynas Maciulevičius13:08:35

Hey. What should I do if I want to clean the built jars and dependencies but there is no target/ folder? I have this error but it worked a moment ago:

Caused by: java.lang.Exception: Cyclic load dependency: [ /clojure/spec/alpha ]->/clojure/walk->[ /clojure/spec/alpha ]->/clojure/main->/clojure/core/server
I try to start my REPL and this error happens. Should I nuke my ~/.m2 folder?

Martynas Maciulevičius14:08:39

Moving ~/.m2 and removing ~/.clojure/ helped. Hm.

Martynas Maciulevičius14:08:35

Restoring .m2 directory restores the crash.

Alex Miller (Clojure team)14:08:24

I think you'll have to provide more information, this is pretty devoid of context

Martynas Maciulevičius14:08:38

I was running my REPL just fine and then added a dependency of etaoin/etaoin {:mvn/version "1.0.40"} I decided to restart my REPL and got that error. I don't have a specified clojure version in my deps.edn file and I think that there could've been an upgrade of Clojure jar when I restarted my REPL. I don't have the log of newly started REPL that crashed.

Alex Miller (Clojure team)14:08:10

"added a dependency" how?

Martynas Maciulevičius15:08:02

I added it to deps.edn file and saved the file. I didn't try to add it via dynamic way.

Alex Miller (Clojure team)15:08:07

if you remove it, do you still have the problem?

Martynas Maciulevičius15:08:19

I had the problem still.

Martynas Maciulevičius15:08:42

This is why I started to think about caches and removing them. And it worked when I removed ~/.m2 cache and ~/.clojure cache. And then I restored the error by moving old .m2 directory back into its place.

Alex Miller (Clojure team)15:08:26

well, that doesn't make much sense to me for .m2, it's going to just download the same exact jars

Alex Miller (Clojure team)15:08:02

if it's classpath related, then .clojure might help, but you would want to understand why the classpath is causing the problem

Alex Miller (Clojure team)15:08:46

are you compiling your current project such that it has classes that are produced?

Martynas Maciulevičius15:08:55

Oh right. Right after the error happened I also removed project-dir/.cpcache directory first. Before removing all other ones. And then the error was still there.

Martynas Maciulevičius15:08:21

> are you compiling your current project such that it has classes that are produced? I only ran REPL. I don't even have the config for that yet.

Martynas Maciulevičius15:08:47

dev {:doc "Start REPL"
       :task (if (fs/windows?)
               (clojure "-M:nrepl")
               (shell "rlwrap bb clojure -M:nrepl"))}
This is what's run: clojure -M:nrepl
:nrepl ;; added by neil
  {:extra-deps {nrepl/nrepl {:mvn/version "1.0.0"}
                cider/cider-nrepl {:mvn/version "0.28.7"}}
   :extra-paths ["resources-test"]
   :main-opts ["-m" "nrepl.cmdline" "--interactive" "--color"]} 
Edit: I updated the snippet to match the versions I had during the error.

Alex Miller (Clojure team)15:08:58

can you look at clojure -X:deps tree :aliases '[:nrepl]'

Martynas Maciulevičius15:08:19

But now I don't have the old .m2 dir anymore. I deleted it 😕

Martynas Maciulevičius15:08:50

org.clojure/clojure 1.11.1
  . org.clojure/spec.alpha 0.3.218
  . org.clojure/core.specs.alpha 0.2.62
babashka/babashka.curl 0.1.2
clj-tagsoup/clj-tagsoup 0.3.0
  . org.clojure/data.xml 0.0.3
  . org.clojars.nathell/tagsoup 1.2.1
  . net.java.dev.stax-utils/stax-utils 20040917
org.clj-commons/hickory 0.7.3
  . org.jsoup/jsoup 1.15.2
  . quoin/quoin 0.1.2
dev.weavejester/medley 1.7.0
etaoin/etaoin 1.0.40
  . org.clj-commons/clj-http-lite 1.0.13
  . org.clojure/tools.logging 1.2.4
  . org.clojure/tools.cli 1.0.214
  . slingshot/slingshot 0.12.2
  . clj-http/clj-http 3.12.3
    . org.apache.httpcomponents/httpcore 4.4.14
    . org.apache.httpcomponents/httpclient 4.5.13
      X org.apache.httpcomponents/httpcore 4.4.13 :older-version
      . commons-logging/commons-logging 1.2
      X commons-codec/commons-codec 1.11 :older-version
    . org.apache.httpcomponents/httpclient-cache 4.5.13
      . org.apache.httpcomponents/httpclient 4.5.13
      . commons-logging/commons-logging 1.2
    . org.apache.httpcomponents/httpasyncclient 4.1.4
      X org.apache.httpcomponents/httpcore 4.4.10 :older-version
      . org.apache.httpcomponents/httpcore-nio 4.4.10
        X org.apache.httpcomponents/httpcore 4.4.10 :older-version
      X org.apache.httpcomponents/httpclient 4.5.6 :older-version
      . commons-logging/commons-logging 1.2
    . org.apache.httpcomponents/httpmime 4.5.13
      . org.apache.httpcomponents/httpclient 4.5.13
    . commons-codec/commons-codec 1.15
    . commons-io/commons-io 2.8.0
    . slingshot/slingshot 0.12.2
    . potemkin/potemkin 0.4.5
      . clj-tuple/clj-tuple 0.2.2
      . riddley/riddley 0.1.12
  . cheshire/cheshire 5.11.0
    . com.fasterxml.jackson.core/jackson-core 2.13.3
    . com.fasterxml.jackson.dataformat/jackson-dataformat-smile 2.13.3
      . com.fasterxml.jackson.core/jackson-core 2.13.3
    . com.fasterxml.jackson.dataformat/jackson-dataformat-cbor 2.13.3
      . com.fasterxml.jackson.core/jackson-core 2.13.3
    . tigris/tigris 0.1.2
  . babashka/process 0.3.11
    X babashka/fs 0.1.6 :older-version
  . babashka/fs 0.2.12
nrepl/nrepl 1.0.0
cider/cider-nrepl 0.35.0
  X nrepl/nrepl 1.0.0 :use-top
  . mx.cider/logjam 0.1.1

Alex Miller (Clojure team)15:08:51

I'm on vacaction, so have to run, but I suspect something in the nrepl deps that is affecting your classpath

Martynas Maciulevičius15:08:37

It's fine. Thanks anyway. Edit: Have a good vacation :))

zarkone16:08:05

hi hi 👋 is it possible to specify a certain alias of a local/root dependency in deps.edn ? something like

{:local/root "../project-a"
 :aliases [:dev]}

2
seancorfield16:08:11

No, only top-level aliases can be used with the CLI -- no transitive aliases.

zarkone16:08:25

Got it, thanks!