bb nrepl-server now works with rebel-readline! See https://github.com/bhauman/rebel-readline/issues/214#issuecomment-3285679025 for more info
How should I remove dangling promise (not needed in latest BB?) (code sample in reply)
: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.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.
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
it simply uses future for every session
Ok, will leave alone for now. Glad i didn’t jump the gun and get confused. Thanks for clarifying.
Can I take out the -dev task in this case?
yes, in this case you could just do (run 'browser-repl) in your dev task
+ the deref promise
oh wait, I guess the SCI nrepl starts an httpkit server
so it should also work without a deref now
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...no deref needed
if that doesn't work, you're probably not using the newest
bb
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?It’s not critical. I’ll revert back for now..
can you test the command line invocation I gave you earlier?
a complete repro would be best if you want me to look into this, like a Github repo
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.
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 htmlwhat do you mean with "the new stuff"?
> But I’m getting stuck in some kind of execution loop without the deref promise. what kind of loop?
I don't have Photoshop so I can't reproduce it there, but maybe you can reproduce it in a normal browser
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)?
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!
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.
@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.
Additional question: can you find out which glibc version your linux has, if any?
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"
I have merged musl support now, releasing a new version
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
Released it now. Yeah, JSON seems to work on macos without the json tag, ah well, as long as the tests pass
@richiardiandrea test version 0.3.9