From dd33a10947c9e9a08ad2f1e1040cf74013d378e1 Mon Sep 17 00:00:00 2001 From: Aminsed <35748194+Aminsed@users.noreply.github.com> Date: Tue, 28 Jul 2026 08:51:18 -0400 Subject: [PATCH] Stop the sdist guard from failing on a complete sdist The release run for v0.2.0 reported "sdist is missing CMakeLists.txt" for an sdist that contained it. `tar tzf archive | grep -q PATTERN` under `set -o pipefail` is the trap: grep -q exits the instant it matches, tar then dies of SIGPIPE writing the rest of the listing, and pipefail reports the pipeline as failed. Exit status 141 on a successful match. List the archive once into a file and grep the file. The guard did its job in the sense that mattered -- publishing was skipped rather than proceeding on an unverified artifact -- but it was checking the wrong thing. --- .github/workflows/release.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8f875f2..ee75992 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,11 +36,15 @@ jobs: # never build. Fail the release rather than publish that again. run: | set -euo pipefail + # Listed once into a file rather than piped per-file: `tar | grep -q` + # makes grep exit on its first match, tar dies of SIGPIPE, and + # pipefail then reports the whole check as a failure. + tar tzf dist/*.tar.gz > "$RUNNER_TEMP/sdist-listing.txt" for f in CMakeLists.txt src/cuda/knn.cu src/cuda/lof.cu \ src/cuda/pipeline.cu src/cuda/preprocess.cu \ src/cuda/binding.cpp include/culof.h \ include/culof_internal.cuh src/culof/__init__.py; do - tar tzf dist/*.tar.gz | grep -q "/$f$" \ + grep -q "/$f$" "$RUNNER_TEMP/sdist-listing.txt" \ || { echo "::error::sdist is missing $f"; exit 1; } done echo "sdist contains every file needed to build"