Repository navigation
fix(build): propagate errors out of the libgit2 cross-build loop - #9165
Merged
klesh merged 2 commits intoSep 24, 2026
Merged
Conversation
The aarch64/x86_64 cross-build for-loop had no 'set -e', so a cmake/make failure for one arch was silently swallowed and the loop moved on to the next, leaving that arch's libgit2 missing from /usr/local/deps while the RUN step still exited 0. Verified both aarch64 and x86_64 libgit2 still build successfully after this change (native arm64 build of the 'builder' stage).
klesh
approved these changes
Sep 24, 2026
klesh
left a comment
Contributor
There was a problem hiding this comment.
LGTM
Thanks for your contribution.
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.
The for-loop that cross-compiles libgit2 for aarch64 and x86_64 had no 'set -e'. If either arch's cmake/make chain failed, the failure was only visible as a broken '&&' chain within that single loop iteration; the surrounding for-loop has no error propagation of its own, so it silently moved on to the next arch and the whole RUN step still exited 0 even though one architecture's libgit2 was never installed under /usr/local/deps. The real failure would then only surface later, confusingly, in the unrelated 'build' stage as a pkg-config "libgit2 not found" error when that architecture's (missing) directory was needed.
Add 'set -e;' to the loop so any future per-arch build failure fails the image build immediately and visibly, at the point where it actually occurs, instead of being masked.
No behavior change on the success path: verified both aarch64 and x86_64 libgit2 (with .pc files) are still produced under /usr/local/deps after this change, building the 'builder' stage natively on an arm64 host.
pr-type/bug-fix,pr-type/feature-development, etc.Summary
What does this PR do?
Does this close any open issues?
Closes xx
Screenshots
Include any relevant screenshots here.
Other Information
Any other information that is important to this PR.