This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-01-08
Channels
- # asami (7)
- # aws (2)
- # babashka (21)
- # beginners (602)
- # calva (8)
- # cider (11)
- # clj-kondo (10)
- # cljfx (1)
- # clojure (177)
- # clojure-europe (43)
- # clojure-nl (3)
- # clojure-taiwan (2)
- # clojure-uk (45)
- # clojurescript (31)
- # depstar (8)
- # figwheel-main (2)
- # fulcro (12)
- # hugsql (2)
- # java (1)
- # jobs (2)
- # meander (1)
- # missionary (1)
- # off-topic (67)
- # other-languages (1)
- # pathom (212)
- # polylith (4)
- # rdf (1)
- # re-frame (10)
- # reagent (12)
- # reitit (28)
- # reveal (3)
- # shadow-cljs (21)
- # spacemacs (7)
- # sql (5)
- # tools-deps (12)
- # vim (1)
Hi, I'm trying to do a dry-run that would pre-download all deps needed for uberjar build with depstar 2.0.
I tried something like this clojure -Sdeps '{:mvn/local-repo "./.m2/repository"}' -Xdepstar
but depstar still downloads to $HOME/.m2
.
Moving :mvn/local-repo
into the depstar
alias did not help. Any ideas?
by further experimenting I found out that only -Sdeps
deps config is ignored. If I put it into one of other possible locations it works.
@katox depstar
computes the project basis from the deps.edn
files only. -Sdeps
affects the classpath used to run depstar
. It does not affect the classpath depstar
uses to find things to put into the JAR.
What you could do is tell depstar
to use the classpath that clojure -Sdeps ...
computes: clojure -X:depstar :classpath $(clojure -Spath -Sdeps ...)
@seancorfield thank you it makes sense.
However this is not about classpath this is about where depstar itself tries to find .jar
files in while resolving versions. -Sdeps
is used to specify the merged config (ephemeral deps.edn) not dependencies (the :deps
key itself).
So in the end the solution was to put {:mvn/local-repo "./.m2/repository"}
into ~/.clojure/deps.edn
for CI to pick up (while preserving the default for developers). It works as expected it's just very confusing that it doesn't work when specified as config data on the command line (the reference docs mention the merge as root/user/project/config
).
The other thing is that mvn/local-repo
is undocumented I found it while searching forums.
Ah, yeah, just the classpath setting alone isn't going to help. depstar
used to use the runtime basis for the JAR file but multiple people from Cognitect said it was a bad idea (including the original author) so when I produced the 2.0 version, I switched it to use the project basis per their recommendation -- and it is how a lot of other tools work, using just the EDN files. I think this separation of the runtime basis (used to run the tool) and the project basis (used by the tool to do whatever its job is) is something folks are going to have to get used to: -Sdeps
doesn't affect any of those tools that compute the project basis from the EDN files.
By the time depstar
runs, -Sdeps
has "gone away". It's an option for the Clojure CLI script itself, not the tool that is being run.