babashka

borkdude 2025-09-12T15:14:22.539299Z

bb nrepl-server now works with rebel-readline! See https://github.com/bhauman/rebel-readline/issues/214#issuecomment-3285679025 for more info

❤️ 3
🎉 6
chromalchemy 2025-09-12T15:19:34.982509Z

How should I remove dangling promise (not needed in latest BB?) (code sample in reply)

chromalchemy 2025-09-12T15:22:11.806669Z

:tasks {browser-nrepl {:doc "Start browser nREPL"
                        :requires ([sci.nrepl.browser-server :as bp])
                        :task (bp/start! {#_"use :preloads ?"})}

         -dev {:depends [browser-nrepl]}

         dev {:task
              (do
                (run '-dev {:parallel true})
                (deref (promise)))}}
This is what has been working for me.

chromalchemy 2025-09-12T15:23:02.831789Z

I think the (run '-dev {:parallel true}) thing was to run 2 different tasks from one invokation. But I’m only using one right now.

borkdude 2025-09-12T15:23:33.767529Z

In this case you still need it since the SCI browser repl doesn't use any non-daemon threads. we could change that of course

borkdude 2025-09-12T15:24:06.416169Z

it simply uses future for every session

chromalchemy 2025-09-12T15:25:00.843689Z

Ok, will leave alone for now. Glad i didn’t jump the gun and get confused. Thanks for clarifying.

chromalchemy 2025-09-12T15:25:51.478369Z

Can I take out the -dev task in this case?

borkdude 2025-09-12T15:26:21.067559Z

yes, in this case you could just do (run 'browser-repl) in your dev task

borkdude 2025-09-12T15:26:29.642399Z

+ the deref promise

borkdude 2025-09-12T15:27:14.384889Z

oh wait, I guess the SCI nrepl starts an httpkit server

borkdude 2025-09-12T15:27:24.711509Z

so it should also work without a deref now

borkdude 2025-09-12T15:30:41.334519Z

yep that works here:

$ bb -Sdeps '{:deps {io.github.babashka/sci.nrepl {:mvn/version "0.0.2"}}}' -x sci.nrepl.browser-server/start\!
nREPL server started on port 1339...
Websocket server started on 1340...

borkdude 2025-09-12T15:30:47.899709Z

no deref needed

borkdude 2025-09-12T15:31:10.197359Z

if that doesn't work, you're probably not using the newest

borkdude 2025-09-12T15:31:13.061009Z

bb

chromalchemy 2025-09-12T15:50:00.896209Z

Hmm. Im running Babashka v1.12.208 And i updated the deps in bb.edn

:deps
 {io.github.babashka/sci.nrepl
  {:git/sha "1042578d5784db07b4d1b6d974f1db7cabf89e3f"}
  io.github.babashka/http-server
  {:git/sha "c7fefc73480ed82b4cc7401ca6e5b6ef1010d4ae"}
  babashka/nrepl-client
  {:git/url ""
   :git/sha "519f09cbfcfebf5633368f7f34f4ad993b453f49"}}
But I’m getting stuck in some kind of execution loop without the deref promise. Here is how I’m trying to run a function remotely from bb
(let
  [expression (first *command-line-args*)
   values
   (-> {:port 1339
        :expr (str "(do (in-ns 'playground) "
                expression ")")}
     (nrepl/eval-expr)
     :vals)]
  (run! println values))
Would that affect the lack of promise?

chromalchemy 2025-09-12T15:52:40.432949Z

It’s not critical. I’ll revert back for now..

borkdude 2025-09-12T15:55:59.787879Z

can you test the command line invocation I gave you earlier?

borkdude 2025-09-12T15:56:41.045269Z

a complete repro would be best if you want me to look into this, like a Github repo

chromalchemy 2025-09-12T16:02:18.630409Z

Yes it’s looping for me with that invocation. Could be how I’m sending the code to run..? Also this is for Photoshop’s JS runtime, so maybe the new stuff is not working there..? So maybe you cannot reproduce it directly.

chromalchemy 2025-09-12T16:10:20.079749Z

My whole file looks like this (2 tasks that complement each other)

{:deps
 {io.github.babashka/sci.nrepl
  {:git/sha "1042578d5784db07b4d1b6d974f1db7cabf89e3f"}
  io.github.babashka/http-server
  {:git/sha "c7fefc73480ed82b4cc7401ca6e5b6ef1010d4ae"}
  babashka/nrepl-client
  {:git/url ""
   :git/sha "519f09cbfcfebf5633368f7f34f4ad993b453f49"}}

 :tasks {
        ;;  http-server {:doc "Starts http server for serving static files"
        ;;               :requires ([babashka.http-server :as http])
        ;;               :task (let [port 1341]
        ;;                       (http/serve {:port port  :dir "."})
        ;;                       (println
        ;;                         (str "Serving static assets at : ") port))}

         browser-nrepl {:doc "Start a browser nREPL server"
                        :requires ([sci.nrepl.browser-server :as bp])
                        :task (bp/start! {#_"use :preloads ?"})}

         nrepl-eval {:do "Send expression to photoshop's scittle runtime via nREPL"
                     :requires ([babashka.nrepl-client :as nrepl])
                     :task
                     (let
                       [expression (first *command-line-args*)
                        values
                        (-> {:port 1339
                             :expr (str "(do (in-ns 'playground) "
                                     expression ")")}
                          (nrepl/eval-expr)
                          :vals)]
                       (run! println values))}
         
         dev {:task
              (do
                (run 'browser-nrepl)
                #_(deref (promise)))}}}
In js I set var SCITTLE_NREPL_WEBSOCKET_PORT = 1340; and require scittle.nrepl.js in the html

borkdude 2025-09-12T20:36:15.082609Z

what do you mean with "the new stuff"?

borkdude 2025-09-12T20:36:47.054419Z

> But I’m getting stuck in some kind of execution loop without the deref promise. what kind of loop?

borkdude 2025-09-12T20:37:18.877049Z

I don't have Photoshop so I can't reproduce it there, but maybe you can reproduce it in a normal browser

richiardiandrea 2025-09-12T22:55:51.617589Z

✅ 1
richiardiandrea 2025-09-12T22:55:52.886489Z

Hi all, I am running bb with the pod-babashka-go-sqlite3 in a company-managed virtual machine (seems to be an ubuntu derivative). However, after the pod is downloaded I get the above ☝️ error. Can anybody please tell me what could be the issue? Is this a known issue? Do I need to compile the pod on the machine (massive turn down for my folks)?

✅ 1
richiardiandrea 2025-09-15T13:17:54.861619Z

Tested version 0.3.9 on linux and it seems to work > Btw slightly off topic @richiardiandrea: you enabled json support here Yeah realized I missed CI on saturday 😄 thanks for merging the PR - I'll try against our machine in the next hour or so and report back. I expect things to go smoothly so thanks!

🎉 1
Bob B 2025-09-13T01:41:53.653869Z

Judging by the message, I'm guessing that the glibc on the container is incompatible or not present. The version on the container might be very old or very new. I'd say it could be restricted, but the container appears to be running as root, so I doubt it'd be a permission issue, unless there's like an SELinux policy or something that makes it unavailable. It might also be possible (this is largely speculation) that it could be an architecture mismatch, e.g. the binary is built for AMD, and the container is an ARM or vice-versa.

lispyclouds 2025-09-13T05:49:25.941769Z

@richiardiandrea in addition to Bob’s comment, I’d also ask if this is alpine Linux by any chance? If yes does using “apk add gcompat” solve it? Assuming you can also install things there.

borkdude 2025-09-13T07:34:46.246799Z

Additional question: can you find out which glibc version your linux has, if any?

borkdude 2025-09-13T09:22:40.956009Z

I found out that the current version of CI builds against 2.39 which may be too new. In bb builds we forced building against 2.31: :max_glibc_version="2.31"

borkdude 2025-09-13T09:41:08.642659Z

I have merged musl support now, releasing a new version

👍🏾 1
❤️ 1
borkdude 2025-09-13T09:41:50.924679Z

Btw slightly off topic @richiardiandrea: you enabled json support here: https://github.com/babashka/pod-babashka-go-sqlite3/commit/53626f2af7bcbd65df5c829632b4a6ec07e46e38 but I only see a change in the windows CI script, not the circleci ones. are you sure this is working for you on linux? the tests seem to pass nonetheless

borkdude 2025-09-13T09:47:45.929689Z

Released it now. Yeah, JSON seems to work on macos without the json tag, ah well, as long as the tests pass

borkdude 2025-09-13T09:47:57.441289Z

@richiardiandrea test version 0.3.9