This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-26
Channels
- # announcements (4)
- # babashka (8)
- # beginners (75)
- # calva (26)
- # cider (33)
- # circleci (5)
- # clojure (36)
- # clojure-dev (2)
- # clojure-europe (25)
- # clojure-nl (4)
- # clojure-spec (38)
- # clojure-uk (47)
- # clojurescript (15)
- # cloverage (2)
- # conjure (64)
- # core-async (41)
- # cursive (13)
- # data-science (2)
- # datalog (16)
- # datascript (22)
- # datomic (9)
- # duct (2)
- # emacs (81)
- # figwheel-main (1)
- # fulcro (4)
- # jobs (2)
- # jobs-discuss (29)
- # kaocha (3)
- # meander (11)
- # membrane (21)
- # off-topic (1)
- # portal (1)
- # re-frame (1)
- # reitit (1)
- # releases (2)
- # remote-jobs (31)
- # shadow-cljs (26)
- # specter (5)
- # sql (26)
- # tools-deps (19)
- # vim (12)
To summarize, I put the above script in a file test_bb_requires.clj, ran bb against it, and checked that BABASHKA_CLASSPATH doesn’t exist before and after. Then I ran your sample on the command-line which works fine:
bash-3.2$ echo $BABASHKA_CLASSPATH
bash-3.2$ bb test_bb_requires.clj
java.lang.Exception: Could not require java-time. [at /Users/me/..../mydir/test_bb_requires.clj, line 16, column 1]
bash-3.2$ echo $BABASHKA_CLASSPATH
bash-3.2$ export BABASHKA_CLASSPATH=$(clojure -Sdeps '{:deps {henryw374/cljc.java-time
{:git/url ""
:sha "e3d184b78e933322b3fcaa6ca66cbb8f42a6b35c"}}}' -Spath)
> > bash-3.2$ bash-3.2$ bb -e "(require '[cljc.java-time.local-date :as ld])"
bash-3.2$ java -version
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b16, mixed mode)
(MacOS 10.13.6) Thanks!Note that you are requiring a different namespace in the first example, but apart from that, I can reproduce your issue now. I'll look into it.
This example works for me:
(require '[babashka.classpath :refer [add-classpath]]
'[clojure.java.shell :refer [sh]]
'[clojure.string :as str])
(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 (str/trim cp))
(require '[cljc.java-time.local-date :as ld])
So it turns out it was in fact loading macrovich, but the part on the path had appended a new line for that .jar file
Fixed indeed, thanks! I was wondering if others encountered the same newline issue. Regarding the wrong ns name, I think I was trying to avoid the cljs call from an earlier try, sorry about that. Looking forward to discover and learn more from your work! Cheers..
@U06BUCH6D Cool. I think the cljc.java-time lib could maybe be optimized by not loading macrovich for babashka and/or clojure, since it's only relevant to cljs. Maybe the author will take a PR