builder.sh: propagate the build failure instead of always exiting 0 - #136
Merged
Merged
Conversation
`make BOARD=${DEVICE}` was unguarded and nothing checked its status, so the
script always returned 0. copy_to_archive then ran regardless and printed
"Assembled firmware available in:" over an empty directory.
The expensive part is what that did to CI rather than the misleading banner.
master.yml calls this inside a retry loop:
for sleep_for in $backoffs ""; do
bash builder.sh ${NAME} && break
...
echo "::error::build failed after ${attempt} attempts"
exit 1
done
A script that cannot fail satisfies `&& break` on the first attempt. So the
six-step backoff budget, added specifically to absorb transient toolchain and
CDN flakes, never retried anything, and the `exit 1` after the loop was
unreachable. A genuinely failed build reported green instead of being
re-attempted.
Until OpenIPC#135 this was masked downstream: Stage artifacts is gated on env.NORFW,
so a failed build merely skipped the upload. Now that a PR keeps the image it
built, a green job with no fw-* attached is a reliable tell that the build
failed silently -- which makes propagating the status more useful, not less.
Found while building a device profile locally, where make died and the script
still reported success. Deliberately NOT `set -e` at the top: this script does a
lot of unguarded cp/rm/cd and enabling errexit globally would change failure
behaviour well beyond this line.
Refs: OpenIPC#119
PR Summary by QodoPropagate firmware build failures from builder.sh
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make BOARD=${DEVICE}is unguarded and nothing checks its status, sobuilder.shalways exits 0.
copy_to_archivethen runs regardless and printsAssembled firmware available in:over an empty directory.The misleading banner is the small part. The expensive part is what it does to CI,
which @widgetii pointed out on #119 —
master.ymlcalls this inside a retry loop:A script that cannot fail satisfies
&& breakon the first attempt. So thesix-step backoff budget, added specifically to absorb transient toolchain and CDN
flakes, has never retried anything, and the
exit 1after the loop isunreachable. A genuinely failed build reports green rather than being
re-attempted.
Until #135 this was masked downstream:
Stage artifactsis gated onenv.NORFW,so a failed build merely skipped the upload rather than failing the job. Now that
a PR keeps the image it built, a green job with no
fw-*attached is a reliabletell that the build failed silently — which makes propagating the status more
useful, not less.
How I hit it
Building
gk7202v300_lite_generic-w7locally,makedied partway through(unrelated host problem — an emulated x86_64 toolchain segfaulting gcc). The
script still printed the archive banner and returned 0, and I briefly believed I
had an image. The directory was empty.
The change
Deliberately not
set -eat the top, per @widgetii's suggestion and for thesame reason: this script does a lot of unguarded
cp/rm/cd, and enablingerrexit globally would change failure behaviour well beyond this line. The
explicit form touches exactly the status that callers depend on.
size-reportkeeps its|| true— it is genuinely best-effort against olderpinned firmware refs.
sh -nclean. Verified the new path returns the make status rather than 0.Branched from
222db9erather than current master only because my token cannotcreate the newer workflow files on my fork;
builder.shis byte-identical at bothcommits, so the diff is exactly the twenty lines above.
Refs: #119