From 593bf2e53e3cfc43efb160f5dc7878cdb80eda0c Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Thu, 27 Aug 2026 23:24:25 +0200 Subject: [PATCH 1/2] Run the tests on the JVM against the babashka/ffi library babashka.ffi is now a direct git dependency, so the namespace also works on JVM Clojure (JDK 22+, --enable-native-access). clojure -M:test runs the same suite that bb test runs. The clj-kondo config comes from the library's export through --copy-configs, which replaces the hand-copied hook. --- .clj-kondo/config.edn | 3 +-- .clj-kondo/imports/babashka/ffi/config.edn | 1 + .../babashka/ffi}/hooks/babashka/ffi.clj | 0 deps.edn | 15 ++++++++++++++- 4 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 .clj-kondo/imports/babashka/ffi/config.edn rename .clj-kondo/{ => imports/babashka/ffi}/hooks/babashka/ffi.clj (100%) diff --git a/.clj-kondo/config.edn b/.clj-kondo/config.edn index b3153d2..f3fda7e 100644 --- a/.clj-kondo/config.edn +++ b/.clj-kondo/config.edn @@ -1,3 +1,2 @@ -{:hooks {:analyze-call {babashka.ffi/defcfn hooks.babashka.ffi/defcfn}} - :lint-as {babashka.sqlite3/with-db clojure.core/with-open +{:lint-as {babashka.sqlite3/with-db clojure.core/with-open babashka.sqlite3/with-transaction clojure.core/locking}} diff --git a/.clj-kondo/imports/babashka/ffi/config.edn b/.clj-kondo/imports/babashka/ffi/config.edn new file mode 100644 index 0000000..9b587d4 --- /dev/null +++ b/.clj-kondo/imports/babashka/ffi/config.edn @@ -0,0 +1 @@ +{:hooks {:analyze-call {babashka.ffi/defcfn hooks.babashka.ffi/defcfn}}} diff --git a/.clj-kondo/hooks/babashka/ffi.clj b/.clj-kondo/imports/babashka/ffi/hooks/babashka/ffi.clj similarity index 100% rename from .clj-kondo/hooks/babashka/ffi.clj rename to .clj-kondo/imports/babashka/ffi/hooks/babashka/ffi.clj diff --git a/deps.edn b/deps.edn index ccd9a31..4b25dbf 100644 --- a/deps.edn +++ b/deps.edn @@ -1 +1,14 @@ -{:paths ["src"]} +{:paths ["src"] + ;; On babashka the library is built in; on the JVM it comes from the + ;; babashka/ffi repository. + :deps {io.github.babashka/ffi + {:git/url "https://github.com/babashka/ffi" + :git/sha "998463b52239dbf552c03b8d7463ebd190976bfd"}} + :aliases + {:test {:extra-paths ["test"] + :extra-deps {io.github.cognitect-labs/test-runner + {:git/tag "v0.5.1" + :git/sha "dfb30dd6605cb6c0efc275e1df1736f6e90d4d73"}} + :jvm-opts ["--enable-native-access=ALL-UNNAMED"] + :main-opts ["-m" "cognitect.test-runner"] + :exec-fn cognitect.test-runner.api/test}}} From 2a7a4f502a7fd2b301213cad5986ebf708585d4f Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Fri, 28 Aug 2026 15:46:23 +0200 Subject: [PATCH 2/2] Track the babashka/ffi sha with the new argument order The library now requires an arena in alloc and puts write's byte offset last. This namespace already used both, so nothing else changes. --- deps.edn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps.edn b/deps.edn index 4b25dbf..c12f445 100644 --- a/deps.edn +++ b/deps.edn @@ -3,7 +3,7 @@ ;; babashka/ffi repository. :deps {io.github.babashka/ffi {:git/url "https://github.com/babashka/ffi" - :git/sha "998463b52239dbf552c03b8d7463ebd190976bfd"}} + :git/sha "ff81281509656d6bc085571db451aac1675302fb"}} :aliases {:test {:extra-paths ["test"] :extra-deps {io.github.cognitect-labs/test-runner