This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-25
Channels
- # announcements (2)
- # babashka (35)
- # beginners (74)
- # calva (26)
- # cider (14)
- # clojure (74)
- # clojure-dev (27)
- # clojure-europe (9)
- # clojure-italy (2)
- # clojure-nl (2)
- # clojure-spec (10)
- # clojure-uk (9)
- # clojuredesign-podcast (6)
- # clojurescript (40)
- # data-science (1)
- # datalog (7)
- # events (1)
- # figwheel-main (13)
- # fulcro (11)
- # graalvm (58)
- # helix (4)
- # jobs (4)
- # jobs-discuss (9)
- # kaocha (23)
- # malli (5)
- # meander (112)
- # membrane (7)
- # off-topic (13)
- # pedestal (2)
- # re-frame (4)
- # reitit (1)
- # rewrite-clj (1)
- # rum (2)
- # sci (3)
- # shadow-cljs (79)
- # sql (12)
- # tools-deps (17)
- # vim (15)
- # vrac (11)
- # xtdb (6)
I am trying to mimicking the babashka example for using external libraries, and adding one of my own, but the cp string is empty:
(def added-deps
'{:deps {clojure.java-time {:git/url "
:sha "a36e0c5295dbcb0458040004d8f593b33fad0867"}
medley {:git/url "
:sha "91adfb5da33f8d23f75f0894da1defe567a625c0"}}})
The added dependency (java-time) is not found and wrecking the whole classpath string as a result
Sure! Thx…
(def added-deps
'{:deps {clojure.java-time {:git/url ""
:sha "a36e0c5295dbcb0458040004d8f593b33fad0867"}
medley {:git/url ""
:sha "91adfb5da33f8d23f75f0894da1defe567a625c0"}}})
I'm getting:
> Error building classpath. Manifest type not detected when finding deps for clojure.java-time/clojure.java-time in coordinate {:git/url "https://github.com/dm3/clojure.java-time", :sha "a36e0c5295dbcb0458040004d8f593b33fad0867"}
when I try those coordinates with clojure
Yes, I think the commit you are referencing is an old one that doesn't have a deps.edn in the repo
Btw, the library clojure.java-time doesn't work with bb right now: > java.lang.Exception: Unable to resolve classname: java.lang.reflect.Field Check out https://github.com/borkdude/babashka/blob/master/doc/libraries.md for a list of libs that do work. This one does work: https://github.com/henryw374/cljc.java-time, I haven't added it to the page yet.
@kingcode This one is tested with bb on CI:
henryw374/cljc.java-time
{:git/url ""
:sha "e3d184b78e933322b3fcaa6ca66cbb8f42a6b35c"}
Thanks..Now the cp is updated and looks good. But for some reason, when trying it in the bb Repl, I am unable to require anything e.g.
(require '[cljc.java-time.local-date :as ld])
;;=> java.lang.Exception: Could not require net.cgrand.macrovich. [at cljs/java_time/interop.cljc, line 1, column 1]
I also tried (require '[java-time])
with similar results:
user=> java.lang.Exception: Could not require java-time. [at line 26, column 1]
No problem, happy to get you started. So this works:
borkdude@MBA2015 /tmp $ export BABASHKA_CLASSPATH=$(clojure -Sdeps '{:deps {henryw374/cljc.java-time
{:git/url ""
:sha "e3d184b78e933322b3fcaa6ca66cbb8f42a6b35c"}}}' -Spath)
borkdude@MBA2015 /tmp $ bb -e "(require '[cljc.java-time.local-date :as ld])"
oh…the SHA is not the same as version? 0.1.11 corresponds to the SHA we are using ( e3d184b78e933322b3fcaa6ca66cbb8f42a6b35c).
Yes, from the command prompt it looks fine - no exception. I was using it inside the REPL created from ‘bb’ at the prompt
are you using BABASHKA_CLASSPATH
or some other means? Please give as much detail as possible
OK Thank you, have a good night. I will look for more details, but for now I have put the code into a .clj file I am running to the MacOSX prompt, which does reproduce the issue:
#!/usr/bin/env bb
(require '[clojure.java.shell :refer [sh]]
'[clojure.pprint :refer [pprint]]
'[clojure.tools.cli :as cli :refer [parse-opts]]
'[babashka.classpath :refer [add-classpath]])
(def added-deps
'{:deps {cljc.java-time {:git/url ""
:sha "e3d184b78e933322b3fcaa6ca66cbb8f42a6b35c"}
medley {:git/url ""
:sha "91adfb5da33f8d23f75f0894da1defe567a625c0"}}})
(def cp (:out (sh "clojure" "-Spath" "-Sdeps" (str added-deps))))
(add-classpath cp)
(require '[java-time :as t])