Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions toolchain/bootstrap/python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,14 @@ if ! cmp "$(pwd)/toolchain/pyproject.toml" "$(pwd)/build/pyproject.toml" > /dev/
if [ "$USE_UV" = "1" ]; then
# UV_LINK_MODE=copy avoids slow hardlink failures on cross-filesystem installs (common on HPC)
export UV_LINK_MODE=copy
# On GitHub Actions self-hosted runners, the default uv cache (~/.cache/uv)
# often lives on a shared NFS $HOME (e.g. OLCF /ccs/home), where uv's
# file-lock implementation hits "os error 524" when concurrent runners on
# different nodes contend for the same .lock. Redirect to node-local
# storage in CI only, so non-CI users keep their normal reusable cache.
if [ "${GITHUB_ACTIONS:-}" = "true" ] && [ -w "${TMPDIR:-/tmp}" ]; then
export UV_CACHE_DIR="${TMPDIR:-/tmp}/uv-cache-${USER:-$(id -un)}"
fi
Comment on lines +188 to +190

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Harden CI cache-root fallback to avoid silently reverting to shared ~/.cache/uv.

At Line 188, if TMPDIR is set but unusable, the condition fails and UV_CACHE_DIR is left unset, so CI can still hit the shared-home lock path this PR is fixing.

Suggested patch
-        if [ "${GITHUB_ACTIONS:-}" = "true" ] && [ -w "${TMPDIR:-/tmp}" ]; then
-            export UV_CACHE_DIR="${TMPDIR:-/tmp}/uv-cache-${USER:-$(id -un)}"
-        fi
+        if [ "${GITHUB_ACTIONS:-}" = "true" ]; then
+            uv_cache_root="${TMPDIR:-}"
+            if [ -z "$uv_cache_root" ] || [ ! -d "$uv_cache_root" ] || [ ! -w "$uv_cache_root" ]; then
+                uv_cache_root="/tmp"
+            fi
+            if [ -d "$uv_cache_root" ] && [ -w "$uv_cache_root" ]; then
+                export UV_CACHE_DIR="${uv_cache_root}/uv-cache-${USER:-$(id -un)}"
+            fi
+        fi

log "(venv) Using$MAGENTA uv$COLOR_RESET for fast installation..."

if [ "$verbose" = "1" ]; then
Expand Down
Loading