| Summary: | Mk/Scripts/qa.sh: Spurious SONAME warnings due to pipefail | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Ports & Packages | Reporter: | Henrik Gulbrandsen <henrik> | ||||
| Component: | Ports Framework | Assignee: | Port Management Team <portmgr> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Some People | CC: | ports-bugs, tatsuki_makino | ||||
| Priority: | --- | Keywords: | needs-qa, regression | ||||
| Version: | Latest | Flags: | koobs:
merge-quarterly?
|
||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| URL: | https://reviews.freebsd.org/D31211 | ||||||
| See Also: |
https://reviews.freebsd.org/D31211 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=167009 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258972 |
||||||
| Attachments: |
|
||||||
|
Description
Henrik Gulbrandsen
2021-10-08 13:07:38 UTC
Good morning, I sent an email yesterday, but it already existed. :)
audio/audacity will step on this issue.
If we can ignore the cost of launching a grep process, I can only think of double grep.
readelf -d ${dep_file} | grep SONAME | grep -q SONAME
readelf -d /usr/local/lib/libwx_gtk3u_core-3.1.so.5.0.0 | grep -q SONAME is not reproduced every time for some reason. sync ; readelf -d /usr/local/lib/libwx_gtk3u_core-3.1.so.5.0.0 | grep -q SONAME increases the rate of reproduction. readelf -d /usr/local/lib/libwx_gtk3u_core-3.1.so.5.0.0 | stdbuf -i 0 grep -q SONAME seems to be one of the workarounds. This appears to be the the same issue as bug 259005 ? Ugh, I mean bug 258972 (In reply to Kubilay Kocak from comment #4) Maybe not. I'm on 12.2-STABLE and can't get bug 258972 to occur. This is due to the fact that grep -q only reads stdin up to the line it matches. And... stdbuf -i 0 is also not a workaround. We may have to discard unnecessary output to /dev/null to get exit code 0. readelf -d "${dep_file}" | grep SONAME > /dev/null Nah, bug 258972 is something else. It only occurs on 14-CURRENT, and the qa.sh script uses ldd for the library list, so if anything I would guess it's related to bug 259069. I don't have a 14-CURRENT system to test on, but the ldd output must have changed so it's incompatible with the qa.sh awk expression. "... | grep SONAME > /dev/null" should work, but there is a risk that someone will come along and try to optimize it back to "... | grep -q SONAME", which is why I used "set +o pipefail" instead. It is a bit more self-documenting. I did test the stdbuf solution (I have a test which reproduce the issue all the time) and stdbuf does not help here Note the specific case has been fixed in the tree! Thank you for reporting and proposing a patch! (In reply to Baptiste Daroussin from comment #8) Maybe the specific case, but what about the general case? Aren't you worried about the second instance of "readelf -d ... | grep -q SONAME" in the script? My patch handled both lines, but commit 6ff48ecff only patched the first one. |