tools-build

2023-01-29T17:35:31.298059Z

I'm running into a situation where if I use two aliases simultaneously, with different versions of the same maven dependency, an older version in the user config home deps.edn, and more recent version in the project deps.edn alias, the most recent version isn't being used. But I can't seem to immediately make a minimal example of this. Are there known reasons this might happen?

Alex Miller (Clojure team) 2023-01-29T17:39:00.279099Z

can you provide a deps.edn and how you're using it?

Alex Miller (Clojure team) 2023-01-29T17:40:47.987289Z

like are you using create-basis in tools.build? if so, by default it does not use the user deps.edn in config

Alex Miller (Clojure team) 2023-01-29T17:41:09.679349Z

https://clojure.github.io/tools.build/clojure.tools.build.api.html#var-create-basis - you can choose to use it if desired

Alex Miller (Clojure team) 2023-01-29T17:42:38.435279Z

to do so you would call (create-basis {:user :standard})

2023-01-29T17:43:42.909929Z

Ah sorry I meant to post this question in tools-deps, I'm just using the clojure CLI

2023-01-29T17:44:31.459989Z

Will see if I can figure out a minimal repro but my first trivial attempt was working correctly

2023-01-29T17:46:15.868429Z

Though actually now that you mention it maybe create-basis will be useful for debugging this 😅

Alex Miller (Clojure team) 2023-01-29T17:53:45.052059Z

if you're using the CLI, I would also look at -Stree or -Strace to diagnose

🙏 1
borkdude 2023-01-29T19:09:44.775859Z

@jjttjj you're not by any chance having a :deps (without alias) entry in your user clojure deps.edn right?

borkdude 2023-01-29T19:10:37.490959Z

This came up in #tools-deps once: it takes priority over whatever your local deps are which can be confusing

practicalli-johnny 2023-01-29T20:48:15.456239Z

I'd prefer to use a single def to define the configuration for build tasks, rather than individual def statements. Does this example at https://practical.li/clojure/clojure-cli/projects/tools-build/#build-tasks seem to be a reasonable approach? Any alternatives that would make it simpler or anything basic I have missed? Thanks.

Alex Miller (Clojure team) 2023-01-29T20:50:22.020069Z

yes, it is a reasonable approach

👍 1