Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 755173 - sys-apps/policycoreutils-3.1: dependency loop with EAPI 7
Summary: sys-apps/policycoreutils-3.1: dependency loop with EAPI 7
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: SE Linux Bugs
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2020-11-17 22:57 UTC by David Michael
Modified: 2020-11-21 23:44 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 David Michael 2020-11-17 22:57:02 UTC
The EAPI 7 ebuild has gettext in DEPEND, which causes it to be cross-compiled.  A quick glance at the source shows it only being called natively, so it should be in BDEPEND.  (The compile-time use of the gettext function is handled by glibc/libintl.)

This results in a dependency loop: policycoreutils -> gettext[git] -> git[gpg] -> gnupg[selinux] -> selinux-gpg -> policycoreutils

Reproducible: Always

Steps to Reproduce:
1. USE='git gpg selinux' cross-emerge -v policycoreutils

Actual Results:  
 * Error: circular dependencies:
(app-crypt/gnupg-2.2.20-r1:0/0::gentoo, ebuild scheduled for merge to '/usr/x86_64-gentoo-linux-gnu/') depends on
 (sec-policy/selinux-gpg-2.20200818-r1:0/0::gentoo, ebuild scheduled for merge to '/usr/x86_64-gentoo-linux-gnu/') (runtime)
  (sys-apps/policycoreutils-3.1:0/0::gentoo, ebuild scheduled for merge to '/usr/x86_64-gentoo-linux-gnu/') (runtime)
   (sys-devel/gettext-0.21:0/0::gentoo, ebuild scheduled for merge to '/usr/x86_64-gentoo-linux-gnu/') (buildtime)
    (dev-vcs/git-2.26.2:0/0::gentoo, ebuild scheduled for merge to '/usr/x86_64-gentoo-linux-gnu/') (runtime)
     (app-crypt/gnupg-2.2.20-r1:0/0::gentoo, ebuild scheduled for merge to '/usr/x86_64-gentoo-linux-gnu/') (runtime)

Expected Results:  
It should build and install.

This fixes it:

--- sys-apps/policycoreutils/policycoreutils-3.1.ebuild
+++ sys-apps/policycoreutils/policycoreutils-3.1.ebuild
@@ -46,7 +46,6 @@
 	sys-libs/libcap-ng:=
 	>=sys-libs/libsepol-${SEPOL_VER}:=
 	>=app-admin/setools-4.2.0[${PYTHON_USEDEP}]
-	sys-devel/gettext
 	dev-python/ipy[${PYTHON_USEDEP}]
 	dbus? (
 		sys-apps/dbus
@@ -56,6 +55,8 @@
 	pam? ( sys-libs/pam:= )
 	${PYTHON_DEPS}"
 
+BDEPEND="sys-devel/gettext"
+
 ### libcgroup -> seunshare
 ### dbus -> restorecond
Comment 1 Larry the Git Cow gentoo-dev 2020-11-17 23:15:11 UTC
The bug has been referenced in the following commit(s):

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

commit d0abc6b027871117148901f3fe3f532fc4475f4e
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2020-11-17 23:15:01 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2020-11-17 23:15:01 +0000

    sys-apps/policycoreutils: shift gettext to BDEPEND in 3.1
    
    perfinion is going to review 9999 later for any other
    possible fixes, so not closing the bug yet.
    
    Acked-by: Jason Zaman <perfinion@gentoo.org>
    Bug: https://bugs.gentoo.org/755173
    Package-Manager: Portage-3.0.9, Repoman-3.0.2
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/policycoreutils/policycoreutils-3.1.ebuild | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Comment 2 David Michael 2020-11-17 23:26:50 UTC
I think perfinion was referring to the live ebuilds for bug #753251 and bug #753254, not this one, but yes this change should be made to -9999 as well since that's EAPI 7, too.

Also, I don't think the comment is necessary since that makes it sound like a workaround when it's not.  It's just the correct way to declare dependencies on native tools.  But either way, it's working now, thanks.
Comment 3 Jason Zaman gentoo-dev 2020-11-21 23:44:04 UTC
Thanks Sam for taking care of this!

>     perfinion is going to review 9999 later for any other
>     possible fixes, so not closing the bug yet.

Sam did this live ebuild in 786c8c9d7f05f453634b4ef1d4230e7270af0583
and I took care of libselinux/libsemanage's live ebuilds in
8353a4e7d519f0ef13004f1081bd2f2f1bcc5cdc and 
7e629b5a97b02d2d3427f69d76b1ee5f5e2d5766