Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 700018

Summary: fcaps.eclass: BDEPEND should be used for EAPI=7
Product: Gentoo Linux Reporter: David Michael <fedora.dm0>
Component: EclassesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: enhancement CC: jstein
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---

Description David Michael 2019-11-13 15:58:28 UTC
Currently fcaps.eclass is EAPI-unaware, so it adds libcap to DEPEND.  The eclass is actually only executing host binaries, so it should instead use BDEPEND when EAPI=7.

I'm filing this as an enhancement request for dependency correctness, but there are also some minor problems that this will fix, like a dependency loop libcap->pam->libcap when installing a sysroot.

Reproducible: Always




The eclass description specifically states that it is only intended to set capabilities, since there is another USE flag for building runtime capability support into the package.  Because of this, I'd expect no users of the eclass should be implicitly using the DEPEND behavior, but I haven't verified this.  It sounds like any such instances would be considered a bug.
Comment 1 David Michael 2019-12-21 17:56:29 UTC
This is the change I am requesting:

--- eclass/fcaps.eclass
+++ eclass/fcaps.eclass
@@ -34,7 +34,8 @@
 IUSE="+filecaps"
 
 # We can't use libcap-ng atm due to #471414.
-DEPEND="filecaps? ( sys-libs/libcap )"
+BDEPEND="filecaps? ( sys-libs/libcap )"
+[[ $EAPI == [4-6] ]] && DEPEND=$BDEPEND
 
 # @ECLASS-VARIABLE: FILECAPS
 # @DEFAULT_UNSET

That uses the range of EAPIs compatible with https://github.com/gentoo/gentoo/pull/13981/commits/376c33acd1678e8e95f726e2b0865e8739e47eec .
Comment 2 Larry the Git Cow gentoo-dev 2020-03-15 18:46:29 UTC
The bug has been closed via the following commit(s):

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

commit 814ab1294edf3565fc02fe63d15d6fa7ca886429
Author:     David Michael <fedora.dm0@gmail.com>
AuthorDate: 2020-03-13 19:21:47 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2020-03-15 18:45:57 +0000

    fcaps.eclass: use BDEPEND for EAPI 7
    
    The eclass installs libcap to execute the setcap program, so it
    must be installed in /.  Optional libcap linking is handled by the
    USE=caps flag, which is unrelated to this eclass, so the DEPEND
    declaration is not needed on EAPI 7.
    
    Closes: https://bugs.gentoo.org/700018
    Signed-off-by: David Michael <fedora.dm0@gmail.com>
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 eclass/fcaps.eclass | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)