This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-30
Channels
- # announcements (31)
- # aws (17)
- # babashka (26)
- # babashka-sci-dev (8)
- # beginners (16)
- # biff (1)
- # calva (9)
- # cider (5)
- # clj-kondo (3)
- # clj-on-windows (38)
- # cljdoc (2)
- # cljs-dev (9)
- # cljsrn (6)
- # clojure (58)
- # clojure-europe (47)
- # clojure-nl (3)
- # clojure-norway (21)
- # clojure-uk (2)
- # clojurescript (25)
- # conjure (2)
- # data-science (7)
- # datomic (3)
- # emacs (12)
- # events (5)
- # fulcro (5)
- # honeysql (10)
- # introduce-yourself (7)
- # lsp (4)
- # meander (3)
- # nbb (18)
- # off-topic (28)
- # rdf (1)
- # releases (2)
- # sci (5)
- # shadow-cljs (23)
- # sql (5)
- # test-check (3)
What would be the most idiomatic approach for adding extra paths at runtime, akin to add-deps
? Use add-classpath
directly?
Ah yes :face_palm: Thanks
I can't seem to find a solution :thinking_face:
Essentially, my BB tasks would ideally require aliases from my root deps.edn
for a few reasons (e.g. not duplicating common deps, common paths, ...)
However I think it's impossible to do anything about it dynamically in [:tasks :init]
when using :requires
in tasks, right? Because whatever :requires
need won't be available yet.
Unfortunately not because the quest here is being able to consume what's defined in deps.edn
In aliases, so a :local/root
in bb.edn
's :deps
won't do
You could also do this:
(classpath/add-classpath (with-out-str (clojure "-Spath" "-A:whatever")))
I don't think so, here is what happens when the :init
hook in :tasks
uses add-deps
to add foo.bar
and the task :requires
it:
----- Context ------------------------------------------------------------------
1:
2: ;; deps
3:
4: (ns user-2fd6eac7-5ec0-4e75-9211-7cd306f95634 (:require [foo.bar]))
^--- Could not find namespace: foo.bar.
At this point, :init
hasn't run yet.
So any dynamic solution like add-deps
or add-classpath
outside of a task can't work if my understanding is correct.Okay let me try to work it out, I'm obviously trying to do a bit of magic here, and if I'm still stuck I'll come back 🙏
You could also start bb like this:
bb --classpath $(clojure -Spath -A:whatever)
but this will ignore any deps in bb.edn
Something like this would probably be more reliable.
I'd find it interesting having a add-deps
variant that work with a path to a deps.edn
file. Keeping that optional second argument for activating aliases.
Eh, eventually I settled for a hack.
In bb.edn
I simply use a :local/root
to a generated EDN file. It merges all deps from aliases as well as paths. And for those paths, where that deps.edn
resides, the generating scripts creates hard links to those.
That allows me to never duplicate deps, consume paths from everywhere in the repo without deps
complaining about outside paths (`../xxx`), without having do to anything with BB or prepare it in any way when using it (e.g. --classpath
)
Hello everyone, I'm having a problem with babashka.process.
I'm trying to execute git show --name-only pretty=""
as (process/process '[git "show" "--name-only" "--pretty=\"\""])
but the form does not like the last argument. Is there an other way to write this?
@george.per It seems to work, but git doesn't seem to like ""
:
user=> (:cmd @(process/process '[git "show" "--name-only" "--pretty=\"\""] {:out :inherit :err :inherit}) )
fatal: invalid --pretty format: ""
["git" "show" "--name-only" "--pretty=\"\""]
In bash, the command returns without error.
Bash seems to just drop ""
:
$ bb -e '*command-line-args*' git show --name-only pretty=""
("git" "show" "--name-only" "pretty=")
Random tip: here is how you can add the latest quickdoc to your bb.edn
with neil:
neil add dep io.github.borkdude/quickdoc --latest-sha --deps-file bb.edn

Is anyone building desktop apps with babashka? Are there any resources for e.g. crossplatform tray icons, or strategies for distributing executables? Would I be better off building things in clojure and using graalvm?
I think HumbleUI might be a good option which I think some people have gotten to work with GraalVM.
cljfx + jpackage could be an option: https://vlaaad.github.io/year-of-clojure-on-the-desktop. Gluon has a GraalVM substrate that compiles JavaFX applications to native but as far as I know no one has got gluon and cljfx working together.
Gluon substrate here https://github.com/gluonhq/substrate if you want to be a pioneer 😄