This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-05
Channels
- # announcements (7)
- # babashka (20)
- # beginners (130)
- # bristol-clojurians (1)
- # cider (14)
- # clj-kondo (7)
- # cljdoc (14)
- # cljs-dev (15)
- # cljsrn (16)
- # clojars (11)
- # clojure (190)
- # clojure-dev (4)
- # clojure-europe (7)
- # clojure-italy (9)
- # clojure-nl (3)
- # clojure-romania (6)
- # clojure-uk (51)
- # clojurescript (44)
- # component (4)
- # conjure (28)
- # cursive (1)
- # data-science (4)
- # datascript (1)
- # datomic (30)
- # duct (4)
- # emacs (1)
- # figwheel (4)
- # fulcro (56)
- # graalvm (4)
- # helix (51)
- # jackdaw (2)
- # jobs-discuss (12)
- # joker (4)
- # lambdaisland (1)
- # local-first-clojure (1)
- # meander (73)
- # mid-cities-meetup (2)
- # nrepl (4)
- # off-topic (43)
- # pathom (56)
- # re-frame (37)
- # reagent (26)
- # shadow-cljs (161)
- # slack-help (9)
- # spacemacs (1)
- # tools-deps (18)
- # xtdb (18)
there was a strange bug, I had deleted my .m2 directory some time back, and when I started my nrepl, it would start, but then on compiling a file it would give an error of a missing dep. I changed the deps.edn file, and this triggered something, and on next nrepl startup, it downloaded the dependency. have never seen such a behaviour before.
that all is what I would expect
classpath is computed and then in cached in your .cpcache directory, with pointers into your .m2
clj script doesn't re-check that those files still exist (it could do so, but there are some performance implications and it's a little messy)
changing the deps.edn makes the cached cp stale (it checks that the cp file is newer than all the source deps.edn files)
if you get into this situation again, use -Sforce
to force the cp to be recomputed, which will also trigger a redownload
Hey, I'm running into some issues here, regarding transitive dependencies with deps with logging dependencies (cambium + unilog). Scenario is as follows: 1. I have a shared library that has common libs ( datomic in memory, datomic client, kafka, integrant ... and logging) 2. An application that imports the above shared library I have made all the necessary exclusions in item 1. But when I import in item 2, I got conflicts between slf4j many libraries that I have excluded in item 1. How can I maintain only dependencies required (with exclusions) in item 1 in a transitive way?
can you share your dep.edn to repro?
this is my libs deps
:deps {org.clojure/clojure {:mvn/version "1.10.1"}
fundingcircle/jackdaw {:mvn/version "0.6.9"
:exclusions [org.slf4j/slf4j-log4j12
commons-logging/commons-logging
log4j/log4j
org.slf4j/slf4j-nop
org.slf4j/log4j-over-slf4j
org.clojure/tools.logging]}
datascript/datascript {:mvn/version "0.17.1"}
willa {:mvn/version "0.1.2"}
com.cognitect/anomalies {:mvn/version "0.1.12"}
com.gfredericks/test.chuck {:mvn/version "0.2.10"}
org.apache.kafka/kafka-streams {:mvn/version "2.3.0"
:exclusions [org.slf4j/slf4j-api]}
org.apache.kafka/kafka-streams-test-utils {:mvn/version "2.3.0"}
io.pedestal/pedestal.service {:mvn/version "0.5.7"}
io.pedestal/pedestal.route {:mvn/version "0.5.7"}
io.pedestal/pedestal.jetty {:mvn/version "0.5.7"}
integrant {:mvn/version "0.7.0"}
integrant/repl {:mvn/version "0.3.1"}
duct/core {:mvn/version "0.8.0"}
com.datomic/client-cloud {:mvn/version "0.8.78"
:exclusions [commons-logging/commons-logging]}
com.cognitect.aws/api {:mvn/version "0.8.408"
:exclusions [org.clojure/tools.logging]}
com.cognitect.aws/endpoints {:mvn/version "1.1.11.689"}
com.cognitect.aws/s3 {:mvn/version "780.2.583.0"}
rewrite-clj {:mvn/version "0.6.1"}
compute/datomic-client-memdb
{:git/url ""
:sha "fd880e70b45a0837f1604aa1230047cb74ec536e"
:exclusions [org.slf4j/slf4j-nop org.slf4j/log4j-over-slf4j org.slf4j/jcl-over-slf4j]}
badigeon/badigeon
{:git/url ""
:sha "dca97f9680a6ea204a2504c4414cafc4ba182a83"
:exclusions [org.slf4j/slf4j-nop
org.slf4j/jcl-over-slf4j]}
org.clojure/tools.cli {:mvn/version "0.4.2"}
cambium/cambium.core {:mvn/version "0.9.3"}
cambium/cambium.codec-simple {:mvn/version "0.9.3"}
spootnik/unilog {:mvn/version "0.7.24"}}
And this is my app Deps
:deps {org.clojure/clojure {:mvn/version "1.10.1"}
my.lib {:mvn/version "0.1.11-SNAPSHOT"} ;; This is where I import my lib and get conflicts over slf4j log4j libs
tick {:mvn/version "0.4.20-alpha"}
integrant/repl {:mvn/version "0.3.1"}
com.gfredericks/test.chuck {:mvn/version "0.2.10"}}
are you sure you're actually getting the latest version of your snapshot lib? by default, maven will only refresh snapshots once per day
Yes, I have been working with the latest version of my lib (snapshot)
what conflicts are you seeing?
I see log4j-over-slf4j under spootnik/unilog and other slf4j stuff under cambium - you should look at clj -Stree
and see if what you're getting makes sense
if you want a more fine-grained analysis, use clj -Strace
- that will generate a trace.edn file and you can walk through the :log to see each library it considers in order, whether it included it or not, and why
as a fallback, including it as an explicit dep in your app deps will take precedence over anything below (none of those exclusions are necessary then)
Thanks @alexmiller the fallback choice might work for now. Mean while I have extracted logging dependencies into a separate library to avoid conflicts. Thanks for your help