Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] EAPI 7, BDEPEND and pkg_*inst
Date: Mon, 04 Jun 2018 11:41:12
Message-Id: 1528112451.841.6.camel@gentoo.org
In Reply to: [gentoo-dev] EAPI 7, BDEPEND and pkg_*inst by Michael Haubenwallner
1 W dniu śro, 30.05.2018 o godzinie 13∶49 +0200, użytkownik Michael
2 Haubenwallner napisał:
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 I'm sorry for not replying earlier. I meant to, but I failed to mark
9 the mail and I've forgot about it.
10
11 >
12 > However, a first thing being unclear already came up when bumping EAPI 6 to 7:
13 >
14 > For example, the current app-misc/ca-certificates ebuild (EAPI 6) contains:
15 >
16 > # c_rehash: we run `c_rehash`
17 > # debianutils: we run `run-parts`
18 > RDEPEND="${DEPEND}
19 > app-misc/c_rehash
20 > sys-apps/debianutils"
21 >
22 > pkg_postinst() {
23 > if [ -d "${EROOT}/usr/local/share/ca-certificates" ] ; then
24 > # if the user has local certs, we need to rebuild again
25 > # to include their stuff in the db.
26 > # However it's too overzealous when the user has custom certs in place.
27 > # --fresh is to clean up dangling symlinks
28 > "${EROOT}"/usr/sbin/update-ca-certificates --root "${ROOT}"
29 > fi
30 > }
31 >
32 > Thing is, these RDEPENDs are not really required to "run" ca-certificates, but to
33 > administrate it - which eventually is done on the CBUILD machine (from within the
34 > ebuild, like in pkg_postinst currently), not necessarily on the CHOST machine.
35 >
36 > So I do not necessarily want these RDEPENDs to be installed on the CHOST machine,
37 > given that they may not be executed from within the CBUILD machine at all.
38 >
39 > So the first idea is to move both RDEPENDs into BDEPEND. But then, they are
40 > not guaranteed to be available during pkg_postinst - like for a binary package.
41 >
42 > Question now is: Is this wrong behaviour in the ebuild,
43 > or is this something where EAPI 7 is still insufficient for?
44
45 It's a known deficiency discovered just a while too late to address it.
46 It comes from the fact that we never really had proper dependencies for
47 pkg_*inst phases. So far we've ignored the problem because our work-
48 arounds were sufficient for our use cases but cross definitely needs
49 something better.
50
51 > When this is wrong (probably independent of EAPI 7 already) in the ebuild:
52 > How can the ebuild get such a use case right, especially with EAPI 7?
53
54 I think the 'closest' thing to right would be to use BDEPEND+RDEPEND.
55 It won't cover cross+binpkg but I guess it's as good as you can get.
56
57 --
58 Best regards,
59 Michał Górny

Replies

Subject Author
[gentoo-dev] Re: EAPI 7, BDEPEND and pkg_*inst Michael Haubenwallner <haubi@g.o>