This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-14
Channels
- # announcements (31)
- # babashka (9)
- # beginners (4)
- # calva (67)
- # cider (6)
- # clj-yaml (10)
- # clojure (105)
- # clojure-austin (8)
- # clojure-bay-area (1)
- # clojure-europe (12)
- # clojure-germany (3)
- # clojure-nl (1)
- # clojure-norway (7)
- # clojure-uk (2)
- # clojurescript (5)
- # core-logic (4)
- # data-science (29)
- # datomic (6)
- # dev-tooling (5)
- # emacs (3)
- # hyperfiddle (22)
- # introduce-yourself (4)
- # lsp (8)
- # malli (10)
- # off-topic (8)
- # pathom (74)
- # polylith (39)
- # practicalli (1)
- # reitit (3)
- # shadow-cljs (2)
- # spacemacs (3)
- # squint (4)
- # tools-deps (4)
Howdy! Maybe a bit of an odd question. I'd like to cache files in ~/.deps.clj
, but not sure what's the best way to get bb
to download clojure-tools. Here's my best shot:
bb -Sdeps '{:deps {org.jetbrains/dummy {:mvn/version "0.1.2"}}}' print-deps
This triggers bb
to download clojure-tools as a side-effect (which is needed for maven deps).
The downside is that it downloads that particular dependency – if that's not available, there's another opportunity for flakiness. Is there a way around this?Why do I want to do this? A while back there was a day where the server hosting clojure-tools was very flaky, and we added a stanza to our circleci config to cache the file.
# Temprorary hack to unblock CI
clojure-deps-install:
steps:
- restore_cache:
key: ~/.deps.clj/1.11.1.1347/ClojureTools/tools.zip-{{ arch }}
- run:
name: 'Install clojure tools'
command: |
if [ ! -f ~/.deps.clj/1.11.1.1347/ClojureTools/tools.zip ]; then
curl --retry 5 --create-dirs --output ~/.deps.clj/1.11.1.1347/ClojureTools/tools.zip
else
echo "File found. Skipping download of clojure tools"
fi
- save_cache:
key: ~/.deps.clj/1.11.1.1347/ClojureTools/tools.zip-{{ arch }}
paths:
- ~/.deps.clj/1.11.1.1347/ClojureTools/tools.zip
works!
bb clojure -Spath
Clojure tools not yet in expected location: /Users/user/.deps.clj/1.11.1.1347/ClojureTools/clojure-tools-1.11.1.1347.jar
Downloading to /Users/user/.deps.clj/1.11.1.1347/ClojureTools/tools.zip
Unzipping /Users/user/.deps.clj/1.11.1.1347/ClojureTools/tools.zip ...
Successfully installed clojure tools!
src:/Users/user/.m2/repository/org/clojure/clojure/1.11.1/clojure-1.11.1.jar:/Users/user/.m2/repository/org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.jar:/Users/user/.m2/repository/org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.jar
I didn't know about bb clojure
. Now I'm wondering about what else can be done with that command :thinking_face: