tools-deps

frankitox 2025-10-04T16:15:35.651339Z

Hello! Is it possible to get another version of a library you specify using {:deps {my-lib/name {:mvn/version "X"}}}?

frankitox 2025-10-06T21:49:41.094229Z

Just for the record, rama is not going to support this. Conversation https://clojurians.slack.com/archives/C05N2M7R6DB/p1759604230258859

dpsutton 2025-10-06T21:58:48.128829Z

that’s super understandable but would be nice if they would shade the deps so you can still use what you like

👍 1
frankitox 2025-10-04T16:17:11.542879Z

I'm getting an error when starting my project

clj -X:server:server/dev
Syntax error compiling at (taoensso/timbre/appenders/core.cljc:50:17).
No such var: enc/println-atomic
So, I started analyzing the output of clj -X:deps tree :aliases "#{:server :server/dev}".

frankitox 2025-10-04T16:18:52.011269Z

Just showing what's relevant:

com.taoensso/encore 3.118.0
com.taoensso/carmine 3.4.1
  X com.taoensso/encore 3.112.0 :use-top
com.rpl/rama 0.22.0
  X com.taoensso/encore 3.66.0 :use-top
This output means I'll get 3.118.0 right? 🤔

frankitox 2025-10-04T16:27:11.937699Z

The thing is I'm sure 3.118.0 exposes https://github.com/taoensso/encore/blob/v3.118.0/src/taoensso/encore.cljc#L7871

dpsutton 2025-10-04T16:52:56.828339Z

what’s the output of

(enumeration-seq (.. (Thread/currentThread) getContextClassLoader (getResources "taoensso/encore.cljc")))

dpsutton 2025-10-04T16:53:55.323119Z

also this to see if there are any aot versions on the classpath

(enumeration-seq (.. (Thread/currentThread) getContextClassLoader (getResources "taoensso/encore__init.class")))

frankitox 2025-10-04T16:57:28.159239Z

This is the ouput

+user=> (enumeration-seq (.. (Thread/currentThread) getContextClassLoader (getResources "taoensso/encore.cljc")))
(#object[java.net.URL 0x7f8633ae "jar:file:/home/self/.m2/repository/com/taoensso/encore/3.118.0/encore-3.118.0.jar!/taoensso/encore.cljc"])
+user=> (enumeration-seq (.. (Thread/currentThread) getContextClassLoader (getResources "taoensso/encore__init.class")))
(#object[java.net.URL 0x8d7b252 "jar:file:/home/self/.m2/repository/com/rpl/rama/0.22.0/rama-0.22.0.jar!/taoensso/encore__init.class"])
Looks ilke rama's version is being used? 🤔

dpsutton 2025-10-04T16:58:10.367019Z

yeah. that comes down to classpath order which one it hits first. but fundamentally rama has an AOT’d version in a library and they are not playing nice in the jvm world

dpsutton 2025-10-04T16:58:51.450029Z

if needed to be bundled inside you should shade it (rename it so there’s no collision like this) or just depend on it and not bundle it inside of your jar.

frankitox 2025-10-04T17:01:50.765929Z

Ughh, thanks

dpsutton 2025-10-04T17:03:22.903879Z

bummer. maybe you can open an issue with rama. But the easiest way forward is to pin your own explicit dependency to the same version as rama until they fix it

frankitox 2025-10-04T17:11:16.778039Z

Nah, it's fine. I'm just happy with an answer. I'll be more careful on taking assumptions based on -X:deps tree. Thanks 🙏

dpsutton 2025-10-04T17:12:31.748399Z

i think your assumption is usually fine. the way it is supposed to work is everyone lists their dependencies and collisions can be handled and sorted. the tree shows duplicates and how they are resolved. but if a jar puts classfiles inside of it and doesn’t say it’s using it, they can’t be excluded and you end up with duplicates like this.

frankitox 2025-10-04T17:22:20.188179Z

Got it 👍 . I just printed the classpath and see what you mean:

com/rpl/rama/0.22.0/rama-0.22.0.jar
com/taoensso/carmine/3.4.1/carmine-3.4.1.jar
com/taoensso/encore/3.118.0/encore-3.118.0.jar
Rama appears before encore

borkdude 2025-10-04T18:42:52.940249Z

I'd still file an issue with Rama though. AOT-ing other libraries is usually a mistake

👍 1