From 7bc1c8a98247c799a0af2bc222d395ef44a9f92b Mon Sep 17 00:00:00 2001 From: Jeremie Fraeys Date: Sat, 21 Feb 2026 20:44:27 -0500 Subject: [PATCH] fix(build): avoid SIGPIPE in rsync SHA256 verification Replace echo | sha256sum -c - pipeline with direct comparison Fixes error 141 (SIGPIPE) caused by pipefail with early pipe close --- cli/scripts/build_rsync.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cli/scripts/build_rsync.sh b/cli/scripts/build_rsync.sh index 4ef5cd2..0d9723b 100644 --- a/cli/scripts/build_rsync.sh +++ b/cli/scripts/build_rsync.sh @@ -56,12 +56,13 @@ fi if [[ "${verified}" -ne 1 ]]; then if [[ -n "${RSYNC_TARBALL_SHA256}" ]]; then echo "verifying sha256 for ${url}" - if command -v sha256sum >/dev/null 2>&1; then - echo "${RSYNC_TARBALL_SHA256} ${tmp}/rsync.tar.gz" | sha256sum -c - - elif command -v shasum >/dev/null 2>&1; then - echo "${RSYNC_TARBALL_SHA256} ${tmp}/rsync.tar.gz" | shasum -a 256 -c - + actual_sha256="$(sha256sum "${tmp}/rsync.tar.gz" | cut -d' ' -f1)" + if [[ "${actual_sha256}" == "${RSYNC_TARBALL_SHA256}" ]]; then + echo "${tmp}/rsync.tar.gz: OK" else - echo "build-rsync: need sha256sum or shasum for checksum verification" >&2 + echo "build-rsync: sha256 mismatch!" >&2 + echo " expected: ${RSYNC_TARBALL_SHA256}" >&2 + echo " actual: ${actual_sha256}" >&2 exit 2 fi else