>>> libwhich: Building testing/libwhich 1.2.0-r0 (using abuild 3.13.0-r5) started Sun, 22 Sep 2024 05:32:02 +0000 >>> libwhich: Checking sanity of /home/buildozer/aports/testing/libwhich/APKBUILD... >>> libwhich: Analyzing dependencies... >>> libwhich: Installing for build: build-base sed zlib-dev (1/3) Installing sed (4.9-r2) (2/3) Installing zlib-dev (1.3.1-r2) (3/3) Installing .makedepends-libwhich (20240922.053212) Executing busybox-1.36.1-r32.trigger OK: 251 MiB in 106 packages >>> libwhich: Cleaning up srcdir >>> libwhich: Cleaning up pkgdir >>> libwhich: Cleaning up tmpdir >>> libwhich: Fetching https://distfiles.alpinelinux.org/distfiles/edge/libwhich-1.2.0.tar.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (22) The requested URL returned error: 404 >>> libwhich: Fetching https://github.com/vtjnash/libwhich/archive/v1.2.0/libwhich-1.2.0.tar.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 7681 0 7681 0 0 18345 0 --:--:-- --:--:-- --:--:-- 18345 >>> libwhich: Fetching https://distfiles.alpinelinux.org/distfiles/edge/libwhich-1.2.0.tar.gz >>> libwhich: Checking sha512sums... libwhich-1.2.0.tar.gz: OK >>> libwhich: Unpacking /var/cache/distfiles/libwhich-1.2.0.tar.gz... gcc -std=gnu99 -D_GNU_SOURCE -Wall -pedantic -O2 -Os -fstack-clash-protection -Wformat -Werror=format-security -c -o libwhich.o libwhich.c gcc libwhich.o -o libwhich -ldl -Wl,--as-needed,-O1,--sort-common ./test-libwhich.sh # set pipefail, if possible (running in bash), for additional error detection (set -o pipefail) 2>/dev/null && set -o pipefail dotest() { "$@"; } echo() { `which echo` "$@"; } ## tests for failures ## S=`dotest $LIBWHICH` [ $? -eq 1 ] || exit 1 echo RESULT: $S RESULT: expected 1 argument specifying library to open (got 0) [ "$S" = "expected 1 argument specifying library to open (got 0)" ] || exit 1 S=`dotest $LIBWHICH '' 2` [ $? -eq 1 ] || exit 1 echo RESULT: $S RESULT: expected first argument to specify an output option: -p library path -a all dependencies -d direct dependencies [ "$S" = "expected first argument to specify an output option: -p library path -a all dependencies -d direct dependencies" ] || exit 1 S=`dotest $LIBWHICH 1 2\ 3 '4 5'` [ $? -eq 1 ] || exit 1 echo RESULT: $S RESULT: expected 1 argument specifying library to open (got 3) [ "$S" = "expected 1 argument specifying library to open (got 3)" ] || exit 1 S=`dotest $LIBWHICH not_a_library` [ $? -eq 1 ] || exit 1 echo RESULT: $S RESULT: failed to open library: Error loading shared library not_a_library: No such file or directory S1=`echo $S | $SED -e 's!^failed to open library: .*\.*$!ok!'` echo "$S1" ok [ "$S1" = "ok" ] || exit 1 ## tests for successes ## set -e # exit on error ### tests for script usages ### dotest $LIBWHICH -a libz.$SHEXT | $XARGS -0 echo > /dev/null # make sure the files are valid (suppress stdout) S=`dotest $LIBWHICH -p libz.$SHEXT` echo RESULT: $S RESULT: /usr/lib/libz.so [ -n "$S" ] || exit 1 S=$(dotest $LIBWHICH -a libz.$SHEXT | $GREP -aF "$S") # make sure -p appears in the -a list echo RESULT: $S RESULT: /usr/lib/libz.so [ -n "$S" ] || exit 1 S=`dotest $LIBWHICH -a libz.$SHEXT | $SED -e 's/^[^\\/]*\x00//' | $SED -e 's/\x00.*//'` # get an existing (the first real) shared library path echo RESULT: $S RESULT: /lib/ld-musl-loongarch64.so.1 [ -n "$S" ] || exit 1 if [ "$TARGET" = "Darwin" ]; then [ "$S" = "/usr/lib/libSystem.B.dylib" ] || exit 1 else $STAT "$S" fi File: /lib/ld-musl-loongarch64.so.1 Size: 723400 Blocks: 1416 IO Block: 4096 regular file Device: 800h/2048d Inode: 34078748 Links: 1 Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2024-09-21 14:00:00.035131465 +0000 Modify: 2024-08-09 01:33:22.000000000 +0000 Change: 2024-08-13 13:38:00.729506234 +0000 LIB=$S # save it for later usage S=`dotest $LIBWHICH -p "$LIB"` # test for identity echo RESULT: $S RESULT: /lib/ld-musl-loongarch64.so.1 [ "$S" = "$LIB" ] || exit 1 S=`dotest $LIBWHICH -a "$LIB" | ${XARGS} -0 echo` # use xargs echo to turn \0 into spaces echo RESULT: "$S" RESULT: /lib/ld-musl-loongarch64.so.1 [ -n "$S" ] || exit 1 S=`dotest $LIBWHICH -d "$LIB" | ${XARGS} -0 echo` # check that it didn't load anything else echo RESULT: $S RESULT: [ -z "$S" ] || exit 1 ### tests for command line ### S=`dotest $LIBWHICH "$LIB"` echo RESULT: $S RESULT: library: /lib/ld-musl-loongarch64.so.1 dependencies: /lib/ld-musl-loongarch64.so.1 S1a=`! echo "$S" | $GREP '^+'` # see that we didn't get a line starting with + [ $? -eq 0 ] || exit 1 [ -z "$S1a" ] || exit 1 if [ "$TARGET" = "WINNT" ]; then S1b=`echo "$S" | $GREP '^ [A-Za-z]:\\\\'` else S1b=`echo "$S" | $GREP '^ /'` fi [ -n "$S1b" ] || exit 1 # see that we did get an absolute path if [ "$TARGET" = "WINNT" ]; then S2=`echo $S | $SED -e 's!^library: [A-Za-z]:\\\\[^ ]\+ dependencies: [A-Za-z]:\\\\.*!ok!'` else S2=`echo $S | $SED -e 's!^library: [^ ]\+ dependencies: .*$!ok!'` fi [ "$S2" = "ok" ] || exit 1 # see that the general format is as expected S=`dotest $LIBWHICH libz.$SHEXT` echo RESULT: $S RESULT: library: /usr/lib/libz.so dependencies: /lib/ld-musl-loongarch64.so.1 + /usr/lib/libz.so S1a=`echo "$S" | $GREP '^+'` if [ "$TARGET" = "WINNT" ]; then S1b=`echo "$S" | $GREP '^+ [A-Za-z]:\\\\.*\(libz\|msvcrt\).*'` else S1b=`echo "$S" | $GREP '^+ /.*libz.*'` fi [ -n "$S1a" ] || exit 1 # see that we did get a path starting with +, [ "$S1a" = "$S1b" ] || exit 1 # and that it's an absolute path to libz (or dependency) if [ "$TARGET" = "WINNT" ]; then S2=`echo $S | $SED -e 's!^library: [A-Za-z]:\\\\[^ ]*libz[^ ]* dependencies: [A-Za-z]:\\\\.*libz.*$!ok!'` else S2=`echo $S | $SED -e 's!^library: /[^ ]*libz[^ ]* dependencies: .*libz.*$!ok!'` fi [ "$S2" = "ok" ] || exit 1 # see the general format is as expected ## finished successfully ## echo "SUCCESS" SUCCESS >>> libwhich: Entering fakeroot... mkdir -p /home/buildozer/aports/testing/libwhich/pkg/libwhich/usr/bin install -m755 libwhich /home/buildozer/aports/testing/libwhich/pkg/libwhich/usr/bin/libwhich >>> libwhich*: Running postcheck for libwhich >>> libwhich*: Preparing package libwhich... >>> libwhich*: Stripping binaries >>> libwhich*: Scanning shared objects >>> libwhich*: Tracing dependencies... so:libc.musl-loongarch64.so.1 >>> libwhich*: Package size: 32.0 KB >>> libwhich*: Compressing data... >>> libwhich*: Create checksum... >>> libwhich*: Create libwhich-1.2.0-r0.apk >>> libwhich: Build complete at Sun, 22 Sep 2024 05:32:13 +0000 elapsed time 0h 0m 11s >>> libwhich: Cleaning up srcdir >>> libwhich: Cleaning up pkgdir >>> libwhich: Uninstalling dependencies... (1/3) Purging .makedepends-libwhich (20240922.053212) (2/3) Purging sed (4.9-r2) Executing sed-4.9-r2.post-deinstall (3/3) Purging zlib-dev (1.3.1-r2) Executing busybox-1.36.1-r32.trigger OK: 251 MiB in 103 packages >>> libwhich: Updating the testing/loongarch64 repository index... >>> libwhich: Signing the index...