Fork me on GitHub
#tools-deps
<
2019-11-03
>
athomasoriginal14:11:01

I love cofield’s dot-clojure repo: https://github.com/seancorfield/dot-clojure/blob/master/deps.edn. I would like to make an alias in my own global deps.edn file that will use the latest version of ClojureScript e.g.

{:aliases
 {:cljs 
  :extra-deps {org.clojure/clojurescript {:git/url ""
                                           :sha     "6431e6435ad9fc85e766752f4d6939ff978db5a5"}}
   :main-opts  ["--main" "cljs.main" "--repl-env" "node" "--repl"]}}}
But when I call the above, I get Error building classpath. Destination path "clojurescript" already exists and is not an empty directory. What am I missing here?

athomasoriginal16:11:48

I did a little digging and was able to resolve my issue by executing the following steps: 1. Delete ~/.gitlibs/_repos/github.com/clojure/clojurescript (which was empty) 2. Run clj -A:cljs again Now everything seems to be working again. Is there a command in the tools.deps API that can do this automatically?

Alex Miller (Clojure team)16:11:34

I’ve seen a few people hit this but I have not been able to reproduce it and don’t have a ready fix for it

athomasoriginal16:11:51

Fair. I tried to setup a minimal repro based on what my previous dir structure looked like, but can’t get it right. The best I found is this other interesting scenario 1. Successfully run clj -A:cljs as I have in the code snippet above (then stop the repl) 2. delete content of ~/.gitlibs/libs/org.clojure/clojurescript + ~/.gitlibs/_repos/github.com/clojure/clojurescript (both clojurescript still exist, but they are empty) Now when I run clj -A:cljs I get the following error

Execution error (FileNotFoundException) at clojure.main/main (main.java:40).
Could not locate cljs/main__init.class, cljs/main.clj or cljs/main.cljc on classpath.

Full report at:
/var/folders/qc/mv_jl6857850zkr0qv6gj89m0000gn/T/clojure-5520844173070466309.edn
The above is resolved by deleting .cpcache

athomasoriginal16:11:51

The above seems odd, but that seem to be how my local looked at the time.

borkdude18:11:58

fwiw I had a similar problem recently (went away after deleting .gitlibs and/or .cpcache)

🙌 4
seancorfield20:11:20

@tkjone Or perhaps putting -Sforce on that clj command, to force it to rebuild the cache?

sogaiu20:11:17

i've been doing -Sforce more often than deleting .cpcache with some success recently -- iiuc this will leave older bits in .cpcache if you want to investigate issues later, helpful when reporting issues perhaps?

seancorfield21:11:58

Yeah, you get a separate set of cached files for each alias combination you use, so it's nice to keep the ones that work fine and just override the ones that don't, via -Sforce.