Skip to content

Commit 006f141

Browse files
krukowCopilot
andcommitted
fix: mount .m2 and .deps.clj to /root/ for awf sandbox
The awf sandbox runs as root, so $HOME=/root. bb (GraalVM native image) uses $HOME to find .m2/repository and .deps.clj/. Previous attempts with env vars (JAVA_TOOL_OPTIONS, CLJ_CONFIG, CLJ_JVM_OPTS) failed because bb ignores JAVA_TOOL_OPTIONS (native image), skips user config (:user nil), and CLJ_JVM_OPTS doesn't reach tools.deps. The correct fix: mount the host directories to /root/ in addition to /home/runner/, so they're found at $HOME/.m2 and $HOME/.deps.clj regardless of what $HOME is. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 34fc13b commit 006f141

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

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

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,9 @@ jobs:
6868
echo "Copied tools jar to $TOOLS_TARGET"
6969
fi
7070
fi
71-
# Inside the awf sandbox $HOME is /root, but the mounts map
72-
# /home/runner/.deps.clj and /home/runner/.m2 into the container
73-
# at those same absolute paths. bb is a GraalVM native image so
74-
# JAVA_TOOL_OPTIONS has no effect — we must use env vars that
75-
# bb/tools.deps read directly.
76-
#
77-
# DEPS_CLJ_TOOLS_DIR: tells bb's deps.clj where the tools jar is
78-
# CLJ_CONFIG: tells tools.deps where to find user deps.edn (which
79-
# contains :mvn/local-repo pointing to the mounted Maven cache)
80-
echo '{:mvn/local-repo "/home/runner/.m2/repository"}' > "$HOME/.deps.clj/deps.edn"
81-
echo "DEPS_CLJ_TOOLS_DIR=$HOME/.deps.clj" >> "$GITHUB_ENV"
82-
echo "CLJ_CONFIG=$HOME/.deps.clj" >> "$GITHUB_ENV"
71+
# Inside the awf sandbox $HOME is /root (container runs as root).
72+
# The workflow mounts .m2 and .deps.clj to both /home/runner/ and
73+
# /root/ paths, so bb finds them regardless of $HOME.
8374
# Ensure deps directories are readable by any user
8475
chmod -R a+rX ~/.m2/repository ~/.deps.clj 2>/dev/null || true
8576
- name: Install gh-aw extension

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

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/daily-doc-updater.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ sandbox:
3333
mounts:
3434
- "/home/runner/.m2:/home/runner/.m2:ro"
3535
- "/home/runner/.deps.clj:/home/runner/.deps.clj:ro"
36+
- "/home/runner/.m2:/root/.m2:ro"
37+
- "/home/runner/.deps.clj:/root/.deps.clj:ro"
3638
strict: true
3739
timeout-minutes: 45
3840
imports:

0 commit comments

Comments
 (0)