This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-05-03
Channels
- # aleph (7)
- # announcements (6)
- # babashka (34)
- # beginners (5)
- # calva (1)
- # cider (3)
- # clerk (11)
- # clj-http (1)
- # clj-kondo (35)
- # clojars (6)
- # clojure (114)
- # clojure-australia (1)
- # clojure-brasil (2)
- # clojure-europe (73)
- # clojure-hamburg (3)
- # clojure-nl (1)
- # clojure-norway (27)
- # clojure-uk (4)
- # events (3)
- # graalvm (13)
- # gratitude (4)
- # helix (17)
- # hoplon (1)
- # hyperfiddle (65)
- # instaparse (4)
- # jobs-discuss (6)
- # lsp (2)
- # meander (2)
- # rdf (4)
- # re-frame (51)
- # reitit (28)
- # releases (1)
- # sci (20)
- # shadow-cljs (9)
- # tools-deps (4)
- # xtdb (44)
A nice addition to bb tasks could be:
$ bb run --wait http-server
No such task: --wait
where --wait
would implicitly do @(promise)
to not exit the process when starting a server? :thinking_face:the problem I'm trying to solve is that for some tasks you run a server process and don't want to exit the bb process (so you write @(promise)
) but as soon as you write the @(promise)
you can't easily combine it with other tasks. Similarly we have --prn
to print results, --wait
could be another one such flag.
-d
: this usually means that your process will run in the background right? which is not the case here, bb will just run in the foreground as usual
would be cool for running portal via bb run
might be nice to make it @some.bb.ns/wait-server-exit
and offer a function like server-exit
to deliver true
to that promise. (or task-exit)
Before I raise a feature request proposal to solve an interesting problem for https://github.com/babashka/process, maybe it supports this already?
Can we redirect stderr to stdout? I see https://docs.oracle.com/javase/8/docs/api/java/lang/ProcessBuilder.html#redirectErrorStream-boolean- which should make this easy peasy if we don't already have an existing way to do this.
You can try: :err *out*
or
user=> (let [pb (p/pb {:out :inherit} "ls non-existing") pb-obj (:pb pb)] (.redirectErrorStream pb-obj true) (p/start pb))
ls: non-existing: No such file or directory
Ya, that's a bit low level maybe? I was thinking maybe :err :redirect-to-out
opt on process
and shell
fns. Or something similar at that higher level.
Yep, I think that would be good: :err :inherit-out
maybe? since I don't think you'll be able to redirect to anything else than what out is when you have :out :inherit
?
hm, if I read the Java docstring correctlyl, the stream will be merged, so maybe :err :out
works?
ah, cool, this works:
user=> (with-out-str (let [pb (p/pb {:out *out*} "ls non-existing") pb-obj (:pb pb)] (.redirectErrorStream pb-obj true) @(p/start pb)))
"ls: non-existing: No such file or directory\n"
Should a 'static' binary still depend on shared libraries? (I'm trying to run babashka-1.3.179-linux-aarch64-static.tar.gz
on termux (android).
Likely answer: https://clojurians.slack.com/archives/CLX41ASCS/p1665371891643389?thread_ts=1665369370.715609&cid=CLX41ASCS
I guess we should rename the download babashka-1.3.179-linux-aarch64-almost-static.tar.gz
(added almost 🙂 ).
here is more info: https://www.graalvm.org/22.0/reference-manual/native-image/StaticImages/
I got bb
running easily enough by installing it from inside an arch linux proot. (`yay -S bb`). Arch linux has a regular libc.
@U06GMV0B0 you might be interested in #C0260KHN0Q0. - @U7RJTCH6J managed to get SCI (the interpreter in bb) compiling as a graalvm binary and hooked it up with an ios app, so you could evaluate Clojure stuff that way directly on your mobile, even via an nREPL connection You can watch this episode of Apropos Podcast to see it in action: https://apropos-site.vercel.app/episode/54
To run bb "as is" on iOS won't be that useful I think, since iOS is very closed and secure, you can't just access to all of the filesystem like that and then do interesting scripts, like remove all your old photos
Here's the link to the project: https://github.com/phronmophobic/grease
I'd be happy to answer any questions although it might be easier to follow up in #C0260KHN0Q0