babashka

adamfrey 2025-10-01T14:13:58.183459Z

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
adamfrey 2025-10-01T14:14:36.828719Z

I'm running:

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

borkdude 2025-10-01T14:18:42.483669Z

@adamfrey you could run bb prepare

borkdude 2025-10-01T14:19:26.789089Z

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

borkdude 2025-10-01T14:19:33.051289Z

with bb uberjar

borkdude 2025-10-01T14:20:45.006099Z

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

adamfrey 2025-10-01T14:21:43.305219Z

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

adamfrey 2025-10-01T14:22:38.594869Z

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

borkdude 2025-10-01T14:22:49.245899Z

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

borkdude 2025-10-01T14:23:19.242259Z

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

adamfrey 2025-10-01T14:23:37.222419Z

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

borkdude 2025-10-01T14:24:36.449349Z

$ 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!

adamfrey 2025-10-01T14:24:37.046759Z

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

borkdude 2025-10-01T14:24:42.688589Z

:)

borkdude 2025-10-01T14:25:30.301799Z

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

borkdude 2025-10-01T14:25:44.049149Z

on the other hand, not all bb scripts need it

borkdude 2025-10-01T14:31:48.318409Z

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

👍 1
vemv 2025-10-01T16:31:50.156399Z

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
vemv 2025-10-01T16:54:33.506789Z

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

borkdude 2025-10-01T17:06:07.608899Z

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

vemv 2025-10-01T17:20:40.012029Z

TIL about run - that's enough, thanks!

borkdude 2025-10-01T17:21:41.384329Z

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