Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 955595 - sys-libs/binutils-libs: tests silently skipped (in some cases?)
Summary: sys-libs/binutils-libs: tests silently skipped (in some cases?)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-07 21:18 UTC by Sam James
Modified: 2025-05-08 07:35 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-07 21:18:14 UTC
When porting binutils-libs-2.44 to EAPI 8 (to use dot-a.eclass), I noticed src_test seemed to do nothing:
```
 * abi_x86_32.x86: running multilib-minimal_abi_src_test
 * abi_x86_64.amd64: running multilib-minimal_abi_src_test
```

Adding `set -x` and `set +x` into `multilib_src_test`, I get:
```
[...]
+ [[ -n '' ]]
+ [[ -w /var/tmp/portage/sys-libs/binutils-libs-2.44-r1/temp ]]
+ printf '%s\n' 'multilib-minimal_abi_src_test: entering function, parameters: '
+ chgrp portage /var/tmp/portage/sys-libs/binutils-libs-2.44-r1/temp/eclass-debug.log
+ chmod g+w /var/tmp/portage/sys-libs/binutils-libs-2.44-r1/temp/eclass-debug.log
+ pushd /var/tmp/portage/sys-libs/binutils-libs-2.44-r1/work/binutils-2.44-abi_x86_64.amd64
+ declare -f multilib_src_test
+ default_src_test
+ __eapi0_src_test
+ local 'emake_cmd=make --output-sync=line -j32 -l32 '
+ local internal_opts=
+ ___eapi_default_src_test_disables_parallel_jobs
+ [[ 8 =~ ^(0|1|2|3|4)$ ]]
+ make --output-sync=line -j32 -l32 check -n
+ make --output-sync=line -j32 -l32 test -n
+ popd
+ lret=0
+ [[ 0 -eq 0 ]]
+ [[ 0 -ne 0 ]]
+ return 0
+ set +x
```

The default src_test does a check with -n to see if the `check` and also `test` targets exist.

I think in this case, -n vs parallel make doesn't play well. Running it manually in the directory:
```
/var/tmp/portage/sys-libs/binutils-libs-2.44-r1/work/binutils-2.44-abi_x86_64.amd64 # make -j32 -l32 -n check
[...]
/usr/lib/gcc/x86_64-pc-linux-gnu/16/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find testsuite/libsframe.decode/testsuite_libsframe_decode_be_flipping-be-flipping.o: No such file or directory
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:696: testsuite/libsframe.decode/be-flipping] Error 1
make[3]: Leaving directory '/var/tmp/portage/sys-libs/binutils-libs-2.44-r1/work/binutils-2.44-abi_x86_64.amd64/libsframe'
make[2]: *** [Makefile:1345: check-am] Error 2
make[2]: Leaving directory '/var/tmp/portage/sys-libs/binutils-libs-2.44-r1/work/binutils-2.44-abi_x86_64.amd64/libsframe'
make[1]: *** [Makefile:10033: check-libsframe] Error 2
make[1]: Leaving directory '/var/tmp/portage/sys-libs/binutils-libs-2.44-r1/work/binutils-2.44-abi_x86_64.amd64'
make: *** [Makefile:2560: do-check] Error 2
```

Should we pass -j1 in Portage's src_test, or do something else like use -i (see bug 518768)?
Comment 1 Larry the Git Cow gentoo-dev 2025-05-07 21:22:43 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a00c963757178daa0cd775d36f6fa5443516a29b

commit a00c963757178daa0cd775d36f6fa5443516a29b
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2025-05-07 21:21:32 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-05-07 21:22:32 +0000

    sys-libs/binutils-libs: EAPI 8, use dot-a.eclass, fix tests
    
    * Use EAPI 8
    * ... so we can use dot-a.eclass, to not install broken static libraries
      with LTO (bug #924360)
    * Fix tests which were sometimes not running because of broken detection
      (bug #955595)
    
    Bug: https://bugs.gentoo.org/924360
    Bug: https://bugs.gentoo.org/955595
    Signed-off-by: Sam James <sam@gentoo.org>

 .../binutils-libs/binutils-libs-2.44-r1.ebuild     | 233 +++++++++++++++++++++
 sys-libs/binutils-libs/binutils-libs-9999.ebuild   |  23 +-
 2 files changed, 249 insertions(+), 7 deletions(-)
Comment 2 Eli Schwartz gentoo-dev 2025-05-08 07:35:05 UTC
I locally reproduced this with non-parallel make.


make -j1 -n check

/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find testsuite/libsframe.decode/testsuite_libsframe_decode_be_flipping-be-flipping.o: No such file or directory
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:696: testsuite/libsframe.decode/be-flipping] Error 1
make[3]: Leaving directory '/var/tmp/portage/sys-libs/binutils-libs-2.44/work/binutils-2.44-abi_x86_64.amd64/libsframe'
make[2]: *** [Makefile:1345: check-am] Error 2
make[2]: Leaving directory '/var/tmp/portage/sys-libs/binutils-libs-2.44/work/binutils-2.44-abi_x86_64.amd64/libsframe'
make[1]: *** [Makefile:10033: check-libsframe] Error 2
make[1]: Leaving directory '/var/tmp/portage/sys-libs/binutils-libs-2.44/work/binutils-2.44-abi_x86_64.amd64'
make: *** [Makefile:2560: do-check] Error 2


From the Makefile:

        + $(AM_V_CCLD)$(LINK) $(testsuite_libsframe_decode_be_flipping_OBJECTS) $(testsuite_libsframe_decode_be_flipping_LDADD) $(LIBS)



It is caused by this special binutils code:

$ cat config/jobserver.m4
dnl GNU_MAKE_JOBSERVER
dnl
dnl Implement a workaround for GNU mak jobserver by adding the '+' to the
dnl recipe line in Makefiles generated by automake.
dnl
AC_DEFUN([GNU_MAKE_JOBSERVER],[dnl
m4_pattern_allow(AM_V_CCLD)
touch config.status.tmp
dnl Must keep the same timestamps on config.status and Makefile.
if touch --reference=config.status config.status.tmp > /dev/null 2>&1; then
  sed '/as_fn_exit 0/i \
sed -e \"s/^\t\\\(\\\$(AM_V_CCLD)\\\)/\t+ \\\1/\" Makefile > Makefile.tmp \
touch --reference=Makefile Makefile.tmp \
mv Makefile.tmp Makefile \
' config.status > config.status.tmp
  touch --reference=config.status config.status.tmp
  mv config.status.tmp config.status
  chmod +x config.status
  sed -e "s/^\t\(\$(AM_V_CCLD)\)/\t+ \1/" Makefile > Makefile.tmp
  touch --reference=Makefile Makefile.tmp
  mv Makefile.tmp Makefile
else
  rm -f config.status.tmp
fi])