Fork me on GitHub
#tools-deps
<
2022-04-11
>
olaf07:04:47

Hey, where clojure tools is caching the dependencies list/classpath? I have a project that is using rewrite-clj and in a babashka script in the same project (for error) I imported rewrite-cljs. Since then I’m unable to run a REPL since is requiring the cljs version of the library that is causing conflicts in the code. rewrite-cljs is not present at all in the project, I removed .cpcache , .shadow-cljs and ~/.m2/repository/rewrite-cljs without success. If I run something with clj -M:dev foo and run ps -aef | grep rewrite-cljs in a separate terminal, I see

/usr/bin/java -Dconf=dev-config.edn -Dclojure.basis=.cpcache/1039881647.basis -classpath [...]:/Users/olaf/.m2/repository/rewrite-cljs/rewrite-cljs/0.4.5/rewrite-cljs-0.4.5.jar:[...]
Don’t know how to remove it.

borkdude07:04:15

@eliascotto94 you should not use rewrite-cljs anymore, that library was merged into rewrite-clj

olaf07:04:49

Yep, I know. Just I cannot remove it from the project

borkdude07:04:49

You can do clojure -Stree to see how it's pulled in and then add an :exclusion

olaf07:04:21

It shows only rewrite-clj so is not a dependency at all

borkdude07:04:23

@eliascotto94 Remove ~/.clojure/.cpcache as well

olaf07:04:10

Tried but nothing changed

borkdude07:04:25

Can you post the output of clojure -Stree -A:dev in a reply on this message (thread)?

borkdude07:04:57

Can you try:

clojure -Sforce -M:dev foo

borkdude07:04:36

and do you know for sure that the ps -aef output matches the last java process you spawned and not an old one?

borkdude07:04:47

try killall -9 java first

olaf07:04:48

Killed all node and java. run with -Sforce, opened another window and typed ps -aef | grep rewrite-cljs. Only one process with rewrite-cljs in the classpath

olaf07:04:54

So nothing changed

borkdude08:04:51

Is the project public?

olaf08:04:46

No, but I can give you access to the repo. If I search inside the project for rewrite-cljs nothing comes out

Alex Miller (Clojure team)12:04:57

Did you check -/.clojure/deps.edn ?

lread14:04:39

@eliascotto94 I see your same question in #rewrite-clj and there you mentioned you are using shadow-cljs. Try npx shadow-cljs info … I think that is how you ask shadow-cljs to show dependencies…?

lread14:04:10

(Maybe you are using a shadow-cljs.edn?)

borkdude18:04:16

@eliascotto94 I checked out your repo now. And when I ded clojure -Stree -A:dev I see this:

day8.re-frame/re-frame-10x 1.2.5
  X binaryage/devtools 1.0.5 :use-top
  . com.yahoo.platform.yui/yuicompressor 2.4.8
  . zprint/zprint 1.0.1
    . rewrite-cljs/rewrite-cljs 0.4.5
      X org.clojure/tools.reader 1.3.2 :older-version
    X borkdude/edamame 0.0.11-alpha.12 :use-top
    X rewrite-clj/rewrite-clj 0.6.1 :use-top
  . superstructor/re-highlight 1.1.0
  . cljsjs/highlight 10.3.1-0
So it's re-frame10x which pulls this in via zprint.

borkdude18:04:34

but if you would use a newer zprint, then this problem would be solved since that no longer depends on rewrite-cljs

borkdude18:04:41

Another way to do this is put an :exclusion of rewrite-cljs on re-frame 10x.

olaf21:04:31

Yes, :exclusions worked perfectly. Thanks everyone for the support, it’s the first time I encounter this kind of bug. 🙏 🙏

🎉 1