This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-03
Channels
- # announcements (1)
- # babashka (2)
- # beginners (17)
- # calva (11)
- # cider (4)
- # clara (3)
- # clj-kondo (19)
- # cljs-dev (60)
- # clojure (27)
- # clojure-europe (1)
- # clojure-nl (2)
- # clojure-spec (1)
- # clojure-uk (11)
- # clojurescript (128)
- # core-logic (7)
- # cursive (7)
- # data-science (3)
- # datomic (76)
- # defnpodcast (4)
- # fulcro (5)
- # malli (5)
- # off-topic (7)
- # re-frame (1)
- # reitit (3)
- # shadow-cljs (86)
- # spacemacs (5)
- # test-check (48)
- # tools-deps (9)
- # vim (12)
- # xtdb (6)
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?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?
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
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
The above seems odd, but that seem to be how my local looked at the time.
fwiw I had a similar problem recently (went away after deleting .gitlibs and/or .cpcache)
@tkjone Or perhaps putting -Sforce
on that clj
command, to force it to rebuild the cache?
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?
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
.