This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-09
Channels
- # adventofcode (132)
- # announcements (19)
- # babashka (7)
- # babashka-sci-dev (6)
- # beginners (46)
- # calva (25)
- # chlorine-clover (5)
- # cider (2)
- # clara (17)
- # clj-kondo (93)
- # clojure (2)
- # clojure-dev (4)
- # clojure-europe (12)
- # clojure-losangeles (3)
- # clojure-nl (7)
- # clojure-uk (4)
- # clojurescript (29)
- # conjure (6)
- # core-async (8)
- # cursive (16)
- # data-science (7)
- # datomic (1)
- # exercism (4)
- # figwheel-main (8)
- # fulcro (9)
- # graphql (2)
- # helix (1)
- # introduce-yourself (3)
- # jobs (3)
- # lsp (4)
- # malli (20)
- # minecraft (3)
- # nextjournal (62)
- # off-topic (16)
- # overtone (34)
- # pathom (5)
- # polylith (10)
- # portal (1)
- # re-frame (104)
- # reagent (29)
- # reitit (1)
- # remote-jobs (2)
- # rum (3)
- # shadow-cljs (22)
- # spacemacs (2)
- # sql (10)
- # tools-deps (17)
- # vim (13)
I'm not sure if this is the correct place to ask but... I just spent over an hour trying to figure out why I got this:
$ clj
Error building classpath. class clojure.lang.Symbol cannot be cast to class clojure.lang.Keyword (clojure.lang.Symbol and clojure.lang.Keyword are in unnamed module of loader 'app')
java.lang.ClassCastException: class clojure.lang.Symbol cannot be cast to class clojure.lang.Keyword (clojure.lang.Symbol and clojure.lang.Keyword are in unnamed module of loader 'app')
at clojure.lang.Keyword.compareTo(Keyword.java:114)
at clojure.lang.Util.compare(Util.java:153)
at clojure.lang.APersistentVector.compareTo(APersistentVector.java:439)
at clojure.lang.Util.compare(Util.java:153)
at clojure.core$compare.invokeStatic(core.clj:842)
at clojure.core$compare.invoke(core.clj:833)
at clojure.lang.AFunction.compare(AFunction.java:51)
at java.base/java.util.TimSort.binarySort(TimSort.java:296)
at java.base/java.util.TimSort.sort(TimSort.java:239)
at java.base/java.util.Arrays.sort(Arrays.java:1441)
at clojure.core$sort.invokeStatic(core.clj:3103)
at clojure.core$sort.invokeStatic(core.clj:3090)
at clojure.tools.deps.alpha$sort_paths.invokeStatic(alpha.clj:565)
at clojure.tools.deps.alpha$flatten_libs.invokeStatic(alpha.clj:573)
at clojure.tools.deps.alpha$make_classpath_map.invokeStatic(alpha.clj:592)
at clojure.tools.deps.alpha$calc_basis.invokeStatic(alpha.clj:738)
at clojure.tools.deps.alpha.script.make_classpath2$run_core.invokeStatic(make_classpath2.clj:128)
at clojure.tools.deps.alpha.script.make_classpath2$run.invokeStatic(make_classpath2.clj:170)
at clojure.tools.deps.alpha.script.make_classpath2$_main.invokeStatic(make_classpath2.clj:224)
at clojure.tools.deps.alpha.script.make_classpath2$_main.doInvoke(make_classpath2.clj:191)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.main$main_opt.invokeStatic(main.clj:514)
at clojure.main$main_opt.invoke(main.clj:510)
at clojure.main$main.invokeStatic(main.clj:664)
at clojure.main$main.doInvoke(main.clj:616)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.main.main(main.java:40)
and was digging through tools.deps sources which led me here: https://github.com/clojure/tools.deps.alpha/blob/a4aa25a54b6bc7bb0b87e7e553276cd5b0463417/src/main/clojure/clojure/tools/deps/alpha.clj#L569
and then found out that one of my my libspecs had a :
in front of it... and thus that sort was being invoked with something like:
(sort '[[:com.wsscode/pathom-viz lilactown/helix cljs-bean/cljs-bean] [nubank/workspaces cljsjs/highlight])
So the request would be for some better error/sanity checking when building the classpath map, to confirm the data is valid.https://practical.li/clojure/continuous-integration/github-actions/clj-kondo-lint.html
Thanks, I'm aware of kondo's ability to lint deps files. Personally I experienced performance problems when I used it last (integrating with cursive), but I'll try it again. I would say though, because t.d.a is such an essential tool when working with clojure I think it makes sense to add basic sanity checking to the config map. Imagine someone new to the language who has a single character typo and as a result sees that stacktrace which gives no clue as to how to proceed or where to look. Seems like a great opportunity to improve the user experience of using clojure.
thanks, we have specs for the deps file but for historical reasons, they're not being used yet, thanks for the bump
hi! is there a way to set the jvm version clojure cli uses? didn’t manage to find anything in the docs.
It uses whatever Java version you have on the path
So totally up to you :)
Can I use a project that uses leiningen as a local dep (i.e. is there some way to tell tools.deps the manifest type is a project.clj
file?
currently, no but there is a pending ticket/patch for this
@kiraemclean A workaround could be to add the deps of that project to your project and then include that project using {:git/url ... :sha ... :deps/manifest :deps}
but since you already have that project locally, you can also use lein pom
to write a pom.xml
and then tools.deps will understand it without any other changes