Fork me on GitHub

I'd like to enable clojure.core.reducers from babashka. My current understanding is that I'd have to do a custom build of babashka that includes the java.util.concurrent.ForkJoin* classes the reducers library uses ( Is there anything I'm missing? (This is because I'd like to use a library that depends on reducers:


Is clojure.core reducers crucial to that library? I only see one usage of it in core.clj - perhaps you can replace this usage with transducers in a reader conditional (or macro which dispatches on bb vs clj)


(defmacro if-bb [then else]
  (if (System/getProperty "babashka.version") then else))


good point, that's probably the route I'll go down, thanks!


How does bb build classpath regarding

:deps {local/deps {:local/root "."}}
? Example to reproduce: 1. Create an empty bb.edn file, and add the following
{:paths ["./"]
 :deps {local/deps {:local/root "."}}}
Classpath is populated. (What’s the logic to add classpath?) Also, if I change the above to
{:paths ["./"]
 :deps {local/deps {:local/root "./"}}}
The bb errs with error building classpath.


local/root scans a directory for a deps.edn file and those deps are added to the classpath


I recommend using just "." and not "./"

Jeffrey Bay19:07:21

so in the dir specified by the :local/root you could put a deps.edn with it's own :dir pointed to, say, "." or whatever else you wanted "src" etc

Jeffrey Bay19:07:38

interesting. i was trying something related last week and didn't get how that worked


yes, you could


this is just a feature of the #tools-deps stuff


> so in the dir specified by the :local/root you could put a deps.edn with it’s own :dir pointed to, say, "." or whatever else you wanted "src" etc Are you saying the :paths instead of :dir ?


> I recommend using just "." and not "./" (edited) @U04V15CAJ I was saying 1. specifying “.”, and “./” have a different effect, though they shall be the same. 2. Further, even if there is no deps.edn under the current directory, specifying “.” still adds some deps. I am investigating where it comes from.


@U04V15CAJ A reproducible example on myside is:

mkdir test-bb; cd test-bb
echo "{:deps {local/deps {:local/root "."}}}" > bb.edn
(require '[babashka.classpath :refer [get-classpath]])
A bunch of classpaths are showing up. user=> (get-classpath)
This one
Is one of my local repo. Dunno why it gets included.


@U04V15CAJ I removed the ~/.config/clojure/.cpcache, and the issue has now gone.


Not sure about the exact parts. But there must be some issue on the dependency caching. This answers my previous two questions.


It looks like the logic is, bb (or the deps tool) checks there is a key “.” in the cache, so it directly gives the classpath. It doesn’t even look if ./deps.edn exists or not, let alone the file’s cache.