Gentoo Archives: gentoo-dev

From: Mike Gilbert <floppym@g.o>
To: Gentoo Dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] What's going on with the tmpfiles eclasses?
Date: Thu, 25 Apr 2019 21:33:02
Message-Id: CAJ0EP40PwQDM8rMdwzwDB8p8M0-_n0WjxzUVmqNx1qxF=RScyw@mail.gmail.com
In Reply to: Re: [gentoo-dev] What's going on with the tmpfiles eclasses? by "Michał Górny"
1 On Thu, Apr 25, 2019 at 5:26 PM Michał Górny <mgorny@g.o> wrote:
2 >
3 > On Thu, 2019-04-25 at 17:24 -0400, Mike Gilbert wrote:
4 > > On Tue, Apr 23, 2019 at 6:25 PM Zac Medico <zmedico@g.o> wrote:
5 > > > On 4/23/19 2:03 PM, Michael Orlitzky wrote:
6 > > > > We have two eclasses with almost-identical functions for handling
7 > > > > tmpfiles.d entries:
8 > > > >
9 > > > > 1. systemd.eclass
10 > > > >
11 > > > > a. systemd_dotmpfilesd
12 > > > > b. systemd_newtmpfilesd
13 > > > > c. systemd_tmpfiles_create
14 > > > >
15 > > > > 2. tmpfiles.eclass
16 > > > >
17 > > > > a. dotmpfiles
18 > > > > b. newtmpfiles
19 > > > > c. tmpfiles_process
20 > > > >
21 > > > > The do/new functions are basically identical, while the create/process
22 > > > > functions differ only in the fact that the one from tmpfiles.eclass
23 > > > > supports opentmpfiles as well. Why do we have both? Couldn't the
24 > > > > systemd.eclass ones be implemented in terms of the tmpfiles.eclass ones,
25 > > > > and then deprecated (in favor of tmpfiles.eclass itself) in newer EAPIs?
26 > > > >
27 > > > > Or am I missing something?
28 > > >
29 > > > Note that systemd.eclass is lighter on dependencies, which is why I
30 > > > chose it for the solution to bug 490676 [1] and bug 643386 [2] in the
31 > > > sys-apps/portage ebuilds.
32 > > >
33 > > > [1] https://bugs.gentoo.org/490676
34 > > > [2] https://bugs.gentoo.org/643386
35 > >
36 > > Having reviewed bug 643386, I would certainly call Portage's use of
37 > > tmpfiles.d to be a "special case". There is no reason to depend on
38 > > virtual/tmpfiles or to call tmpfiles --create in pkg_postinst.
39 > >
40 > > I don't think relying on the functions in systemd.eclass is a great
41 > > solution. A couple of alternatives I would propose:
42 > >
43 > > 1. Add a magic variable to tmpfiles.eclass to disable the RDEPEND for
44 > > packages that do not need to call tmpfiles --create on postinst or on
45 > > system boot.
46 > > 2. Revert back to insinto /usr/lib/tmpfiles.d and doins to avoid using
47 > > tmpfiles.eclass or systemd.eclass.
48 > >
49 >
50 > 3. Just live with the extra dependency given that some other package
51 > will probably bring it anyway.
52
53 4. Drop the dependency from tmpfiles.eclass given that
54 sys-apps/systemd or sys-apps/openrc will bring it in anyway.