Fork me on GitHub

is it necessary to include clojure as a dep in the deps.edn? I've seen a few projects with it included.


There was a news-and-articles by daniel janus recently about this

Alex Miller (Clojure team)12:05:28

Yes, but it is included by default


My personal thoughts are that you should mark your minimum required version. Because if you don't update your computer (for some reason) and then rock up on a project using Clojure 1.22 features, and you've got 1.15 you'll be scratching your head for a while. One less thing to manage externally.

💯 4

It's more to do with docker containers. If I can remove the dependency (as it's already there as part of openjdk-11-tools-deps-slim-buster), then I can remove it from the deps.edn file, thus making the binary ever so slightly smaller.


Hmm, I think you'll only get one copy either way...

Alex Miller (Clojure team)14:05:32

you need to have it, and you will via the install deps.edn, it's just a question of version


Maybe by removing it, you're just forcing to match the version in your docker.


Probably safer to leave it in.


After all, storage is cheap 🙂


Hello, I've seen examples of installing dependencies using clj -Sdeps '{:deps {bidi {:mvn/version "2.1.6"}}}' but I was wondering if it's possible to instruct clj to install dependencies listed in deps.edn without doing anything else? Similar to lein deps I suppose.


clj -Spath as an option. it will download dependencies and print out calculated class-path


I think I've seen clj -e nil given as a quieter example.

☝️ 4

I've used clj -e :deps-download-complete when building Docker images


Thanks for the suggestions, that's really helpful. My use case is also for building Docker images.

👍 4

is there a way via clj to see all available aliases?

Alex Miller (Clojure team)17:05:56

Not currently. I’ve been thinking about adding thAt

👍 4

np, thanks


I apologize for the probably FAQ, but I have searched for this… when I specify a gitlib as a dependency, is there a way to specify the path within the gitlib to the source code? e.g. there’s a dep I’d like to use which has its Clojure code in src/clj/


@aviflax 👋 That would be :deps/root :)


👋 Hi Dominic, thanks! I saw :deps/root in the docs, but the description therein says: > Specifies the relative path within the root to search for the manifest file. In the case of this particular dep, the manifest file doesn’t even really exist… I’m faking it by manually setting :deps/manifest to :deps, to finagle tools.deps into treating this dep as if it has an empty deps.edn, which works in this case because the dep has no dependencies itself. Anyway, that’s why I didn’t try it, but it makes sense that it would also change how the lib is added to the classpath. I’ll try it. Thanks!


Hmm that’s not quite working. I set :deps/root to src/clj but the path added to the classpath is /src/clj/src 😞


Oh I see "to the source code". Yeah, that makes sense. I'm not sure you can get away with that.


I figured. I kinda wish there was a way to override that src segment that tools.deps adds to the end of the root. Something like :deps/code-path or something.


It would probably be :deps/paths or something :).


Thanks for the link, but I’m not really understanding that function. I think you’re pointing out that there isn’t currently a way to do this?


I was thinking maybe :deps/paths but I’m not sure about the plural part. I’m not sure it makes sense to add multiple entries to the classpath for a dep.


Tried that already.


Doesn’t work in this case, see above.


@aviflax I am saying there's no way to do this currently :)


Yup, got it. Thanks though!


I guess I’ll open a ticket/issue as a feature request, couldn’t hurt.

Alex Miller (Clojure team)19:05:47

I think this already does what you want


Oh! What am I missing?

Alex Miller (Clojure team)19:05:09

or rather let me back up...

Alex Miller (Clojure team)19:05:19

what kind of project is the git dep?

Alex Miller (Clojure team)19:05:30

what kind of manifest file (pom, lein, deps)




but it has no deps


so I’m specifying :deps/manifest as :deps

Alex Miller (Clojure team)19:05:01

that should just work - what doesn't work?


In the dep’s dir structure, the Clojure code is in `src/clj/`


I tried setting `:deps/root` to `src/clj` but the path added to the classpath was then `/src/clj/src`

Alex Miller (Clojure team)19:05:05

yeah, there is no way right now to externally set a git dep's paths


would a ticket be helpful?

Alex Miller (Clojure team)19:05:45

you coudl fork it and add a deps.edn though


ah, good point. Maybe I will. Thanks!

Alex Miller (Clojure team)19:05:21

or clone and do the same with a local project


I was thinking maybe I’ll open a PR to contribute the deps.edn to the main project; I’d rather not use a fork indefinitely


I posted the request as a question to ask as that seems to be the preferred way to suggest an issue these days:

Alex Miller (Clojure team)19:05:33

I think the question presupposes the need to do this, but maybe the broader request is about supporting lein projects

Alex Miller (Clojure team)19:05:05

or even more broader, supporting extensible project types, one of which could be lein

Alex Miller (Clojure team)19:05:49

tools.deps is actually written to support this but clj does not expose that capability currently (b/c there are a lot of questions about how to do it well)


I can see it being a kind of support nightmare


I’m sure a million edge cases would pop up


maybe once tools.deps drops the “alpha” — then there could be a subsequent alpha/beta/whatever release that would enable the feature, with the caveat that it’s unstable, only for testing, etc?