Skip to content

fix: swallowing uv sync failures hides broken environments - #20

Open
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:bugfix/entrypoint-swallowing-uv-sync-failures-hides
Open

fix: swallowing uv sync failures hides broken environments#20
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:bugfix/entrypoint-swallowing-uv-sync-failures-hides

Conversation

@andrewwhitecdw

Copy link
Copy Markdown

This PR fixes a script issue in bin/entrypoint.sh: swallowing uv sync failures hides broken environments.

Changes

  • bin/entrypoint.sh: swallowing uv sync failures hides broken environments.

Details

--- a/bin/entrypoint.sh
+++ b/bin/entrypoint.sh
@@ -1,1 +1,1 @@
-uv sync --locked --extra=${CUDA_NAME} || true
+uv sync --locked --extra=${CUDA_NAME}

Tests

  • tests/test_entrypoint.sh
--- /dev/null
+++ tests/test_entrypoint.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+# Regression test: entrypoint must fail when uv sync fails.
+tmp=$(mktemp -d)
+trap 'rm -rf "$tmp"' EXIT
+
+mkdir -p "$tmp/bin"
+cat > "$tmp/bin/uv" <<'EOF'
+#!/usr/bin/env bash
+echo "uv: simulated failure" >&2
+exit 1
+EOF
+chmod +x "$tmp/bin/uv"
+
+cp bin/entrypoint.sh "$tmp/entrypoint.sh"
+export PATH="$tmp/bin:$PATH"
+
+if "$tmp/entrypoint.sh" echo "should not run"; then
+  echo "FAIL: entrypoint continued despite uv sync failure"
+  exit 1
+else
+  echo "PASS: entrypoint failed on uv sync failure"
+fi

Signed-off-by: andrewwhitecdw <andrewwhitecdw@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant