This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-23
Channels
- # announcements (7)
- # babashka (40)
- # babashka-sci-dev (74)
- # beginners (74)
- # calva (31)
- # cider (11)
- # clj-kondo (22)
- # cljs-dev (1)
- # cljsrn (1)
- # clojure (70)
- # clojure-brasil (3)
- # clojure-dev (12)
- # clojure-europe (39)
- # clojure-nl (2)
- # clojure-norway (15)
- # clojure-uk (9)
- # clojurescript (69)
- # community-development (2)
- # conjure (1)
- # core-async (3)
- # cursive (1)
- # data-science (1)
- # datalevin (13)
- # datomic (17)
- # emacs (42)
- # events (1)
- # fulcro (16)
- # graphql (9)
- # helix (1)
- # holy-lambda (14)
- # honeysql (2)
- # hugsql (3)
- # hyperfiddle (5)
- # kaocha (10)
- # lsp (41)
- # luminus (5)
- # malli (7)
- # meander (3)
- # membrane (47)
- # off-topic (23)
- # podcasts (2)
- # polylith (34)
- # rdf (4)
- # re-frame (2)
- # releases (2)
- # remote-jobs (1)
- # ring (16)
- # shadow-cljs (111)
- # spacemacs (6)
- # test-check (2)
- # tools-deps (19)
@borkdude I unfollowed the pods repo in my CircleCI account so you can follow it from yours
sure thing!
no problem, it was fun 🙂
I think it's worth testing if intel pods work with the M1 version of babashka. I'll try it myself too, but if they work, then I think adding a fallback mechanism for macos/aarch64 to macos/amd64 might make sense.
I'll build it and give it a shot
that would save us a lot of trouble with re-compiling all those pods... while having no M1 CI available, that gets tedious
@cap10morgan This seems to work with the fallback in place:
{:pods {org.babashka/go-sqlite3 {:version "0.1.0"}}
:tasks {:requires ([pod.babashka.go-sqlite3 :as sqlite])
create-db {:task (do (sqlite/execute! "/tmp/foo.db"
["create table if not exists foo (the_text TEXT, the_int INTEGER, the_real REAL, the_blob BLOB)"]))}}}
great! 🙂
Just chiming in for the Go pods, we can produce aarch64 mac binaries without the arm CI 😄
we have https://github.com/avelino/awesome-go to cherry pick 😄
@cap10morgan While I said this in #babashka :
> Also, when you declare the pods in your bb.edn, you no longer have to use load-pod
in your code, the pod is automatically loaded whenever a related namespace is required.
I wondered, do we check if a pod has already been loaded? E.g. if you require multiple namespaces related to the same pod, is the pod started only once?
I believe so b/c it shouldn't even hit the load-fn
at that point. Instead it should see that it already has that namespace loaded.
But let me know if you observe behavior to the contrary! 🙂
Ah, because when you load one namespace the other ones are automatically defined and then you no longer hit load-fn, right?
yes. and I am 99% sure I tried it and saw it behave that way too 😉
It always feels good when you can close an issue if you've waited long enough for a better solution: https://github.com/babashka/babashka/issues/1065
Guess we can close https://github.com/babashka/babashka/issues/863 too huh?
I think they're OK as-is. Next up is probably uber(jar|script) support?
I played around with pulling the bb.edn
into the jar a little, but it needed a bit more work. I think mostly just accessing it differently (i.e. as a stream) once in the jar.
happy to dive back into that if you'd like
yeah, sounds good. I could take a look at the uberscript, if you don't beat me to it. I have some other stuff to do first
cool. I'll start with uberjar then
for the uberscript, we already hacked the load-fn. and we could "emit" a load-pod
into the uberscript similar to when we load the pod in bb now
what happens if you emit some code like
pod/babashka/go_sqlite3.clj
into the uberjar with the contents:
(load-pod 'org.babashka/go-sqlite3 "0.1.0")
Perhaps when loading that namespace that namespace will be replaced by the pod namespaceyeah interesting
(ns script
(:require [pod.babashka.go-sqlite3 :as sqlite]))
(sqlite/execute! "/tmp/foo.db"
["create table if not exists foo (the_text TEXT, the_int INTEGER, the_real REAL, the_blob BLOB)"])
(ns pod.babashka.go-sqlite3
(:require [babashka.pods]))
(babashka.pods/load-pod 'org.babashka/go-sqlite3 "0.1.0")
I can try that out first and see if it works for both
@cap10morgan Another approach could be that we would offer a programmatic interface to declare pods
extract this to a separate fn, roughly? https://github.com/babashka/babashka/blob/e6022867996540f0afa2844caa57a6e9b3c903e1/src/babashka/main.clj#L794-L796
yeah, that could be pretty nice
except take the thing from @common/bb-edn
as an arg
that sounds perfect for uberscripts, but I wonder if having the bb.edn
in the uberjar would pay dividends in other areas?
might be simpler too (vs. generating some code that has to wrap the main fn that calls this new add-pods)
Maybe, for standalone scripts, we should support some way to inline the entire bb.edn in a script
yep, that would be nicely consistent with the potential uberjar approach
yeah, btw, in uberscripts and uberjars the :deps component should not be processed anymore since all deps should already be there
got it working in uberjars (w/ the "store the bb.edn
in the jar" approach)
PR coming shortly
might make sense to (provide an option to) download every os/arch pod variant into the uberjar too
megajar
another crazy idea: if you have qemu in your path, we fall back to running the linux/x86_64 pod w/ it as a last resort 😈 (hello BSD, etc. support)
assuming you can connect stdio or a socket across that emulation layer...
I'll stop there for now, but let me know if you'd like me to dive into uberscripts too, @borkdude