multi-arch-test-build: grep version output even on non-zero exit#112
Merged
dangowrt merged 1 commit intoMay 12, 2026
Merged
Conversation
Many tools (e.g. unbound-host) print their version as part of a usage blob that is dumped on stderr when an unrecognized flag is given, and exit non-zero. The 2>&1 in the version probe captures that text, but the trailing `|| continue` discarded it before grep could see it, producing spurious "No executables in the package provided version" failures. unbound-host has no flag that returns 0 from the probe loop -- every candidate flag (including -h) errors out -- so the test never matched even though "Version 1.24.2" was sitting right there in the captured output. Switch the suppressor to `|| true` so set -o errexit stays satisfied while letting the grep below decide whether the version was found. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Failed checksIssues marked with an ❌ are failing checks. Commit c35cfe6
For more details, see the full job log. Something broken? Consider providing feedback. |
Member
|
I only tested that For some reason I thought |
1 task
|
This apparently causes problems for executable scripts that are an OpenWrt add-on to a package: See openwrt/packages#29390 (comment) https://github.com/openwrt/packages/actions/runs/25605546906/job/75183164135?pr=29390#step:17:5157 |
Member
|
This can be merged, right? |
|
The issues in my comment above were probably caused by something else, so from my point of view, yes. |
1 task
1 task
Member
|
@dangowrt Can you please merge your PR? :) |
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 version probe in
check_exec()runs each candidate flag through:The
2>&1is there precisely so the help/usage blob a tool dumps when given an unrecognized flag — which often contains the version — gets captured and grepped. But the|| continuethrows that captured output away whenever the command exits non-zero, so the grep never gets to see it.unbound-hostis a clean example. It has no flag in the probe list that exits 0:Version 1.24.2matches$PKG_VERSIONexactly and is sitting in the captured$output, but the non-zero exit means|| continuefires before grep runs. Every flag in the loop hits the same fate — even-h, whichunbound-hosttreats identically to any other "unknown" option and exits non-zero on. The result is a spurious:The fix: switch the errexit-suppressor to
|| trueso the grep below decides whether the version was found, instead of pre-filtering on exit status.set -o errexit(line 6) is still satisfied;set -o pipefailis explicitly off, so the subsequentif echo … | grep …is unaffected.