This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-14
Channels
- # adventofcode (12)
- # aleph (8)
- # announcements (6)
- # babashka (16)
- # beginners (217)
- # biff (7)
- # calva (30)
- # chlorine-clover (4)
- # cider (3)
- # clj-kondo (15)
- # cljdoc (6)
- # clojure (50)
- # clojure-europe (86)
- # clojure-finland (2)
- # clojure-nl (1)
- # clojure-norway (37)
- # clojure-uk (2)
- # clojurescript (8)
- # cursive (10)
- # datomic (13)
- # emacs (1)
- # fulcro (41)
- # helix (1)
- # humbleui (2)
- # joyride (7)
- # juxt (4)
- # lsp (19)
- # off-topic (47)
- # pathom (14)
- # polylith (5)
- # portal (7)
- # reagent (10)
- # releases (4)
- # sci (1)
- # scittle (18)
- # shadow-cljs (54)
- # test-check (2)
- # tools-deps (28)
@U47G49KHQ thanks, I'll upvote it
having problems with default-deps
again. In one frontend project, using shadow-cljs + deps.edn, I successfully have the following:
:cider-nrepl {:extra-deps {cider/cider-nrepl nil
refactor-nrepl/refactor-nrepl nil}
:default-deps {cider/cider-nrepl {:mvn/version "0.27.4"}
refactor-nrepl/refactor-nrepl {:mvn/version "2.5.1"}}}
this is overridden in my ~/.clojure/deps.edn
here:
{
:deps {cider/cider-nrepl {:mvn/version "0.28.3"}
nrepl/nrepl {:mvn/version "0.9.0"}
refactor-nrepl/refactor-nrepl {:mvn/version "3.5.2"} }
}
in a new, backend project, I have the following:
:cider-nrepl {:extra-deps
{cider/cider-nrepl nil
refactor-nrepl/refactor-nrepl nil}
;; In theory this makes it possible to override them in your .clojure/deps.edn
:default-deps {cider/cider-nrepl {:mvn/version "0.28.5"}
refactor-nrepl/refactor-nrepl {:mvn/version "3.5.5"}}}
when I run the backend project, it does not let me override the deps, but when I run the frontend project, it does. Any idea of a lead to fixing this?no idea what is relevant version information, but fwiw clojure versions in the frontend project are:
org.clojure/clojure {:mvn/version "1.11.1"}
org.clojure/clojurescript {:mvn/version "1.11.60"}
shadow-cljs has :deps true
, with shadow-cljs version of {:mvn/version "2.19.8"}
(link to github tree as of that commit https://github.com/thheller/shadow-cljs/tree/dd7d5fd71398a60aaa204759b6e06fb6aefa8e2a)
in backend project clojure version is the same, and ran via clojure -M:foo:cider-nrepl
Pretty sure that's not how default deps are supposed to work. You'll get the newest version of a dep that is specified -- you can't override in deps with an older version.
can you just use :replace-deps
?
Specifying :default-deps
alongside nil
deps is going to be the same as specifying those versions directly anyway. And specifying :deps
in your dot-clojure file is going to add those deps to every project, even when you build JAR files etc. Do you really want CIDER/nREPL etc in everything you build?
yeah, I was a little unclear if that was at the root or in an alias
not an alias, since unfortunately the calls in both cases are wrapped in tooling that doesn't make it easy to pass in a custom alias :( I figured for builds I would just isolate them in docker anyway since who knows what people could have locally
Q about classpath ordering: did we establish that t.d.a's classpath ordering is non-deterministic, with only the :paths
guaranteed to be at the "front" of the classpath in some order? i.e., the classpath calculated on one machine can differ in order from the classpath calculated on another machine?
Should not be
More clearly: it should be deterministic
Hmm, I was sure we'd had this discussion... back when the change was made to ensure paths ended up at the beginning of the classpath and not some "random" place within it...?
I changed it
Right, but I thought that was only to ensure paths were at the front, not to ensure a specific ordering consistent across machines...
This was a long time ago now, but I am also sorting deps by tree depth and then by name, which should be stable
For example, if the path to .m2
differs, isn't that going to create different hashes on the paths if they're put into a hash map?
Not hash ordered
Ah, OK, so t.d.a classpath ordering is stable. Thank you. I'll go beat on the Polylith team about that then 🙂 Their computed classpath is not stable.
I believe order will be extra-paths (in order), paths (in order), then deps sorted by tree depth then alpha
But going by memory
I think I have a site issue from you to doc this better actually :)
I got bit because Jetty, bless its heart, decided to keep the same class names across different group/artifact JARs so if you end up with multiple versions (with different coordinates), you can pick up the "wrong" class version...
Thanks!