This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-24
Channels
- # aleph (1)
- # babashka (2)
- # beginners (25)
- # calva (5)
- # cider (8)
- # cljdoc (4)
- # clojure (81)
- # clojure-europe (41)
- # clojure-spec (11)
- # clojurescript (7)
- # conjure (1)
- # data-science (1)
- # datomic (25)
- # defnpodcast (3)
- # events (2)
- # figwheel-main (8)
- # fulcro (5)
- # helix (4)
- # hugsql (1)
- # java (2)
- # off-topic (35)
- # onyx (18)
- # pathom (8)
- # rdf (5)
- # re-frame (9)
- # reagent (3)
- # reitit (1)
- # shadow-cljs (39)
- # tools-deps (53)
- # xtdb (23)
{:aliases {:foo ["bar"]}}
and clj -A:foo
produces interesting results :P
e.g.
:resolve-args {\b \a},
:classpath-args {\b \a},
Hi! What is the relationship of versions between Clojure and tools.deps? Latest Clojure download is https://download.clojure.org/install/linux-install-1.10.1.727.sh, latest https://github.com/clojure/tools.deps.alpha#release-information. If I install that Clojure, which deps will I get? I.e. what command-line options will clojure
support? Thank you!
The change logs for the two are cross linked and you can find official release info at https://clojure.org/releases/tools
The docs on the Clojure site always reflect the latest stable release (or use -h or the man page)
Thank you! I should have noticed the " See the changelog for version information." at https://clojure.org/guides/getting_started
Q1: Does :local/root
need to be an absolute path? If so - I guess it isn't possible to use something like "~/path/to/it" (to make it portable across users)?
Q2: Why am I getting
> Error building classpath. No coordinate type found for library cryogen-asciidoc/cryogen-asciidoc in coordinate {:local-root "/Users/me/external/cryogen-all/cryogen-asciidoc"}
when head /Users/me/external/cryogen-all/cryogen-asciidoc/pom.xml
returns successfully (modified)
...
<groupId>cryogen-asciidoc</groupId>
<artifactId>cryogen-asciidoc</artifactId>
...
?https://github.com/lambdaisland/chui/blob/master/deps.edn#L4 is an example of relative paths. I think if you use an absolute path like ~/some/path
it will not be portable at all
You can’t use ~ - that’s a shell thing
Not sure if that solves your q2 or not but if not share your deps.edn
Here is it
{:deps {org.clojure/clojure {:mvn/version "1.10.1"}
ring-server/ring-server {:mvn/version "0.5.0"}
ring/ring-devel {:mvn/version "1.7.1"}
compojure/compojure {:mvn/version "1.6.1"}
cryogen-core/cryogen-core {:mvn/version "0.3.2"}
#_#_cryogen-core/cryogen-core {:local-root "../../external/cryogen-all/cryogen-core"}
#_#_cryogen-asciidoc/cryogen-asciidoc {:mvn/version "0.3.2"}
cryogen-asciidoc/cryogen-asciidoc {:local-root "../../external/cryogen-all/cryogen-asciidoc"}}
:aliases {;; Run with `clojure -M:build`
:build {:main-opts ["-m" "cryogen.core"]}
;; Start a server serving the blog: `clojure -X:serve`
;; (requires tools-deps 0.9.745+)
:serve {:exec-fn cryogen.server/serve
:exec-args {:port 8888}}}}
This is from https://github.com/holyjak/blog.jakubholy.net, the local dependency is https://github.com/cryogen-project/cryogen-asciidoc/It’s :local/root not :local-root
OMG, thanks a lot! I must be blind.
I’m surprised you can’t use ~. I figured it would end up in a path object and the jvm would work it out for you
What could work OS-independent is interpolation of environment variables. But even then you would have to use different names for linux and windows
so probably a script that generates deps.edn for you as a pre-processing step is the least worst way of dealing with such concerns
I haven't had an app where I did this, except for one where I keep deps in sync between project.clj and deps.edn
Java has a system property for this - user.home
(System/getProperty "user.home")
is platform independent
but no equivalent to that in deps.edn (yet, or maybe ever)
None, if I can (I can) use relative psths
I would love to see deps.edn support some type of user home substitution. I have the a main $HOME/.clojure
directory, in there I have my deps.edn
file, that I pull in other libraries with that are all local root (i.e., setting up a REPL with some middleware etc..). Right now, since I’m on Linux I have to put an absolute path in, i.e., :base {:extra-deps {local-base/local-base {:local/root "/home/david/.clojure/libs/local.base" :deps/manifest :deps}}
Making the .clojure/deps.edn portable across machines wrt paths is not a goal - imo if you’re on a different machine, you will need to adjust to that machine
Which is not to say we won’t ever add something like this, but I’m not eager to do so
I thus have to maintain two separate deps.edn files that are near identical, apart from the path stuff.
i.e., :base {:extra-deps {local-base/local-base {:local/root "libs/local.base" :deps/manifest :deps}}
Execution error (FileNotFoundException) at clojure.main/main (main.java:40).
Could not locate local/rebel/main__init.class, local/rebel/main.clj or local/rebel/main.cljc on classpath.
which leaves me with having to put the absolute path in my deps.edn, and maintaining two separate deps.edn (which I suspect, if I was also on windows would incur more mangement)
It would be nice IMHO if deps supported at least having :local/root
resolve the user’s home.
Hmm, I'm slightly surprised that resolution isn't relative when doing that. The personal tooling case is the only one I have so far too :)
I’m not, that’s what I’d expect - top level deps are relative to where you’re running clj
@alexmiller I suppose they could be resolved with a relative *dir*
like when doing transitive :local/root
though?
Yeah, that’s problematic
that's what I do in clj-kondo config. Each config can refer to local dirs relative to itself and these get resolved during config reading.
That’s possible, I’ll think about it