Gentoo Archives: gentoo-dev

From: Michael Haubenwallner <haubi@g.o>
To: Zac Medico <zmedico@g.o>, gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] EAPI 7, BDEPEND and pkg_*inst
Date: Mon, 04 Jun 2018 11:17:09
Message-Id: 1141f158-74f1-17f2-b348-ea5aa994c364@gentoo.org
In Reply to: Re: [gentoo-dev] EAPI 7, BDEPEND and pkg_*inst by Zac Medico
1 On 05/31/2018 12:58 AM, Zac Medico wrote:
2 > On 05/30/2018 04:49 AM, Michael Haubenwallner wrote:
3 >> Hi,
4 >>
5 >> HOORAY, seems like EAPI 7 might be able to obsolete the "prefix-chaining"
6 >> portage patch I've carried in prefix-overlay all the time, thank you for that!
7 >>
8 >> However, a first thing being unclear already came up when bumping EAPI 6 to 7:
9 >>
10 >> For example, the current app-misc/ca-certificates ebuild (EAPI 6) contains:
11 >>
12 >> # c_rehash: we run `c_rehash`
13 >> # debianutils: we run `run-parts`
14 >> RDEPEND="${DEPEND}
15 >> app-misc/c_rehash
16 >> sys-apps/debianutils"
17 >>
18 >> pkg_postinst() {
19 >> if [ -d "${EROOT}/usr/local/share/ca-certificates" ] ; then
20 >> # if the user has local certs, we need to rebuild again
21 >> # to include their stuff in the db.
22 >> # However it's too overzealous when the user has custom certs in place.
23 >> # --fresh is to clean up dangling symlinks
24 >> "${EROOT}"/usr/sbin/update-ca-certificates --root "${ROOT}"
25 >> fi
26 >> }
27 >>
28 >> Thing is, these RDEPENDs are not really required to "run" ca-certificates, but to
29 >> administrate it - which eventually is done on the CBUILD machine (from within the
30 >> ebuild, like in pkg_postinst currently), not necessarily on the CHOST machine.
31 >>
32 >> So I do not necessarily want these RDEPENDs to be installed on the CHOST machine,
33 >> given that they may not be executed from within the CBUILD machine at all.
34 >>
35 >> So the first idea is to move both RDEPENDs into BDEPEND. But then, they are
36 >> not guaranteed to be available during pkg_postinst - like for a binary package.
37 >
38 > Right, so it really belongs in RDEPEND *and* BDEPEND.
39
40 RDEPEND doesn't feel correct - see below.
41
42 >
43 >> Question now is: Is this wrong behaviour in the ebuild,
44 >> or is this something where EAPI 7 is still insufficient for?
45 >
46 > If we want to tune the dependencies more finely, we'll need new EAPI.
47
48 Probably - with explicit "dependencies for merge and configuration phases"?
49 For consistency with DEPEND+RDEPEND, I can imagine BDEPEND+*BRDEPEND*.
50
51 >
52 >> When this is wrong (probably independent of EAPI 7 already) in the ebuild:
53 >> How can the ebuild get such a use case right, especially with EAPI 7?
54 >
55 > What's wrong with putting it in both?
56
57 In RDEPEND, they are provided as CHOST binaries (in EROOT), but they are
58 executed on the CBUILD machine during merge and configuration phases.
59
60 In BDEPEND, they are not guaranteed to be available with binary packages.
61
62 For a workaround (in another prefix-chaining portage patch), it might work to
63 guarantee BDEPEND be available even for merge and configuration phases, no?
64
65 --
66 Thanks!
67 /haubi/

Attachments

File name MIME type
signature.asc application/pgp-signature