fix(argo): wrap TEST_BIN pipeline in subshell + || true to suppress SIGPIPE

`set -o pipefail` + `head -1` closing stdin produces SIGPIPE (exit 141)
from upstream `ls`/`grep`. The subshell + || true contains the failure
to the inner pipeline so the script's pipefail doesn't propagate it.

Sanitizer fired exit 141 immediately after the cargo build; nsys
reproduced the same exit on its parallel run, confirming the diagnosis.
This commit is contained in:
jgrusewski
2026-04-28 22:27:33 +02:00
parent 8e6b9684fb
commit 169610c85d
2 changed files with 6 additions and 4 deletions

View File

@@ -215,10 +215,11 @@ spec:
# Honour CARGO_TARGET_DIR — outputs go to ${CARGO_TARGET_DIR}/release/deps,
# NOT the repo-relative target/. (CI workflow sets CARGO_TARGET_DIR=/cargo-target.)
# Subshell + || true wraps the head -1 SIGPIPE so pipefail doesn't fire.
TARGET_DIR="${CARGO_TARGET_DIR:-target}"
TEST_BIN=$(ls -t "$TARGET_DIR/release/deps/ml-"* 2>/dev/null \
TEST_BIN=$( (ls -t "$TARGET_DIR/release/deps/ml-"* 2>/dev/null \
| grep -vE '\.(d|rcgu|rmeta|rlib|so|json)$' \
| head -1)
| head -1) || true )
if [ -z "$TEST_BIN" ] || [ ! -x "$TEST_BIN" ]; then
echo "ERROR: could not locate compiled test binary in $TARGET_DIR/release/deps/"
ls -la "$TARGET_DIR/release/deps/" 2>&1 | head -20

View File

@@ -203,10 +203,11 @@ spec:
# Locate the freshest ml-* test binary
# Honour CARGO_TARGET_DIR — outputs go to ${CARGO_TARGET_DIR}/release/deps,
# NOT the repo-relative target/. (CI workflow sets CARGO_TARGET_DIR=/cargo-target.)
# Subshell + || true wraps the head -1 SIGPIPE so pipefail doesn't fire.
TARGET_DIR="${CARGO_TARGET_DIR:-target}"
TEST_BIN=$(ls -t "$TARGET_DIR/release/deps/ml-"* 2>/dev/null \
TEST_BIN=$( (ls -t "$TARGET_DIR/release/deps/ml-"* 2>/dev/null \
| grep -vE '\.(d|rcgu|rmeta|rlib|so|json)$' \
| head -1)
| head -1) || true )
if [ -z "$TEST_BIN" ] || [ ! -x "$TEST_BIN" ]; then
echo "ERROR: could not locate compiled test binary in $TARGET_DIR/release/deps/"
ls -la "$TARGET_DIR/release/deps/" 2>&1 | head -20