app-text/opensp-1.5.2-r7 has net-libs/libnsl:0 in RDEPEND. However, the configure script properly detect the absence of the library and do not try to link against it when not present. Reproducible: Always Steps to Reproduce: 1. Use a system without libnsl installed and / or without any NIS support 2. Build and use opensp 3. Actual Results: Refuses to build when libnsl is not present Expected Results: Should not block build on libnsl absence --- app-text/opensp/opensp-1.5.2-r7.ebuild 2022-02-27 05:09:47.000000000 +0100 +++ app-text/opensp/opensp-1.5.2-r7.ebuild 2022-04-22 20:46:49.778429482 +0200 @@ -18,8 +18,6 @@ IUSE="doc nls static-libs test" RESTRICT="!test? ( test )" -RDEPEND="elibc_glibc? ( net-libs/libnsl:0= )" -DEPEND="${RDEPEND}" BDEPEND=" doc? ( app-text/xmlto
Created attachment 824495 [details] output from emerge --info =app-text/opensp-1.5.2-r7
The provided patch is insufficient. In the situation you described ("used when present), we call it an "automagic dependency" and we must either fix the build system or hard depend on the package to avoid breaking e.g binpkgs.
Sorry, I'm not sure to understand properly what you mean... Would an additional USE flag and add the dependency on this flag to fix the issue you mention ? After further investigation, I guess the configure script has some kind of problem: when libnsl, ie /usr/lib64/libnsl.so is not present, it uses /lib64/libnsl.so.1 provided by glibc. As far as I understand from the package description, libnsl is used to provide IPv6 support to NIS. Then, would an ipv6 USE flag addition would be a proper fix to add the libnsl dependency when needed ?
(In reply to Jocelyn Mayer from comment #3) > Sorry, I'm not sure to understand properly what you mean... Give these a read: - https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Automagic_dependencies - https://flameeyes.blog/2010/07/01/ever-present-automagic-dependencies/ > Would an additional USE flag and add the dependency on this flag to fix the > issue you mention ? Yes -- the key part is that the USE flag has to pass something into the build system though. > After further investigation, I guess the configure script has some kind of > problem: when libnsl, ie /usr/lib64/libnsl.so is not present, it uses > /lib64/libnsl.so.1 provided by glibc. That's another issue, although not so much of a problem given we only support modern glibcs now. > As far as I understand from the package description, libnsl is used to > provide IPv6 support to NIS. > Then, would an ipv6 USE flag addition would be a proper fix to add the > libnsl dependency when needed ? Yes - but with a patch to ensure the build system allows you to turn it off _even when libnsl is installed_ (as it may not be installed on a binpkg consumer, it could be installed purely by chance) - see above links, then let me know if have any questions.
also, thanks for filing all these, they are valuable and trying to trim down the NIS stuff is particularly useful as a lot of it is cruft
(In reply to Sam James from comment #5) > also, thanks for filing all these, they are valuable and trying to trim down > the NIS stuff is particularly useful as a lot of it is cruft .. one more thing: you might find "iwdevtools" useful for finding deps which should in fact be optional and so on: https://github.com/ionenwks/iwdevtools.
Thanks for those clarifications, I'll try to take care of this for now. And, yes, it seems that the iwdevtools may help me to solve such problems. For this particuliar case, it seems to me now that the configure system is quite broken: we have an optional --enable-http for the configure script though http support is not optional: the sources files referencing HTTP are compiled inconditionnaly, ie URLStorage.cxx and URLStorageMessages.h in lib/Makefile.am Furtermore, on a system which has libnsl installed, it happens not to be used by opensp: # ldd -d -r -u /usr/bin/osp* /usr/bin/ospam: Unused direct dependencies: /usr/lib64/libnsl.so.3 /lib64/libm.so.6 /usr/bin/ospcat: Unused direct dependencies: /usr/lib64/libnsl.so.3 /lib64/libm.so.6 /usr/bin/ospent: Unused direct dependencies: /usr/lib64/libnsl.so.3 /lib64/libm.so.6 # ldd -d -r -u /usr/bin/osgmlnorm Unused direct dependencies: /usr/lib64/libnsl.so.3 /lib64/libm.so.6 # ldd -d -r -u /usr/bin/onsgmls Unused direct dependencies: /usr/lib64/libnsl.so.3 /lib64/libm.so.6 # ldd -d -r -u /usr/bin/osx Unused direct dependencies: /usr/lib64/libnsl.so.3 /lib64/libm.so.6 # ldd -d -r -u /usr/lib64/libosp.so Unused direct dependencies: /usr/lib64/libnsl.so.3 /lib64/libm.so.6 And the only non-system library used (ie not glibc, libm, gcc libs, ...), ie libtirpc, is a libnsl dependency so there seem not to be indirect dependencies either. I also did not find any reference to NIS in the code. Then, I guess it's possible to remove: 1/ the --enable-http option as http support is always compiled 2/ the libnsl presence check from the configure script 3/ the libnsl dependency from the ebuild 4/ the --enable-http option given to econf 5/ always call eautoreconf during prepare phase Unfortunately, autoreconf seems to break the tests/Makefile thus some kind of hack seems required during prepare phase so the tests run fine on a system without libnsl and on a system with it, with finally no link dependency on this library in the later case: I've been able to depclean it (and mask it for the future). Hope this will make the trick...
Created attachment 824725 [details] output from emerge --info =app-text/opensp-1.5.2-r7 Built with new patches on a system without libnsl installed
Created attachment 824727 [details] output from emerge --info =app-text/opensp-1.5.2-r7 built with new patches on a system with libnsl installed, without using this library at last.
Created attachment 824729 [details, diff] Ebuild patch to remove unused libnsl dependency
Created attachment 824731 [details, diff] Source code patch to remove unused libnsl dependency
Ooops... Reviewing my patches, the comment for the later ones are incorrect. The purpose here is to remove --enable-http option as http is used unconditionally in lib/URLStorage.cxx