Skip to content

Commit 94ebf82

Browse files
atalmanclaude
andcommitted
Fix startup failure: move BUILD_VENV out of job-level env; clean shellcheck
`BUILD_VENV: ${{ runner.temp }}/build_venv` used the `runner` context in a job-level env: block, where it is not available (only github/inputs/matrix/ needs/secrets/strategy/vars are). actionlint flags this as an error and GitHub rejects the whole reusable workflow at parse time, so the test_build_wheels_ linux_v2 caller produced 0 jobs and failed immediately ("workflow not running"). Set BUILD_VENV from $RUNNER_TEMP in an early step (via $GITHUB_ENV) instead. Also clear the remaining actionlint/shellcheck findings on the new v2 file so the Lint check (which lints the diff, i.e. every line of a new file) passes: - SC1090: add `# shellcheck disable=SC1090` before each `source "$BUILD_ENV_FILE"` - SC2155: add `# shellcheck disable=SC2155` on `export PYTORCH_VERSION=$(...)` - SC2086: quote "$pkg" / "$abs_pkg" in the manylinux repair loop - SC2115: `rm -rf "${RUNNER_TEMP:?}/"*` (also fixes a quoted-glob bug that removed a literal `*` and cleaned nothing) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 352be0f commit 94ebf82

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

.github/workflows/build_wheels_linux_v2.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,6 @@ jobs:
179179
UPLOAD_TO_BASE_BUCKET: ${{ matrix.upload_to_base_bucket }}
180180
ARCH: ${{ inputs.architecture }}
181181
BUILD_TARGET: ${{ inputs.build-target }}
182-
# Where the uv-managed build venv lives; activated in every build/test step.
183-
BUILD_VENV: ${{ runner.temp }}/build_venv
184182
name: build-${{ matrix.build_name }}
185183
runs-on: ${{ (inputs.runner != '' && inputs.runner) || matrix.validation_runner }}
186184
environment: ${{(inputs.trigger-event == 'schedule' || (inputs.trigger-event == 'push' && (startsWith(github.event.ref, 'refs/heads/nightly') || startsWith(github.event.ref, 'refs/tags/v')))) && 'pytorchbot-env' || ''}}
@@ -198,10 +196,17 @@ jobs:
198196
mkdir -p "${GITHUB_WORKSPACE}"
199197
200198
if [[ "${{ inputs.architecture }}" = "aarch64" ]]; then
201-
rm -rf "${RUNNER_TEMP}/*"
199+
rm -rf "${RUNNER_TEMP:?}/"*
202200
fi
203201
echo "::endgroup::"
204202
203+
# Where the uv-managed build venv lives; activated in every build/test
204+
# step. Set here (not in job-level env:) because it needs $RUNNER_TEMP --
205+
# the `runner` context is not available in a job-level env: block.
206+
- name: Set build venv path
207+
shell: bash
208+
run: echo "BUILD_VENV=${RUNNER_TEMP}/build_venv" >> "${GITHUB_ENV}"
209+
205210
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
206211
with:
207212
# Support the use case where we need to checkout someone's fork
@@ -333,8 +338,10 @@ jobs:
333338
shell: bash -l {0}
334339
run: |
335340
set -euxo pipefail
341+
# shellcheck disable=SC1090
336342
source "${BUILD_ENV_FILE}"
337343
export PATH="${BUILD_VENV}/bin:${PATH}"
344+
# shellcheck disable=SC2155
338345
export PYTORCH_VERSION="$(${CONDA_RUN} pip show torch | grep ^Version: | sed 's/Version: *//' | sed 's/+.\+//')"
339346
echo "Successfully installed Python build package"
340347
${CONDA_RUN} ${{ inputs.build-command }}
@@ -345,8 +352,10 @@ jobs:
345352
shell: bash -l {0}
346353
run: |
347354
set -euxo pipefail
355+
# shellcheck disable=SC1090
348356
source "${BUILD_ENV_FILE}"
349357
export PATH="${BUILD_VENV}/bin:${PATH}"
358+
# shellcheck disable=SC2155
350359
export PYTORCH_VERSION="$(${CONDA_RUN} pip show torch | grep ^Version: | sed 's/Version: *//' | sed 's/+.\+//')"
351360
${CONDA_RUN} python setup.py clean
352361
echo "Successfully ran python setup.py clean"
@@ -359,15 +368,16 @@ jobs:
359368
SMOKE_TEST_SCRIPT: ${{ inputs.smoke-test-script }}
360369
run: |
361370
set -euxo pipefail
371+
# shellcheck disable=SC1090
362372
source "${BUILD_ENV_FILE}"
363373
export PATH="${BUILD_VENV}/bin:${PATH}"
364374
for pkg in ${{ inputs.repository }}/dist/*-linux_*.whl; do
365375
# if the glob didn't match anything
366376
if [[ ! -e $pkg ]]; then
367377
continue
368378
fi
369-
abs_pkg=$(realpath $pkg)
370-
./test-infra/.github/scripts/repair_manylinux_2_28.sh $abs_pkg
379+
abs_pkg=$(realpath "$pkg")
380+
./test-infra/.github/scripts/repair_manylinux_2_28.sh "$abs_pkg"
371381
done
372382
373383
- name: Run Post-Script
@@ -385,6 +395,7 @@ jobs:
385395
SMOKE_TEST_SCRIPT: ${{ inputs.smoke-test-script }}
386396
run: |
387397
set -euxo pipefail
398+
# shellcheck disable=SC1090
388399
source "${BUILD_ENV_FILE}"
389400
export PATH="${BUILD_VENV}/bin:${PATH}"
390401
WHEEL_NAME=$(ls "${{ inputs.repository }}/dist/")

0 commit comments

Comments
 (0)