Fail the ABI check when abidiff cannot run - #3511
Open
justsmth wants to merge 1 commit into
Open
Conversation
justsmth
force-pushed
the
abidiff-fail-on-tool-error
branch
from
September 10, 2026 20:17
ffcb8d1 to
895bc16
Compare
Contributor
|
🔒 Security Review — View Report Please review before merging. |
dougch
approved these changes
Sep 10, 2026
dougch
left a comment
Contributor
There was a problem hiding this comment.
Curious how you found this?
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3511 +/- ##
==========================================
- Coverage 78.36% 78.17% -0.20%
==========================================
Files 700 700
Lines 125744 125743 -1
Branches 17388 17384 -4
==========================================
- Hits 98540 98298 -242
- Misses 26332 26576 +244
+ Partials 872 869 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
abidiff reports its result as a bitmask: 1 ABIDIFF_ERROR, 2 ABIDIFF_USAGE_ERROR, 4 ABIDIFF_ABI_CHANGE, 8 ABIDIFF_ABI_INCOMPATIBLE_CHANGE. The result was tested with `[[ $? -ge 4 ]]`, which reads the status as an ordered severity rather than a bitmask, so exit codes 1, 2 and 3 fell through to `exit 0` and the check passed. A run that never completed was reported as a clean ABI. No non-zero status is a pass, so fail on any of them and name the bits that are set. Exit with abidiff's own status rather than 1, so the bitmask survives into the failed step.
justsmth
force-pushed
the
abidiff-fail-on-tool-error
branch
from
September 14, 2026 12:57
895bc16 to
14d18e2
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.
Context and motivation
diff.shtested abidiff's exit status with[[ $? -ge 4 ]]. That status is a bitmask, not an ordered severity, so exit 1 (ABIDIFF_ERROR) and 2 (ABIDIFF_USAGE_ERROR) fell through toexit 0: a run that never completed was reported as a clean ABI.Description of changes
Capture the status and test the bits. Tool and usage errors now fail with a message on stderr. The ABI-change path (bits 4 and 8) is unchanged, so what the incremental and release checks report today is unaffected.
Testing
Stubbed
abidiffand ran the real script across every documented exit code:Status propagates verbatim, so a failed step keeps abidiff's bitmask rather than flattening to 1. No automated test added, since there is no harness for these container scripts.
shellcheckandbash -nare clean.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.