Skip to content

fix(deploy): avoid SIGPIPE when previewing package contents - #53

Merged
ralf0131 merged 1 commit into
alibaba:mainfrom
YaoYingLong:feature/package_opensource
Jun 24, 2026
Merged

fix(deploy): avoid SIGPIPE when previewing package contents#53
ralf0131 merged 1 commit into
alibaba:mainfrom
YaoYingLong:feature/package_opensource

Conversation

@YaoYingLong

Copy link
Copy Markdown

The script deploy/package-opensource.sh enables strict mode via set -euo pipefail.

At the end of the script, the command tar -tzf "$OUTPUT_PATH" | head -20 is executed.

In Linux environments, head -20 closes the pipe immediately after printing the first 20 lines. This sends a SIGPIPE signal to the upstream tar process, making tar exit with code 141.

Due to set -o pipefail, the entire pipeline returns a non-zero exit code, which triggers set -e to terminate the whole script and results in the build failure.

@ralf0131 ralf0131 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix. Replacing head -20 with sed -n '1,20p' avoids the SIGPIPE that head triggers by closing its stdin early — under set -o pipefail tar would exit non-zero (141) and abort the script. sed -n drains the full stream so tar completes cleanly. LGTM.


Automated review by github-manager-bot

@ralf0131
ralf0131 merged commit 0384f50 into alibaba:main Jun 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants