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

Bug 723278

Summary: fcaps.eclass: sys-libs/libcap dependency should be declared in IDEPEND
Product: Gentoo Linux Reporter: Shiba <shibotto>
Component: EclassesAssignee: Gentoo's Team for Core System packages <base-system>
Severity: normal CC: jlee, mattst88, sam, zmedico
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---
Bug Depends on: 660306    
Bug Blocks:    
Attachments: merge.log

Description Shiba 2020-05-15 19:00:21 UTC
The current situation of RDEPEND/BDEPEND is problematic if you are emerging from binpkgs, as there is no guarantee that sys-libs/libcap will be merged before packages inheriting fcaps.eclass.

I reproduced this by chrooting into a fresh stage3 (stage3-amd64-20200514T210257Z.tar.xz) and updating the system: sys-libs/pam is merged before sys-libs/libcap, thus pkg_postinst() fails.
Comment 1 Shiba 2020-05-15 19:02:04 UTC
Created attachment 639408 [details]
Comment 2 Shiba 2020-05-15 19:03:06 UTC
Created attachment 639410 [details]
Comment 3 Mike Gilbert gentoo-dev 2020-05-15 19:48:02 UTC
Adding it to DEPEND will not help if you are using binpkgs.
Comment 4 Mike Gilbert gentoo-dev 2020-05-15 19:56:49 UTC
In #gentoo-portage, we discussed moving sys-libs/pam from RDEPEND to PDEPEND in sys-lib/libcap to resolve the circular runtime dep and force libcap to be installed first.
Comment 5 Shiba 2020-05-15 21:06:03 UTC
Ouch, you are right, I didn't do my homework. Then I guess I'll look forward to one of the two solutions :)
Comment 6 Larry the Git Cow gentoo-dev 2020-05-17 18:12:32 UTC
The bug has been referenced in the following commit(s):

commit c80be5a22f00558e763c473e572f0c5c22c9870e
Author:     Mike Gilbert <>
AuthorDate: 2020-05-17 18:07:55 +0000
Commit:     Mike Gilbert <>
CommitDate: 2020-05-17 18:11:05 +0000

    sys-libs/libcap: move sys-libs/pam from RDEPEND to PDEPEND
    Fixes install order for binpkgs.
    Signed-off-by: Mike Gilbert <>

 sys-libs/libcap/libcap-2.26-r2.ebuild | 5 +++--
 sys-libs/libcap/libcap-2.27.ebuild    | 5 +++--
 sys-libs/libcap/libcap-2.33.ebuild    | 5 +++--
 sys-libs/libcap/libcap-2.34.ebuild    | 5 +++--
 4 files changed, 12 insertions(+), 8 deletions(-)
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-04-12 04:40:52 UTC
commit 789ec15b80a0ad2902d59be5bdb7c5fa6fcd0092
Author: David Michael <>
Date:   Mon Jun 14 12:00:14 2021 -0400

    fcaps.eclass: support EAPI 8

    This defines the native install-time libcap dependency as:

      - EAPI < 7: RDEPEND
            Only regular ROOT=/ builds can be expected to work.

            Also install the native setcap at built time, so cross-
            compiling will work, but not installing binpkgs in ROOTs.

      - EAPI > 7: IDEPEND
            Install native setcap at install-time; it works everywhere.

    Since all remaining users are EAPI 6 and above, declare eclass
    compatibility with EAPIs 6, 7, and 8.

    Signed-off-by: David Michael <>
    Signed-off-by: Mike Gilbert <>