From 26a542722f83f4740b8b513fc47fd5c58501f051 Mon Sep 17 00:00:00 2001 From: Kan Wu Date: Tue, 4 Aug 2026 01:56:16 -0700 Subject: [PATCH] [CI] Replace the rust-ext-build venv instead of failing when it exists (#33512) Co-authored-by: Claude Opus 5 (1M context) Co-authored-by: hnyls2002 --- .github/workflows/_pr-test-rust-ext-build.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_pr-test-rust-ext-build.yml b/.github/workflows/_pr-test-rust-ext-build.yml index 2978ffe3f..b60e0c4cb 100644 --- a/.github/workflows/_pr-test-rust-ext-build.yml +++ b/.github/workflows/_pr-test-rust-ext-build.yml @@ -164,9 +164,15 @@ jobs: python3 -m pip install --upgrade pip command -v uv >/dev/null 2>&1 || pip install uv # build_rust needs only the build backend, not sglang's ~294 runtime deps. - uv venv /tmp/rust-ext-build --python python3.10 --seed + # Per-job path: these runners are persistent and shared, so a fixed one + # both inherits the previous job's venv and races a concurrent build. + venv="${RUNNER_TEMP:-/tmp}/sglang-ci-rust-ext-${GITHUB_RUN_ID:-norun}-$$" + # Best-effort, like ci_cleanup_venv.sh: under set -e a failing EXIT trap + # would fail the step, and nothing here is worth keeping for a postmortem. + trap 'rm -rf "${venv}" || true' EXIT + uv venv "${venv}" --python python3.10 --seed # shellcheck disable=SC1091 - source /tmp/rust-ext-build/bin/activate + source "${venv}/bin/activate" uv pip install "setuptools>=61.0" "setuptools-rust>=1.10" "setuptools-scm>=8.0" wheel cd python SGLANG_BUILD_RUST_EXTS=all python setup.py build_rust --inplace