This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-22
Channels
- # announcements (88)
- # autochrome-github (2)
- # babashka (26)
- # beginners (5)
- # biff (2)
- # cider (73)
- # clj-kondo (4)
- # cljsrn (6)
- # clojure (54)
- # clojure-art (3)
- # clojure-europe (73)
- # clojure-germany (5)
- # clojure-new-zealand (1)
- # clojure-nl (13)
- # clojure-norway (16)
- # clojure-uk (8)
- # clojurescript (73)
- # conjure (1)
- # core-async (10)
- # cursive (17)
- # datahike (51)
- # datalevin (21)
- # datomic (4)
- # emacs (2)
- # events (3)
- # fulcro (35)
- # honeysql (6)
- # introduce-yourself (1)
- # jackdaw (3)
- # jobs (1)
- # leiningen (4)
- # lsp (3)
- # malli (17)
- # off-topic (60)
- # other-languages (5)
- # pathom (17)
- # pedestal (3)
- # polylith (19)
- # portal (2)
- # practicalli (1)
- # rdf (14)
- # reitit (3)
- # releases (1)
- # reveal (9)
- # sci (1)
- # shadow-cljs (26)
- # spacemacs (17)
- # sql (4)
- # testing (10)
- # tools-build (6)
- # tools-deps (16)
- # vim (9)
I am experimenting running Clojure REPL in a podmain container which has a kind of "restricted" $HOME directory.
(read-only and a lot of environment variables are not set).
I saw that starting clojure clojure
CLI tries to download clojure jars from maven, and tries to write them into /.m2/
I could not find anywhere what controls the place of writing of the jars. It is not HOME
, neither M2_REPO
environment vars because changing them does not make a difference.
Is there a way to configure this location ?
For reference the exception is:
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.clojure:clojure:pom:1.10.3 from/to central ( ): /.m2/repository/org/clojure/clojure/1.10.3/clojure-1.10.3.pom.part.lock (No such file or directory)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:425)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:229)
at org.eclipse.aether.internal.impl.
Thanks, saw it now.
Hmm. It uses the "tilde" which I cannot change. And inside the container there is no ".clojure/deps.edn" file (yet) which I could change.
So in some form the clojure
CLI cannot run
in an environment (container) where the "current user" has no home directory assigned in the /etc/passwd
file
(and this is the source for the ~ expansion)
Even Though the place for the .clojure
directory can be changed, the place for m2
cannot, at least not "in one go".
To have this automated, would require a 4 step process:
1. export HOME=/tmp
2. clojure -e ":ok" -> will create /tmp/.clojure/deps.edn
3. some command line magic to set :mvn/local-repo
inside /tmp/.clojure/deps.edn
you can use -Sdeps '{:mvn/local-repo "wherever"}'
it's unclear to me if that addresses everything you need
you don't need a .clojure/deps.edn (using -Srepro
will skip it, but I'm not sure that's even needed here)
yes, it does. That was the trick. Thanks.
If I see . com.google.guava/guava 31.0.1-jre :newer-version
in the output of clojure -Stree
, should I expect that I'm using this version of guava? And if so, why does putting an explicit dep of that same version at the top level of my deps.edn fix my issue?
t.d.a prefers top-level versions over transitive deps by design so you can easily control this sort of thing.
The .
means "using this". If it had X
it would mean "not using this".