public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 1/2] acct-group.eclass: declare the missing dependency on shadow
@ 2020-09-08 15:57 David Michael
  2020-09-08 16:04 ` Michał Górny
  2020-09-08 19:54 ` [gentoo-dev] " David Michael
  0 siblings, 2 replies; 7+ messages in thread
From: David Michael @ 2020-09-08 15:57 UTC (permalink / raw
  To: gentoo-dev; +Cc: floppym

Signed-off-by: David Michael <fedora.dm0@gmail.com>
---
 eclass/acct-group.eclass | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/eclass/acct-group.eclass b/eclass/acct-group.eclass
index 19a378e0b06..56e6391ef42 100644
--- a/eclass/acct-group.eclass
+++ b/eclass/acct-group.eclass
@@ -34,8 +34,12 @@
 if [[ -z ${_ACCT_GROUP_ECLASS} ]]; then
 _ACCT_GROUP_ECLASS=1
 
+# The groupadd utility is called in pkg_preinst.  It should be in IDEPEND.
 case ${EAPI:-0} in
-	7) ;;
+	7)
+		BDEPEND="userland_GNU? ( sys-apps/shadow )"
+		RDEPEND="${BDEPEND}"
+	;;
 	*) die "EAPI=${EAPI:-0} not supported";;
 esac
 
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] [PATCH 1/2] acct-group.eclass: declare the missing dependency on shadow
  2020-09-08 15:57 [gentoo-dev] [PATCH 1/2] acct-group.eclass: declare the missing dependency on shadow David Michael
@ 2020-09-08 16:04 ` Michał Górny
  2020-09-08 16:10   ` David Michael
  2020-09-08 19:54 ` [gentoo-dev] " David Michael
  1 sibling, 1 reply; 7+ messages in thread
From: Michał Górny @ 2020-09-08 16:04 UTC (permalink / raw
  To: gentoo-dev; +Cc: floppym

[-- Attachment #1: Type: text/plain, Size: 875 bytes --]

On Tue, 2020-09-08 at 11:57 -0400, David Michael wrote:
> Signed-off-by: David Michael <fedora.dm0@gmail.com>
> ---
>  eclass/acct-group.eclass | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/eclass/acct-group.eclass b/eclass/acct-group.eclass
> index 19a378e0b06..56e6391ef42 100644
> --- a/eclass/acct-group.eclass
> +++ b/eclass/acct-group.eclass
> @@ -34,8 +34,12 @@
>  if [[ -z ${_ACCT_GROUP_ECLASS} ]]; then
>  _ACCT_GROUP_ECLASS=1
>  
> +# The groupadd utility is called in pkg_preinst.  It should be in IDEPEND.
>  case ${EAPI:-0} in
> -	7) ;;
> +	7)
> +		BDEPEND="userland_GNU? ( sys-apps/shadow )"

Nothing from shadow is used in src_install, so this BDEPEND is
unnecessary.

> +		RDEPEND="${BDEPEND}"
> +	;;
>  	*) die "EAPI=${EAPI:-0} not supported";;
>  esac
>  

-- 
Best regards,
Michał Górny


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 618 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] [PATCH 1/2] acct-group.eclass: declare the missing dependency on shadow
  2020-09-08 16:04 ` Michał Górny
@ 2020-09-08 16:10   ` David Michael
  0 siblings, 0 replies; 7+ messages in thread
From: David Michael @ 2020-09-08 16:10 UTC (permalink / raw
  To: gentoo-dev; +Cc: floppym

On Tue, Sep 8, 2020 at 12:04 PM Michał Górny <mgorny@gentoo.org> wrote:
> On Tue, 2020-09-08 at 11:57 -0400, David Michael wrote:
> > Signed-off-by: David Michael <fedora.dm0@gmail.com>
> > ---
> >  eclass/acct-group.eclass | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/eclass/acct-group.eclass b/eclass/acct-group.eclass
> > index 19a378e0b06..56e6391ef42 100644
> > --- a/eclass/acct-group.eclass
> > +++ b/eclass/acct-group.eclass
> > @@ -34,8 +34,12 @@
> >  if [[ -z ${_ACCT_GROUP_ECLASS} ]]; then
> >  _ACCT_GROUP_ECLASS=1
> >
> > +# The groupadd utility is called in pkg_preinst.  It should be in IDEPEND.
> >  case ${EAPI:-0} in
> > -     7) ;;
> > +     7)
> > +             BDEPEND="userland_GNU? ( sys-apps/shadow )"
>
> Nothing from shadow is used in src_install, so this BDEPEND is
> unnecessary.

It is a workaround for EAPI 7's lack of IDEPEND to attempt to handle
cross-compiling, where RDEPEND alone would never attempt to install
the package in the native root.  Other packages and eclasses have been
using this convention for the same reason (Emacs, fcaps.eclass, etc.).

Thanks.

David


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [gentoo-dev] Re: [PATCH 1/2] acct-group.eclass: declare the missing dependency on shadow
  2020-09-08 15:57 [gentoo-dev] [PATCH 1/2] acct-group.eclass: declare the missing dependency on shadow David Michael
  2020-09-08 16:04 ` Michał Górny
@ 2020-09-08 19:54 ` David Michael
  2020-09-09  9:36   ` Alexis Ballier
  1 sibling, 1 reply; 7+ messages in thread
From: David Michael @ 2020-09-08 19:54 UTC (permalink / raw
  To: gentoo-dev

Hi,

This fix might not be so straightforward.  A configuration I tested
hit a dependency loop with shadow -> pambase -> systemd -> a bunch of
groups -> shadow.  It is possible to bootstrap around by emerging
shadow with no USE flags first, but I don't know how acceptable it is
to introduce new dep loops like this.

Thanks.

David


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] Re: [PATCH 1/2] acct-group.eclass: declare the missing dependency on shadow
  2020-09-08 19:54 ` [gentoo-dev] " David Michael
@ 2020-09-09  9:36   ` Alexis Ballier
  2020-09-09 13:48     ` David Michael
  0 siblings, 1 reply; 7+ messages in thread
From: Alexis Ballier @ 2020-09-09  9:36 UTC (permalink / raw
  To: gentoo-dev

On Tue, 8 Sep 2020 15:54:14 -0400
David Michael <fedora.dm0@gmail.com> wrote:

> Hi,
> 
> This fix might not be so straightforward.  A configuration I tested
> hit a dependency loop with shadow -> pambase -> systemd -> a bunch of
> groups -> shadow.  It is possible to bootstrap around by emerging
> shadow with no USE flags first, but I don't know how acceptable it is
> to introduce new dep loops like this.


what happens without your change ?

my understanding is that this will be merged in that order:

1. a bunch of groups
2. systemd
3. pambase
4. shadow


in which case, the groups from 1. will fail if shadow is not present at
that point


PS: we have the 'build' useflag for this when building stage1's


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] Re: [PATCH 1/2] acct-group.eclass: declare the missing dependency on shadow
  2020-09-09  9:36   ` Alexis Ballier
@ 2020-09-09 13:48     ` David Michael
  2020-09-09 14:07       ` Alexis Ballier
  0 siblings, 1 reply; 7+ messages in thread
From: David Michael @ 2020-09-09 13:48 UTC (permalink / raw
  To: gentoo-dev

On Wed, Sep 9, 2020 at 5:37 AM Alexis Ballier <aballier@gentoo.org> wrote:
> On Tue, 8 Sep 2020 15:54:14 -0400
> David Michael <fedora.dm0@gmail.com> wrote:
>
> > Hi,
> >
> > This fix might not be so straightforward.  A configuration I tested
> > hit a dependency loop with shadow -> pambase -> systemd -> a bunch of
> > groups -> shadow.  It is possible to bootstrap around by emerging
> > shadow with no USE flags first, but I don't know how acceptable it is
> > to introduce new dep loops like this.
>
> what happens without your change ?

Someone reported an issue in https://bugs.gentoo.org/720948 that
showed shadow and groups are not ordered during installation.  I am
not sure what environment produced those symptoms since I never
encountered it, but you can rage-clean shadow and a group, delete the
group, then reinstall it to reproduce the problem.

Thanks.

David


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] Re: [PATCH 1/2] acct-group.eclass: declare the missing dependency on shadow
  2020-09-09 13:48     ` David Michael
@ 2020-09-09 14:07       ` Alexis Ballier
  0 siblings, 0 replies; 7+ messages in thread
From: Alexis Ballier @ 2020-09-09 14:07 UTC (permalink / raw
  To: gentoo-dev

On Wed, 9 Sep 2020 09:48:04 -0400
David Michael <fedora.dm0@gmail.com> wrote:

> On Wed, Sep 9, 2020 at 5:37 AM Alexis Ballier <aballier@gentoo.org>
> wrote:
> > On Tue, 8 Sep 2020 15:54:14 -0400
> > David Michael <fedora.dm0@gmail.com> wrote:
> >
> > > Hi,
> > >
> > > This fix might not be so straightforward.  A configuration I
> > > tested hit a dependency loop with shadow -> pambase -> systemd ->
> > > a bunch of groups -> shadow.  It is possible to bootstrap around
> > > by emerging shadow with no USE flags first, but I don't know how
> > > acceptable it is to introduce new dep loops like this.
> >
> > what happens without your change ?
> 
> Someone reported an issue in https://bugs.gentoo.org/720948 that
> showed shadow and groups are not ordered during installation.  I am
> not sure what environment produced those symptoms since I never
> encountered it, but you can rage-clean shadow and a group, delete the
> group, then reinstall it to reproduce the problem.
> 

Yep, that's exactly why one needs the change you are proposing.
The dependency loop needs to be resolved, but introducing it like that
is IMHO better than failing like in the above bug because it is not
resolved properly.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-09-09 14:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-08 15:57 [gentoo-dev] [PATCH 1/2] acct-group.eclass: declare the missing dependency on shadow David Michael
2020-09-08 16:04 ` Michał Górny
2020-09-08 16:10   ` David Michael
2020-09-08 19:54 ` [gentoo-dev] " David Michael
2020-09-09  9:36   ` Alexis Ballier
2020-09-09 13:48     ` David Michael
2020-09-09 14:07       ` Alexis Ballier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox