Skip to content

make.sh: don't quit sed early in the rcc pipeline - #85

Open
omnimaxxing wants to merge 1 commit into
asivery:masterfrom
omnimaxxing:fix-make-sigpipe
Open

omnimaxxing wants to merge 1 commit into
asivery:masterfrom
omnimaxxing:fix-make-sigpipe

Conversation

@omnimaxxing

Copy link
Copy Markdown

The release workflow currently fails in "Build AppLoad" with Process completed with exit code 141, on both the latest-rmpp and latest-rm1 images. Building df974a6 through the release workflow on my fork failed 4 out of 4 runs. The last successful release run was v0.6.0 on Sep 19.

Cause

In xovi/make.sh:

rcc --no-compress -g cpp ../resources/resources.qrc | sed '/#ifdef _MSC_VER/,/#endif/d' | sed -n '/#ifdef/q;p' > temporary/resources.cpp

sed -n '/#ifdef/q;p' exits at the first #ifdef, about 2 KB before the end of rcc's ~250 KB output. If rcc hasn't finished writing by then, it gets SIGPIPE. Under set -euo pipefail the pipeline's status is 141 and the script stops. Whether it hits depends on timing, which is why it passes on some machines (it does on mine) and fails in CI.

Change

-... | sed -n '/#ifdef/q;p' > temporary/resources.cpp
+... | sed -n '/#ifdef/,$!p' > temporary/resources.cpp

'/#ifdef/,$!p' prints the same lines (everything before the first #ifdef) but reads its input to the end, so rcc never writes into a closed pipe. With Qt 6.11's rcc the generated resources.cpp is byte-identical before and after (249,147 bytes, cmp clean).

Testing

The release workflow on my fork, at this branch: both builds (latest-rmpp aarch64, latest-rm1 arm32) and the release job pass: https://github.com/omnimaxxing/rm-appload/actions/runs/42420372422

`sed -n '/#ifdef/q;p'` exits at the first #ifdef, about 2 KB before the
end of rcc's output. If rcc is still writing, it gets SIGPIPE, and with
`set -o pipefail` the script exits 141. The release workflow now fails
this way on both toolchain images.

`sed -n '/#ifdef/,$!p'` prints the same lines (everything before the
first #ifdef) but reads its input to the end, so rcc never sees a closed
pipe. The generated resources.cpp is byte-identical.
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.

1 participant