Skip to content

Commit 6f71195

Browse files
krukowCopilot
andcommitted
fix: copy clojure tools jar to ~/.deps.clj for sandbox use
bb's deps.clj delegates to system clojure when it's on PATH, so `bb clojure -P` never writes the tools jar to ~/.deps.clj/. Inside the sandbox, system clojure isn't available, so bb needs the jar at ~/.deps.clj/<version>/ClojureTools/. This copies it explicitly from the system install directory during setup. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent eb0e718 commit 6f71195

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/copilot-setup-steps.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,21 @@ jobs:
4949
run: |
5050
# Download Maven deps via system clojure
5151
clojure -P
52-
# Populate ~/.deps.clj/ with the tools jar that bb expects —
53-
# the system clojure stores its jar in the install dir, not ~/.deps.clj/
52+
# Also resolve bb.edn deps (org.clojure/clojure)
5453
bb clojure -P
54+
# bb's deps.clj delegates to system clojure when it's on PATH,
55+
# so the tools jar never gets written to ~/.deps.clj/. Inside the
56+
# sandbox, system clojure isn't available, so bb needs the jar there.
57+
CLJ_VER=$(clojure --version 2>&1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | head -1)
58+
INSTALL_DIR=$(grep '^install_dir=' "$(which clojure)" 2>/dev/null | cut -d= -f2-)
59+
if [ -n "$CLJ_VER" ] && [ -n "$INSTALL_DIR" ]; then
60+
TOOLS_TARGET="$HOME/.deps.clj/$CLJ_VER/ClojureTools"
61+
if [ ! -f "$TOOLS_TARGET/clojure-tools-$CLJ_VER.jar" ]; then
62+
mkdir -p "$TOOLS_TARGET"
63+
SRC_JAR=$(find "$INSTALL_DIR" -name "clojure-tools-$CLJ_VER.jar" -print -quit 2>/dev/null)
64+
[ -n "$SRC_JAR" ] && cp "$SRC_JAR" "$TOOLS_TARGET/" && echo "Copied tools jar to $TOOLS_TARGET"
65+
fi
66+
fi
5567
# Ensure deps directories are readable by any user
5668
chmod -R a+rX ~/.m2/repository ~/.deps.clj 2>/dev/null || true
5769
- name: Install gh-aw extension

0 commit comments

Comments
 (0)