Fork me on GitHub
#babashka
<
2023-01-23
>
borkdude13:01:05

A new version of https://github.com/babashka/babashka released: v1.1.171 babashkahttps://github.com/babashka/babashka/issues/1467: BREAKING: avoid printing results, unless --prn is enabled (aside from -e, -o and -O). • Include https://github.com/babashka/http-client as built-in library • SCI: support add-watch on vars • Compatibility with https://github.com/weavejester/eftest test runner (see https://twitter.com/borkdude/status/1616886788898885632) • Add classes: ◦ java.util.concurrent.Callablejava.util.concurrent.ExecutorService • Expose clojure.main main and repl-caught • Switch clojure.test/*report-counters* to ref instead of atom for compatibility with https://github.com/lambdaisland/kaocha • Allow java.io.OutputStream to be proxied, for https://github.com/lambdaisland/kaocha • Support qualified method names in proxy and ignore namespace

babashka 14
🎉 6
borkdude13:01:47

@U0AQ1R7FG You might want to update babooka since the print behavior has changed (more in line with what clojure does now)

borkdude13:01:05

So no need to end with nil on bb ^ 1.1.171

nonrecursive14:01:55

oh interesting, so if the file ends with a value, the value doesn’t get pritned?

nonrecursive14:01:21

btw any chance you’d want to babooka from the babashka readme and book?

borkdude14:01:49

yes, very much want that!

borkdude14:01:08

yes, the print is no longer automatic, unless you provide --prn

borkdude14:01:44

I'll add links to babooka now

borkdude14:01:48

@U0AQ1R7FG Maybe it would be nice to add a link in the babooka github repo of where to view it online as HTML

borkdude14:01:05

I've been going there for several times and then had to take a different direction to find it

nonrecursive14:01:03

oh lol good point

nonrecursive14:01:29

❤️ thank you!

didibus17:01:38

Does that mean babashka.http-client is stable now?

borkdude17:01:57

@U0K064KQV I don't think much will change API-wise (except for the babashka.http-client.interceptors namespace maybe, which isn't exposed in bb yet, but you can load it from the dependency)

👍 2
hansbugge15:01:52

I'm noticing something that looks a bit like a regression in newer babashka versions. In 1.0.165 I can do the following

bash-3.2$ ./bb --version
babashka v1.0.165
bash-3.2$ ./bb -e '(babashka.tasks/clojure "-J-Dclojure.server.repl=\"{:port 5555 :accept clojure.core.server/repl}\"")'
Clojure 1.11.1
user=>
But when I do the same with 1.1.171 I get a crash (stack trace in thread).

hansbugge15:01:03

bash-3.2$ bb --version
babashka v1.1.171
bash-3.2$ bb -e '(babashka.tasks/clojure "-J-Dclojure.server.repl=\"{:port 5555 :accept clojure.core.server/repl}\"")'
WARNING: Implicit use of clojure.main with options is deprecated, use -M
Exception in thread "main" java.lang.RuntimeException: EOF while reading
        at clojure.lang.Util.runtimeException(Util.java:221)
        at clojure.lang.EdnReader.readDelimitedList(EdnReader.java:746)
        at clojure.lang.EdnReader$MapReader.invoke(EdnReader.java:680)
        at clojure.lang.EdnReader.read(EdnReader.java:145)
        at clojure.lang.EdnReader.read(EdnReader.java:111)
        at clojure.lang.EdnReader.readString(EdnReader.java:67)
        at clojure.edn$read_string.invokeStatic(edn.clj:46)
        at clojure.edn$read_string.invokeStatic(edn.clj:37)
        at clojure.core.server$parse_props$fn__9026.invoke(server.clj:152)
        at clojure.core.protocols$naive_seq_reduce.invokeStatic(protocols.clj:62)
        at clojure.core.protocols$interface_or_naive_reduce.invokeStatic(protocols.clj:72)
        at clojure.core.protocols$fn__8249.invokeStatic(protocols.clj:169)
        at clojure.core.protocols$fn__8249.invoke(protocols.clj:124)
        at clojure.core.protocols$fn__8204$G__8199__8213.invoke(protocols.clj:19)
        at clojure.core.protocols$seq_reduce.invokeStatic(protocols.clj:31)
        at clojure.core.protocols$fn__8226.invokeStatic(protocols.clj:75)
        at clojure.core.protocols$fn__8226.invoke(protocols.clj:75)
        at clojure.core.protocols$fn__8178$G__8173__8191.invoke(protocols.clj:13)
        at clojure.core$reduce.invokeStatic(core.clj:6886)
        at clojure.core.server$parse_props.invokeStatic(server.clj:146)
        at clojure.core.server$start_servers.invokeStatic(server.clj:157)
        at clojure.core.server$start_servers.invoke(server.clj:157)
        at clojure.lang.Var.invoke(Var.java:384)
        at clojure.lang.RT.doInit(RT.java:493)
        at clojure.lang.RT.init(RT.java:467)
        at clojure.main.main(main.java:38)

hansbugge15:01:50

I'm on macos-aarch64 btw

hansbugge15:01:46

Shall I make a ticket on github?

borkdude15:01:53

I'll have a look. Yes, please make a ticket

👍 2
borkdude15:01:27

I found the issue, instead you can for now do:

$ bb -e '@(babashka.deps/clojure "-J-Dclojure.server.repl=\"{:port 5555 :accept clojure.core.server/repl}\"")'
Clojure 1.11.1
user=>

hansbugge15:01:05

For now we'll stick with using bb 1.0.165 instead of working around it because we have multiple bb tasks that invoke clojure which are now failing.

hansbugge15:01:15

Thanks for looking into it!

borkdude15:01:38

I'll do another release

❤️ 2
borkdude15:01:45

I'll wait a few hours and then do it tonight or tomorrow morning

borkdude15:01:18

It would be good if you could try the --dev-build in a few minutes though to double-check if the fix was proper

borkdude15:01:32

bash <(curl ) --dev-build --dir /tmp

hansbugge15:01:45

It works! Thanks once again for the super fast response 🙂

borkdude15:01:45

I found another edge case, I'll fix that one and then will ask you to test once again

borkdude16:01:14

ok, test again with new --dev-build

hansbugge16:01:42

I did the same test as before, and it still works.

borkdude19:01:11

https://github.com/babashka/babashka: Native, fast starting Clojure interpreter for scripting 1.1.172 (2023-01-23) • https://github.com/babashka/babashka/issues/1472: fix tokenization of babashka.tasks/clojure: command was tokenized twice (regression was introduced in 1.0.168) • BREAKING: Bump babashka.process: change default for :out :append to :out :write. This default is undocumented so the impact should be small.

❤️ 2