Fork me on GitHub
#babashka
<
2023-03-08
>
Julian17:03:34

Hi @borkdude. I came across this weird issue running bb on WSL. Posted https://github.com/babashka/babashka/issues/1512. If I've done something stupid I'll delete the issue.

โœ… 2
borkdude18:03:17

@U03L9U301RV I'll see if I can reproduce it

borkdude18:03:32

nope, can't repro...

Julian18:03:19

@U04V70XH6, Thanks! stty sane works, even though I can't see myself typing it. It's weird!

seancorfield18:03:40

Heh, stty sane is pretty much "muscle memory" for me at this point -- so many processes seem to leave the terminal in a bad state when quitting them...

clojure-spin 2
til 2
seancorfield18:03:07

(or maybe I'm just a bad user who breaks stuff more often than necessary? ๐Ÿ™‚ )

borkdude18:03:17

I think rlwrap might be the issue which is invoked when invoking clj

borkdude18:03:29

also it's an old clj version you have there

๐Ÿ‘ 2
borkdude18:03:46

doing (clojure "-X:test/cognitect") is worth a try

clojure-spin 2
Julian18:03:33

@borkdude Yup that fixed it. Using clj was messing with it. Changing it to clojure worked! Thanks!

Julian10:03:34

Update: I upgraded my clj to 1.11.1.1252 . Wanted to use clj instead of clojure but still had the same issue. I think borkdude is right that its to do with rlwrap . Worked around it with setting an environment variable. (Don't know if it's relevant, but haven't tested on WSL2, I'm using WSL1.)

borkdude10:03:13

@U03L9U301RV In CI environments it's usually better to use clojure rather than clj. Note that with bb you can run (clojure ...) in bb.edn which doesn't even require you to install clojure externally

๐Ÿ‘ 2
borkdude10:03:42

WSL1 is quite different from WSL2 so that would have been useful info

Julian10:03:57

True. Sorry, I did write on "platform" that is was "version 1" but I should have made that clearer.

borkdude10:03:31

oh right, no problem

cch121:03:07

Iโ€™m having trouble requiring the datomic.ion-dev dependency available in babashka. https://gist.github.com/olivergeorge/f402c8dc8acd469717d5c6008b2c611b and https://clojurians.slack.com/archives/C03RZMDSH/p1678290630727719?thread_ts=1678285600.007399&amp;cid=C03RZMDSH`ion-dev/push`https://clojurians.slack.com/archives/C03RZMDSH/p1678290630727719?thread_ts=1678285600.007399&amp;cid=C03RZMDSH inspired me to bundle up the deploy of a Datomic Ion using babashka. Unfortunately, I canโ€™t figure out how to get the namespace loaded in babashka.

cch121:03:33

With this bb.edn

{:paths     ["bb"]
 :deps      {com.datomic/ion-dev      {:local/root "./ion-dev-1.0.306.jar"}
             com.cognitect/anomalies {:local/root "./anomalies-0.1.12.jar"}}}
This is what I get:
Babashka v1.1.174 REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.

user=> (require '[datomic.ion.dev :as ion-dev])
java.lang.Exception: Could not find namespace: datomic.ion.dev. [at <repl>:1:1]
user=>
I have the same problem defining the dependency in a bb.edn file. And I do not have the problem with other jar dependencies. ------------ The ion-dev jar file is not available in maven or on github, but you can pull it down from s3 using this deps.edn config:
:mvn/repos {"datomic-cloud" {:url ""}}
Then, just copy the jar to the local bb project directory.

borkdude21:03:52

@U0698L2BU It's likely that the datomic jar only contains .class files. Babashka only loads sources from source files, not .class files. It can also not load any Java classes that weren't already included in bb

cch121:03:14

Yep, that explains it. I already dumped the jar and there is no source.,

cch121:03:27

Thanks for the quick response!