Fork me on GitHub
#tools-deps
<
2024-03-06
>
tengstrand04:03:16

When I execute e.g. clojure -M:poly it will use ./deps.edn . Can I tell it to use e.g. ./deps2.edn instead? Couldn't find anything about it in the documentation.

dominicm05:03:19

I just woke up answer: I vaguely recall there being an environment variable which controls this

seancorfield05:03:23

There's an env var that specifies the path to the user folder (for the "user" deps.edn) but I don't think you can change the name of the deps.edn file that is read?

tengstrand06:03:15

This could be convenient to have when I test different configurations, but is not super important.

dominicm07:03:15

You're probably right... One option is to use -Sdeps

tengstrand07:03:58

Okay, cool, will try that out. Thank!

twashing18:03:37

Is there a way to control the order of dependencies? Especially deps introduced in :extra-deps in the :aliases section.

Alex Miller (Clojure team)18:03:38

dependencies should be disjoint and thus, the order should not matter

Alex Miller (Clojure team)18:03:05

if that's not true - why?

twashing19:03:48

I agreed, I’m trying to worm my way to a solution, lol. This relates to my question in #clojure. In this particular use case, cider/cider-nrepl has its own data_readers.clj which is preceding the custom one we’ve created… but only in a REPL environment. And I’m going through all these contortions, because I don’t want to rename our default data_readers.clj just for the REPL. But I don’t think I have a choice here. I’m just going to do what you suggested in https://clojurians.slack.com/archives/C03S1KBA2/p1709749448615029?thread_ts=1709749342.395009&amp;cid=C03S1KBA2.

Alex Miller (Clojure team)19:03:52

All the data-reader.clj files on the classpath are loaded, so is this a case where you are trying to change an existing reader mapping?

Alex Miller (Clojure team)19:03:56

Really, I’d say it’s a bug in cider if they are taking this capability away from you

twashing21:03:13

Finally got it. You were right… Our reader tag was in clojure.core/*data-readers*. Our reader tag now works at the REPL and reading edn. But I needed to pass clojure.core/*data-readers* to clojure.edn/read-string.

(let [opts {:readers (merge clojure.core/default-data-readers
                            clojure.core/*data-readers*)}]
     (->> config
          resource
          slurp
          (clojure.edn/read-string opts)))

twashing21:03:21

Cheers 👍:skin-tone-6:

🍻 1