fix(build): build.sh reports false failure on successful builds - #245
Merged
yoavkatz merged 1 commit intoAug 11, 2026
Merged
Conversation
((SUCCESS_COUNT++)) with SUCCESS_COUNT starting at 0 evaluates to the pre-increment value (0), which bash treats as a failed command under `set -e` -- so the script exits immediately right after a successful build, before ever printing the build summary, and reports exit code 1 despite the build having actually succeeded. Same latent bug applies to FAIL_COUNT on the first real failure. Switched both to plain arithmetic assignment ($((x + 1))), which has no such trap. Found while building exgentic-mcp-tau2 for a downstream integration -- the image built fine (confirmed via `podman images`) but the script reported failure with no error message, right after printing "Successfully built ...". Signed-off-by: Vitaly Zabershinsky <VITALYZ@il.ibm.com>
vz-ibm
force-pushed
the
fix/build-sh-count-increment
branch
from
August 11, 2026 13:20
3e34f66 to
74ae6e7
Compare
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.
Problem
`((SUCCESS_COUNT++))` with `SUCCESS_COUNT` starting at `0` evaluates to
the pre-increment value (`0`), which bash treats as a failed command
under `set -e` — so the script exits immediately right after a
successful build, before ever printing the build summary, and reports
exit code 1 despite the build having actually succeeded. The same latent
bug applies to `FAIL_COUNT` on the first real failure (it would exit
before `print_error` even runs).
Found while building `exgentic-mcp-tau2` for a downstream integration —
`./build.sh tau2` printed `[INFO] ✓ Successfully built
localhost/exgentic-mcp-tau2:latest` and then exited 1 with no error
message. Confirmed the image genuinely built fine (`podman images`
showed it).
Fix
Switched both counters to plain arithmetic assignment (`$((x + 1))`),
which has no such trap — only a bare `((expr))` command's own exit
status is subject to this, not an assignment.
Base is `feature/mcp-command` (this script only exists there, not on
`main` yet) so this is easy to review/merge independently of the larger
`#187`.