Fork me on GitHub
#tools-deps
<
2022-01-18
>
lispers-anonymous01:01:32

Is it possible to use git repositories hosted in source hut with the new tools functionality? I'd like to be able to do

clojure -Ttools install  '{:git/tag ...}' :as tool
Looking through the source of tools.deps, there is a hardcoded list of hosted https://github.com/clojure/tools.deps.alpha/blob/dce6bcba266e9261ed671f3f594d7b122f761bf1/src/main/clojure/clojure/tools/deps/alpha/extensions/git.clj#L17-L20 that seems to be parsing the git repo, but sourcehut is absent. I was hoping there would be a way to just provide a url directly

lispers-anonymous02:01:59

I think I have answered this myself (by looking more closely at the code). I can pick a meaningful name and provide a :git/url in the argument map. So this works

clojure -Ttools install  '{:git/tag ... :git/url ""}' :as tool 

duckie 1
Alex Miller (Clojure team)03:01:10

Yes, support for most git url types is supported that way, including git file repos

lispers-anonymous03:01:37

Do you know if it's possible to do this with the clojure -X:deps find-versions tool as well?

Alex Miller (Clojure team)12:01:13

It takes an optional :git/url iirc

Alex Miller (Clojure team)12:01:52

Actually it doesn't, but it easily could

lispers-anonymous13:01:29

That's what I thought, I had poked around but couldn't get it working. Is there a place I can open a ticket for that?

emccue03:01:27

Is there any reason that a basis doesn’t convey which aliases were activated to form its classpath roots? (or is there and I’m just missing it)

viesti11:01:01

Hmm, can :mvn/local-repo be put into an alias, in order to override the cache path in CI (Gitlab) while keeping the default path locally?

viesti11:01:43

ah, by adding

-Sdeps '{:mvn/local-repo ".m2"}

viesti11:01:16

didn't realise that this still reads the deps.edn, thought it would override it 🙂

Aleed20:01:42

what’s the equivalent of a peer dependency with tools.deps? i.e. if I’d like to ensure a library is included but don’t want to put constraints on the version or where it’s loaded from

hiredman20:01:25

That is bad, don't do it

hiredman20:01:50

You have a version you tested with, you should depend on that version

seancorfield20:01:20

(a user of your library can always specify a different version if they want -- but with the usual "not tested against that version" caveats)

hiredman20:01:40

https://research.swtch.com/npm-colors someone involved with golang tools writing about a recent npm issue with packages not depending on specific versions

👍 1
Aleed21:01:34

for this use-case it’s actually for a monorepo. I was looking for a way to specify a global dependency for the project, rather than listing it out in each subproject

Aleed21:01:02

this is for a front-end app, where you wouldn’t want two versions of React running, for example