This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-10
Channels
- # announcements (3)
- # babashka (16)
- # beginners (41)
- # biff (4)
- # calva (14)
- # circleci (1)
- # clj-http (24)
- # clj-kondo (9)
- # clj-on-windows (31)
- # cljs-dev (52)
- # clojure (162)
- # clojure-australia (10)
- # clojure-europe (52)
- # clojure-nl (2)
- # clojure-spec (1)
- # clojure-uk (5)
- # clojurescript (40)
- # conjure (6)
- # core-async (3)
- # cursive (5)
- # datalevin (11)
- # datomic (7)
- # emacs (12)
- # etaoin (19)
- # events (1)
- # figwheel-main (17)
- # fulcro (4)
- # graalvm (3)
- # gratitude (13)
- # honeysql (8)
- # introduce-yourself (7)
- # london-clojurians (1)
- # off-topic (9)
- # polylith (9)
- # rdf (1)
- # re-frame (21)
- # releases (5)
- # remote-jobs (4)
- # sci (28)
- # shadow-cljs (15)
- # spacemacs (2)
- # vim (4)
- # xtdb (15)
We’re using babashka for the deployment script of our Clojure project, i.e. we have our-project/bin/deploy.clj that starts with #!/usr/bin/env bb
. If this was in nodejs land, I’d add babashka as a dev-dependency to my project so that npm i
would install babashka locally to my project and make the bb-executable available within the project. Is there something similar that I could do in Clojure land, so I wouldn’t have to require every collaborator to first do a global install of babashka on their machine?
@christian239 Babashka is probably more comparable to Node.js or Clojure itself than a library you would install with npm. But you could do:
bash <(curl ) --dir .
which downloads a copy of bb to the local directory@borkdude would it be possible to specify an architecture for which pods should be downloaded?
@karol.wojcik Perhaps this is possible using bb -Dos.arch=aarch64
but no guarantees :)
If we would support this, then we would also have to include the os + arch into the directory structure to prevent clashes, currently that's not the case
We already have:
prepare Download deps & pods defined in bb.edn and cache their metadata. Only an optimization, this will happen on demand when needed.
Apologies if https://clojurians.slack.com/archives/CLX41ASCS/p1652133058549909?thread_ts=1629768040.328800&cid=CLX41ASCS that keeps coming up.
That isn't about depependency resolution but about a different issue. Babashka cannot load Java classes that are not built-in at compile time.
Sorry if the answer is obvious but I'm having some trouble finding the answer. In https://book.babashka.org/#_running_a_script the example prints everything in the terminal. So if I do this:
export some_var=`./download_html.clj /tmp/clojure.org.html`
echo $some_var
, the result is:
> Downloading url: https://www.clojure.org
> Writing file: /tmp/clojure.org.html
What should I do if I just want the return value (the result of the last expression)? Is there something I can do on the babashka side or should I just replace printlns with logs and make sure they're sent to stderr or something?
The use case is multiple babashka scripts running independently one after the other, each piping its result to the next one (our CI workflow is becoming too complex so I'm testing the waters with babashka; so far I'm very happy with it! ❤️).Piping is sort of dependent on stdout and stdin, so you'd want to make the prints to stdout only the essential thing(s). However, babashka.process supplies some niceities for working with calls out to processes, so you could add in some "interceptors" if you wanted. Another alternative would be babashka tasks, which is sort of like make with separate tasks, dependencies between tasks, and so on. With tasks, you could print stuff and have a separate return value (that is, you could print from tasks and have a return value from a shell call or something). (<https://book.babashka.org/#tasks>)
I'll check those out, thanks 🙂