For reasons, I have a local patch that adds HAS_SYMBOL_VERSION check to
multimedia/ffmpeg.
For simplicity I picked a single library to get checked:
HAS_SYMBOL_VERSION= ${PREFIX}/lib/libavcodec.so
This works well if I build _just_ ffmpeg with poudriere.
However, it arbitrarily fails when I am doing a large build of which ffmpeg is a
part.
I even added 'set -x' to Mk/Scripts/check_have_symbols.sh to try to catch the
problem but it didn't help much:
/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 }'
+ ret=1
+ failed=' /usr/local/lib/libavcodec.so'
+ [ ' /usr/local/lib/libavcodec.so' '!=' '' ]
+ echo $'the following libraries are supposed to have symbols versioning but
they don\'t'
the following libraries are supposed to have symbols versioning but they don't
+ echo '- /usr/local/lib/libavcodec.so'
- /usr/local/lib/libavcodec.so
+ exit 1
*** Error code 1
What's strange is that if I unpack the working directory (I have poudriere
configured to save a working directory on a build failure) then the library in
the stage directory does have symbol versions and passes the awk check:
$ tar xf ffmpeg-6.1.2_15,1.tbz
$ ls -l work/stage/usr/local/lib/libavcodec.so*
lrwxr-xr-x 1 nobody wheel 23 3 Jul 10:26
work/stage/usr/local/lib/libavcodec.so -> libavcodec.so.60.31.102
lrwxr-xr-x 1 nobody wheel 23 3 Jul 10:26
work/stage/usr/local/lib/libavcodec.so.60 -> libavcodec.so.60.31.102
-rwxr-xr-x 1 nobody wheel 17294192 3 Jul 10:26
work/stage/usr/local/lib/libavcodec.so.60.31.102
$ /usr/bin/readelf -V work/stage/usr/local/lib/libavcodec.so | awk 'BEGIN {
ret=1 } $10 == "Name:" || $10 == "vda_name:" { print $0 }'
0x0000: Rev: 1 Flags: BASE Index: 1 Cnt: 1 Name: libavcodec.so.60
0x001c: Rev: 1 Flags: none Index: 2 Cnt: 1 Name: LIBAVCODEC_60
$ /usr/bin/readelf -V work/stage/usr/local/lib/libavcodec.so | awk 'BEGIN {
ret=1 } $10 == "Name:" || $10 == "vda_name:" { ret=0; exit 0 } END { exit ret }'
$ echo $?
0
Also, if I manually start the jail and extract the workdir there and then run
the script, then it succeeds:
# cd /wrkdirs/
# tar xf ffmpeg-6.1.2_15,1.tbz
# mkdir -p usr/ports/multimedia/ffmpeg
# mv work/ usr/ports/multimedia/ffmpeg
# /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?
--
Andriy Gapon