This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-06
Channels
- # aleph (43)
- # announcements (11)
- # babashka (35)
- # beginners (70)
- # calva (4)
- # cider (8)
- # clerk (15)
- # clojure (192)
- # clojure-dev (7)
- # clojure-europe (44)
- # clojure-nl (2)
- # clojure-norway (65)
- # clojure-uk (4)
- # code-reviews (4)
- # conjure (1)
- # cursive (41)
- # data-science (1)
- # datomic (8)
- # emacs (7)
- # fulcro (13)
- # humbleui (17)
- # hyperfiddle (53)
- # kaocha (4)
- # malli (7)
- # missionary (17)
- # music (1)
- # obb (1)
- # off-topic (8)
- # polylith (1)
- # portal (3)
- # releases (11)
- # shadow-cljs (36)
- # squint (4)
- # tools-deps (4)
I ran into some issues with a newer version of tools.deps when you provide a :project "deps.edn"
in a directory where that deps.edn
doesn't exist.
The macro in-project-dir
calls .getParentFile
which returns nil
when the file doesn't exist on disk which then results into NPEs later on.
https://github.com/clojure/tools.deps/blob/e0217fde8455ebdaa1f2231aef21f94264a1c40b/src/main/clojure/clojure/tools/deps.clj#L790
E.g.:
user=> (d/create-basis {:project "x.edn"})
Execution error (NullPointerException) at clojure.tools.deps.util.dir/canonicalize (dir.clj:30).
Cannot invoke "java.io.File.isAbsolute()" because "f" is null
Doing something like (jio/file (or (.getParentFile (jio/file ~project-deps)) "."))
will fix this, but I'll leave it up to you of course
Moreover, note that when upgrading tools.build to the latest release of tools.deps, the test suite fails with:
ERROR in (test-install-no-pom) (dir.clj:30)
Uncaught exception, not in assertion.
expected: nil
actual: java.lang.NullPointerException: Cannot invoke "java.io.File.isAbsolute()" because "f" is null
Another issue I ran into was that .equals
called in that macro results into a reflection issue with graalvm (which I can fix downstream but could be nice to fix upstream, maybe by replacing .equals
simply with =
?👍 1
Thx, will take a look when I get a chance