babashka 2025-10-01

what command could I execute during a container build process to ensure that I don't get this message later when I run bb in my container?

Clojure tools not yet in expected location: [snip]clojure-tools-1.12.2.1565.jar
Downloading  to [snip]
[snip]
Successfully installed clojure tools!
Downloading: org/clojure/clojure/1.12.2/clojure-1.12.2.pom from central
Downloading: org/apache/maven/maven-model/3.8.7/maven-model-3.8.7.pom from central
here's the source of the line https://github.com/borkdude/deps.clj/blob/0915443dd71999f59fe920c30650e8b1ec16d423/deps.clj#L958

✅ 1

I'm running:

curl -sLO  
...
./install
during the container build process

@adamfrey you could run bb prepare

or you could build an uberjar for in the container so you don't have to carry java into the container

with bb uberjar

or you could build the uberjar as part of a stage of the container build and copy that to the later stage

This is a container for our CI that will be used by multiple internal projects, so I don't mind having java, clojure, and bb all installed. At container build time I don't have a bb.edn yet, but it will be loaded in per-project

Maybe I can make a temporary bb.edn and use bb prepare with that during build time

ok. in that case you will need java in combination with bb. but the downloading of the tools jar you could do with an invocation of:

bb -Sdeps '{:deps {}}' prepare

maybe you'll have to include a real dependency in there or it won't run deps.clj

yeah, it didn't pull anything on first go. Let me try with another dep

$ bb -Sdeps '{:deps {medley/medley {:mvn/version "1.0.0"}}}' prepare
Clojure tools not yet in expected location: /Users/borkdude/.deps.clj/1.12.3.1577/ClojureTools/clojure-tools-1.12.3.1577.jar
Downloading  to /Users/borkdude/.deps.clj/1.12.3.1577/ClojureTools/clojure-tools.zip
Unzipping /Users/borkdude/.deps.clj/1.12.3.1577/ClojureTools/clojure-tools.zip ...
Successfully installed clojure tools!

bb -Sdeps '{:deps {org.clojure/data.json {:mvn/version "2.4.0"}}}' prepare
Clojure tools not yet in expected location: /root/.deps.clj/1.12.2.1565/ClojureTools/clojure-tools-1.12.2.1565.jar
Downloading ...
beautiful thank you

it would maybe be good to do this as part of the install script, I'll think about that some more

on the other hand, not all bb scripts need it

bb clojure --version is also a way to get the same effect, without specifying a dependency

👍 1

Can a task depend on another conditionally? e.g. check-env-locally {:depends [check-env} ;; desired: ONLY depend on check-env if not (System/getenv "CI")

✅ 1

...I can also move the conditional to the check-env impl, although it would be elegant to be able to leave it untouched

No but you could wrap the dependent task in a condition or you could use run

TIL about run - that's enough, thanks!

👍 I would have written run but that is terribly hard on the phone :)