On 03/07/2025 13:28, Andriy Gapon wrote:
# /bin/sh /usr/ports/Mk/Scripts/check_have_symbols.sh /wrkdirs/usr/ports/
multimedia/ffmpeg/work/stage /usr/local/lib/libavcodec.so
+ set -eu
+ set -o pipefail
+ STAGEDIR=/wrkdirs/usr/ports/multimedia/ffmpeg/work/stage
+ shift
+ ret=0
+ failed=''
+ /usr/bin/readelf -V /wrkdirs/usr/ports/multimedia/ffmpeg/work/stage/usr/local/
lib/libavcodec.so
+ awk 'BEGIN { ret=1 } $10 == "Name:" || $10 == "vda_name:" { ret=0; exit 0 }
END { exit ret }'
+ [ '' '!=' '' ]
+ exit 0
Does anyone have any idea what could be going on here?
It seems like perhaps some sort of a race but what could it be?
After having asked this (and used you all as a "rubber duck") I've immediately
noticed something suspicious.
I think that `set -o pipefail` is not only unneeded in this script, it is
actually harmful.
The awk command, the last one in the pipeline would correctly set the status for
the whole pipeline without pipefail.
But with pipefail and an early exit of awk, readelf may exit with an error
because of SIGPIPE.
And I think that chances of that happening are higher when the system is busier
which is the case for a bulk build in comparison with a single port build.
Should I open a PR about this?
Or this email report is sufficient?
--
Andriy Gapon