Skip to content

Commit f15262c

Browse files
krukowCopilot
andcommitted
fix: set DEPS_CLJ_TOOLS_DIR for sandbox HOME mismatch
Inside the awf sandbox $HOME is /root (runs as root), but the mount maps /home/runner/.deps.clj into the container at that same host path. bb's deps.clj uses $HOME/.deps.clj/ by default, so it looks in /root/.deps.clj/ and misses the mount. Setting DEPS_CLJ_TOOLS_DIR to the absolute /home/runner/.deps.clj path via GITHUB_ENV ensures bb finds the tools jar regardless of $HOME. Also removed debug logging from previous iteration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 478127a commit f15262c

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

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

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,34 +51,28 @@ jobs:
5151
clojure -P
5252
# Also resolve bb.edn deps (org.clojure/clojure)
5353
bb clojure -P
54+
# Copy the tools jar to ~/.deps.clj/ so bb can find it.
5455
# 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.
56+
# so bb clojure -P never writes the jar to ~/.deps.clj/.
5757
CLJ_VER=$(clojure --version 2>&1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | head -1)
58-
echo "DEBUG: CLJ_VER=$CLJ_VER"
59-
echo "DEBUG: CLOJURE_INSTALL_DIR=$CLOJURE_INSTALL_DIR"
60-
echo "DEBUG: which clojure=$(which clojure)"
61-
# Use CLOJURE_INSTALL_DIR env var (set by DeLaGuardo/setup-clojure),
62-
# fall back to parsing the clojure wrapper script
6358
INSTALL_DIR="${CLOJURE_INSTALL_DIR:-}"
6459
if [ -z "$INSTALL_DIR" ]; then
6560
INSTALL_DIR=$(grep '^install_dir=' "$(which clojure)" 2>/dev/null | cut -d= -f2-)
6661
fi
67-
echo "DEBUG: resolved INSTALL_DIR=$INSTALL_DIR"
6862
if [ -n "$CLJ_VER" ] && [ -n "$INSTALL_DIR" ]; then
6963
TOOLS_TARGET="$HOME/.deps.clj/$CLJ_VER/ClojureTools"
7064
SRC_JAR=$(find "$INSTALL_DIR" -name "clojure-tools-$CLJ_VER.jar" -print -quit 2>/dev/null)
71-
echo "DEBUG: SRC_JAR=$SRC_JAR"
72-
echo "DEBUG: TOOLS_TARGET=$TOOLS_TARGET"
7365
if [ -n "$SRC_JAR" ] && [ ! -f "$TOOLS_TARGET/clojure-tools-$CLJ_VER.jar" ]; then
7466
mkdir -p "$TOOLS_TARGET"
7567
cp "$SRC_JAR" "$TOOLS_TARGET/"
7668
echo "Copied tools jar to $TOOLS_TARGET"
7769
fi
78-
ls -la "$TOOLS_TARGET/" 2>/dev/null || echo "DEBUG: TOOLS_TARGET dir does not exist"
79-
else
80-
echo "ERROR: Could not determine CLJ_VER or INSTALL_DIR"
8170
fi
71+
# Tell bb's deps.clj where to find the tools jar using an absolute
72+
# path. Inside the awf sandbox $HOME is /root, but the mount maps
73+
# /home/runner/.deps.clj into the container, so we must use the
74+
# absolute host path rather than relying on $HOME.
75+
echo "DEPS_CLJ_TOOLS_DIR=$HOME/.deps.clj" >> "$GITHUB_ENV"
8276
# Ensure deps directories are readable by any user
8377
chmod -R a+rX ~/.m2/repository ~/.deps.clj 2>/dev/null || true
8478
- name: Install gh-aw extension

.github/workflows/daily-doc-updater.lock.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)