From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-dev+bounces-84701-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id A5331138334
	for <garchives@archives.gentoo.org>; Mon,  4 Jun 2018 11:41:12 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id F2568E0901;
	Mon,  4 Jun 2018 11:40:58 +0000 (UTC)
Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 33926E0866
	for <gentoo-dev@lists.gentoo.org>; Mon,  4 Jun 2018 11:40:58 +0000 (UTC)
Received: from pomiot (d202-252.icpnet.pl [109.173.202.252])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	(Authenticated sender: mgorny)
	by smtp.gentoo.org (Postfix) with ESMTPSA id CBFB2335C8B;
	Mon,  4 Jun 2018 11:40:55 +0000 (UTC)
Message-ID: <1528112451.841.6.camel@gentoo.org>
Subject: Re: [gentoo-dev] EAPI 7, BDEPEND and pkg_*inst
From: =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?= <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Date: Mon, 04 Jun 2018 13:40:51 +0200
In-Reply-To: <5aa3997a-9b93-5882-1ad3-49eff04d45b0@gentoo.org>
References: <5aa3997a-9b93-5882-1ad3-49eff04d45b0@gentoo.org>
Organization: Gentoo
Content-Type: text/plain; charset="UTF-8"
X-Mailer: Evolution 3.24.6 
Precedence: bulk
List-Post: <mailto:gentoo-dev@lists.gentoo.org>
List-Help: <mailto:gentoo-dev+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-dev+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-dev+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-dev.gentoo.org>
X-BeenThere: gentoo-dev@lists.gentoo.org
Reply-to: gentoo-dev@lists.gentoo.org
Mime-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Archives-Salt: 77190a70-5a7c-4162-9b95-bebe2d0021d7
X-Archives-Hash: 10d0d68e28daa7b960f33590b3d5acba

W dniu śro, 30.05.2018 o godzinie 13∶49 +0200, użytkownik Michael
Haubenwallner napisał:
> Hi,
> 
> HOORAY, seems like EAPI 7 might be able to obsolete the "prefix-chaining"
> portage patch I've carried in prefix-overlay all the time, thank you for that!

I'm sorry for not replying earlier.  I meant to, but I failed to mark
the mail and I've forgot about it.

> 
> However, a first thing being unclear already came up when bumping EAPI 6 to 7:
> 
> For example, the current app-misc/ca-certificates ebuild (EAPI 6) contains:
> 
>  # c_rehash: we run `c_rehash`
>  # debianutils: we run `run-parts`
>  RDEPEND="${DEPEND}
>      app-misc/c_rehash
>      sys-apps/debianutils"
> 
>  pkg_postinst() {
>     if [ -d "${EROOT}/usr/local/share/ca-certificates" ] ; then
>         # if the user has local certs, we need to rebuild again
>         # to include their stuff in the db.
>         # However it's too overzealous when the user has custom certs in place.
>         # --fresh is to clean up dangling symlinks
>         "${EROOT}"/usr/sbin/update-ca-certificates --root "${ROOT}"
>     fi
>  }
> 
> Thing is, these RDEPENDs are not really required to "run" ca-certificates, but to
> administrate it - which eventually is done on the CBUILD machine (from within the
> ebuild, like in pkg_postinst currently), not necessarily on the CHOST machine.
> 
> So I do not necessarily want these RDEPENDs to be installed on the CHOST machine,
> given that they may not be executed from within the CBUILD machine at all.
> 
> So the first idea is to move both RDEPENDs into BDEPEND.  But then, they are
> not guaranteed to be available during pkg_postinst - like for a binary package.
> 
> Question now is: Is this wrong behaviour in the ebuild,
> or is this something where EAPI 7 is still insufficient for?

It's a known deficiency discovered just a while too late to address it. 
It comes from the fact that we never really had proper dependencies for
pkg_*inst phases.  So far we've ignored the problem because our work-
arounds were sufficient for our use cases but cross definitely needs
something better.

> When this is wrong (probably independent of EAPI 7 already) in the ebuild:
> How can the ebuild get such a use case right, especially with EAPI 7?

I think the 'closest' thing to right would be to use BDEPEND+RDEPEND. 
It won't cover cross+binpkg but I guess it's as good as you can get.

-- 
Best regards,
Michał Górny