This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-12
Channels
- # aleph (1)
- # announcements (13)
- # asami (4)
- # babashka (47)
- # beginners (22)
- # calva (11)
- # circleci (1)
- # clj-kondo (14)
- # clojure (43)
- # clojure-europe (43)
- # clojure-gamedev (1)
- # clojure-nl (1)
- # clojure-uk (6)
- # clojurescript (13)
- # core-async (5)
- # cursive (8)
- # datomic (20)
- # events (3)
- # fulcro (12)
- # graalvm (1)
- # graphql (4)
- # gratitude (3)
- # java (2)
- # juxt (2)
- # leiningen (12)
- # off-topic (30)
- # pathom (33)
- # pedestal (5)
- # podcasts-discuss (1)
- # polylith (14)
- # rdf (2)
- # re-frame (12)
- # reagent (3)
- # releases (2)
- # shadow-cljs (24)
- # spacemacs (13)
- # sql (2)
- # tools-build (16)
When registering transit handlers in a pod, we need to use the cllentās pod namespace. The namespace name varies by client, which makes it difficult to dev on clojure and run in babashka. Making registration declarative seems tricky, but could the pod client pass its namespace in the ādescribeā message?
Not sure if I understand the problem. The registration of transit handlers is a global effect I think.
In the AWS pod I did this:
(def reg-transit-handlers
(format "
(require 'babashka.pods)
(babashka.pods/add-transit-read-handler!
\"%s\"
identity)
(babashka.pods/add-transit-read-handler!
\"%s\"
(fn [s] {:class (symbol s)}))"
throwable-key class-key))
The only assumption there is that the client has the babashka.pods
namespace.As a heads up, I bumped the tools-build branch of bb to use normal SCI again, I found out how to not need changes in SCI to get tools namespace compatibility https://github.com/borkdude/tools.namespace/commit/49fab463f51da056c9d2261de34982c9377239c1
I will see if I can port more stuff from tools.namespace to bb and after that I will port back changes from the tools build branch to master and add tests for some of those
It seems there was an issue in the ācodeā I was sending. It had a ā^Fileā type hint, which seemed to work when loaded via the .jvm
namespace, but not otherwise
I was just getting a āSyntax errorā , and wasnāt seeing the cause. When I hacked process-namespace
to catch, print and rethrow, the issue became apparent.
I think it could be that since the imports are maybe not installed in a namespace created with create-ns
or so
yep:
user=> (create-ns 'dude)
#object[clojure.lang.Namespace 0x55ea2d70 "dude"]
user=> (in-ns 'dude)
#object[clojure.lang.Namespace 0x55ea2d70 "dude"]
dude=> File
Syntax error compiling at (REPL:0:0).
Unable to resolve symbol: File in this context
@U0HFRSY0M Another heads up. Please use commit f4096049b42e36fa7fb9b0bcb36226b6f5567cd6
from the tools namespace fork. Now all tests pass. I've cut out the dependency on java.classpath as well and no tests were failing: it seems there weren't any tests for this at all
$ ~/Dropbox/dev/clojure/babashka/bb test
Running tests in #{"src/test/clojure"}
Testing clojure.tools.namespace.dependency-test
Testing clojure.tools.namespace.dir-test
Temporary directory /var/folders/2m/h3cvrr1x4296p315vbk7m32c0000gp/T/t-scan-by-canonical-path5751497664913222173.tmp
Temporary directory /var/folders/2m/h3cvrr1x4296p315vbk7m32c0000gp/T/t-scan-by-canonical-path-other7953437145715633615.tmp
Testing clojure.tools.namespace.find-test
Temporary directory /var/folders/2m/h3cvrr1x4296p315vbk7m32c0000gp/T/t-find-clj-and-cljc-files2393781066831749619.tmp
Temporary directory /var/folders/2m/h3cvrr1x4296p315vbk7m32c0000gp/T/t-find-cljs-and-cljc-files3311774040746548801.tmp
Testing clojure.tools.namespace.move-test
Temporary directory /var/folders/2m/h3cvrr1x4296p315vbk7m32c0000gp/T/tools-namespace-t-move-ns4313522759469419488.tmp
Testing clojure.tools.namespace.parse-test
Ran 23 tests containing 58 assertions.
0 failures, 0 errors.
Yay! Iāll update these later. I couldnāt get by tools.build fork running with the cognitect-runner in babaska. When I tried passing arguments :task (cognitect.test-runner/-main "-n" "test-.*")
I got āCould not resolve symbol: cognitect.test-runner/-mainā. Works as a plain symbol, but then it doesnāt find the tests.
I now moved the repo here. Check this example. https://github.com/babashka/tools.namespace/blob/babashka/bb.edn
I also made an example in the README: https://github.com/babashka/tools.namespace#babashka-maintained-fork
It's only compatible with bb in the tools-build branch, since there are some missing classes, notably java.io.Closeable
.
@U0HFRSY0M I merged the tools.build branch to bb master now
I forked tools.build here:
https://github.com/babashka/tools.bbuild
The default branch is babashka
. Please PR your changes so far against this branch.
@U0HFRSY0M Should we release a new version of bb or do you expect more changes coming?