This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-11
Channels
- # announcements (3)
- # babashka (62)
- # beginners (58)
- # calva (40)
- # cider (3)
- # clj-kondo (75)
- # cljdoc (14)
- # clojars (8)
- # clojure (110)
- # clojure-australia (6)
- # clojure-europe (38)
- # clojure-hungary (1)
- # clojure-india (4)
- # clojure-italy (1)
- # clojure-nl (3)
- # clojure-spec (4)
- # clojure-uk (3)
- # clojurescript (45)
- # conjure (4)
- # cursive (35)
- # data-science (1)
- # datomic (11)
- # events (2)
- # exercism (4)
- # figwheel-main (4)
- # fulcro (103)
- # graphql (16)
- # helix (1)
- # holy-lambda (16)
- # honeysql (1)
- # introduce-yourself (3)
- # jobs (1)
- # keyboards (2)
- # lsp (4)
- # malli (11)
- # membrane-term (3)
- # mount (2)
- # nextjournal (2)
- # off-topic (53)
- # pathom (30)
- # pedestal (2)
- # portal (22)
- # rdf (1)
- # re-frame (7)
- # reagent (3)
- # reitit (5)
- # remote-jobs (6)
- # shadow-cljs (20)
- # sql (8)
- # tools-build (10)
- # vim (4)
- # xtdb (12)
Can a pod expose a dynamic var and allow it to be rebound?
clojure.tools.deps.alpha.util.dir/*the-dir*
gets used like this.
This is possible by wrapping functions in client side functions (using :code
) and defining the dynamic var also client side. The wrapper function then sends the value of the dynamic var as an explicit argument to the pod. Inside the pod the explicit argument then is bound to the dynamic var on the pod side.
I have the code in place, but am getting clojure.lang.PersistentVector cannot be cast to byte[]
Is this likely to be a transit issue. Do byte arrays need explicit handling?
@U0HFRSY0M byte arrays are supported by transit out of the box. the postgres sql pod uses transit+json. https://github.com/babashka/babashka-sql-pods/blob/master/src/pod/babashka/sql.clj
I'm also using transit in a pod written in go:
;; This pod also supports storing blobs, so lets store a picture.
(def png (java.nio.file.Files/readAllBytes (.toPath (io/file "resources/babashka.png"))))
(sqlite/execute! "/tmp/foo.db"
["insert into foo (the_text, the_int, the_real, the_blob) values (?,?,?,?)" "foo" 1 3.14 png])
;;=> {:rows-affected 1, :last-inserted-id 1}
The pattern I’m using is
{:name -pod-root-deps}
{:name root-deps,
:code
(clojure.core/defn
root-deps
[& args__11819__auto__]
(-pod-root-deps
clojure.tools.deps.alpha.util.dir/*the-dir*
args__11819__auto__))}
so root-deps
is a wrapper for -pod-root-deps
which it calls with *the-dir*
as the first arg. yeah that works
all tools.build tests now pass when running the tests with babashka! Still need to push some things to my fork.
there's a way to pre-fetch the pod?
how can I load pod inside a docker container that runs a babashka script?
there's a way to declare the pod in bb.edn or something?
something like {:deps {my/pod {:pod/version "1.1.1"}}}
?
ok 😄 thanks
You can also download the pod manually from the github releases and then load it by the filename. (load-pod "/Downloads/pod-foo")
=> No executable found for pod borkdude/clj-kondo (2021.06.18) and OS Linux/aarch64 it means that there are no executables for this pod found for my computer?
it's running inside a docker :thinking_face:
it means that there is no pod for aarch64 and that version of the pod. https://github.com/babashka/pod-registry/blob/master/manifests/clj-kondo/clj-kondo/2021.10.19/manifest.edn
I'm bound to M1 Macbook 😅
then no 😞
--platform=linux/amd64
there's a flag
lemetry
didn't worked 😞
There is an issue for clj-kondo here: https://github.com/clj-kondo/clj-kondo/issues/1238 Feel free to upvote it to give higher priority
@U7ERLH6JX might also have something to say about this
docker build --platform,,,, worked
after docker rmi
cache stuff