Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 643386 - sys-apps/portage: unnecessary opentmpfiles dependency inherited from tmpfiles.eclass
Summary: sys-apps/portage: unnecessary opentmpfiles dependency inherited from tmpfiles...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on: 740600 741348
Blocks:
  Show dependency tree
 
Reported: 2018-01-04 10:39 UTC by nobody
Modified: 2021-03-09 16:24 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nobody 2018-01-04 10:39:59 UTC
Change add by from https://gitweb.gentoo.org/repo/gentoo.git/commit/sys-apps/portage?id=e5f430619b1dbdce1d9ba7836db55fee065798dd

Now portage inherit the RDEPEND="kernel_linux? ( virtual/tmpfiles )"
Because of this, it mean portage depends on something it doesn't use, and this block users who doesn't use virtual/tmpfiles (users without systemd or openrc, users with an openrc version < date when tmpfiles support was add).

And this just for that function! "dotmpfiles"

Reproducible: Always

Actual Results:  
portage now indirectly depend on a special init system, while portage itself do not use any function from any special init system.

Expected Results:  
portage should keep depending on packages it use ONLY, portage shouldn't depend on any init system as long as portage has no need for anything for an init system.

And this could be easy fix:
- revert the change to get back to "-inherit distutils-r1 git-r3"
- change dotmpfiles "${FILESDIR}"/portage-ccache.conf with 
insinto /usr/lib/tmpfiles.d
doins "${FILESDIR}"/portage-ccache.conf
Comment 1 Zac Medico gentoo-dev 2018-01-04 23:36:35 UTC
(In reply to nobody from comment #0)
> And this could be easy fix:
> - revert the change to get back to "-inherit distutils-r1 git-r3"
> - change dotmpfiles "${FILESDIR}"/portage-ccache.conf with 
> insinto /usr/lib/tmpfiles.d
> doins "${FILESDIR}"/portage-ccache.conf

Yeah that seems like a reasonable solution.
Comment 2 Larry the Git Cow gentoo-dev 2018-01-04 23:57:29 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=72533ec33e2fa41ac5f9859a4e1826a1baac512a

commit 72533ec33e2fa41ac5f9859a4e1826a1baac512a
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2018-01-04 23:55:17 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2018-01-04 23:56:38 +0000

    sys-apps/portage: eliminate virtual/tmpfiles dependency
    
    Closes: https://bugs.gentoo.org/643386
    Package-Manager: Portage-2.3.19, Repoman-2.3.6

 sys-apps/portage/portage-2.3.19-r1.ebuild | 7 ++++---
 sys-apps/portage/portage-9999.ebuild      | 7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-01-04 23:59:48 UTC
This is simply wrong. We use standards so that people don't end up reinventing the wheel every week. tmpfiles doesn't require any init system but merely a tool that's run at postinst.
Comment 4 Zac Medico gentoo-dev 2018-01-05 00:12:23 UTC
For OpenRC users, virtual/tmpfiles effectively forces a recent version of sys-apps/openrc via RDEPEND="!<sys-apps/openrc-0.23".

Portage doesn't require a virtual/tmpfiles implementation, it only needs to prevent systemd from interfering with /var/tmp/cache.
Comment 5 Larry the Git Cow gentoo-dev 2018-01-05 00:21:29 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=302eff51953f1258205feba67936bfb779fc3478

commit 302eff51953f1258205feba67936bfb779fc3478
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2018-01-05 00:19:22 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2018-01-05 00:20:10 +0000

    sys-apps/portage: use systemd eclass for tmpfiles support
    
    Closes: https://bugs.gentoo.org/643386
    Package-Manager: Portage-2.3.19, Repoman-2.3.6

 sys-apps/portage/portage-2.3.19-r1.ebuild | 5 ++---
 sys-apps/portage/portage-9999.ebuild      | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)
Comment 6 Zac Medico gentoo-dev 2020-09-06 16:52:03 UTC
The !<sys-apps/openrc-0.23 blocker should not be as relevant these days, since the most recent blocked release is nearly 4 years old now (it was only 1 year and 2 months old at the time this bug was opened):

https://github.com/OpenRC/openrc/releases/tag/0.22.4
Comment 7 Larry the Git Cow gentoo-dev 2020-09-06 17:35:31 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2af9e69f3462abfcf97679a24897b708f522059e

commit 2af9e69f3462abfcf97679a24897b708f522059e
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2020-09-06 17:16:26 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2020-09-06 17:35:20 +0000

    sys-apps/portage: Migrate to tmpfiles eclass
    
    The systemd_dotmpfilesd function is deprecated. Note that this
    effectively forces upgrade to >=sys-apps/openrc-0.23 for OpenRC users,
    since opentmpfiles blocks older versions of OpenRC (bug 643386).
    This should be acceptable, since the older OpenRC versions are nearly
    4 years old now.
    
    Closes: https://bugs.gentoo.org/740600
    Bug: https://bugs.gentoo.org/490676
    Bug: https://bugs.gentoo.org/643386
    Bug: https://bugs.gentoo.org/740638
    Package-Manager: Portage-3.0.5, Repoman-3.0.1
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/portage-2.3.103-r1.ebuild | 4 ++--
 sys-apps/portage/portage-2.3.99-r2.ebuild  | 4 ++--
 sys-apps/portage/portage-3.0.4-r1.ebuild   | 4 ++--
 sys-apps/portage/portage-3.0.5.ebuild      | 4 ++--
 sys-apps/portage/portage-9999.ebuild       | 4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)
Comment 8 Zac Medico gentoo-dev 2020-09-09 04:14:10 UTC
Re-opening this because the opentmpfiles dependency added by tmpfiles.eclass is completely unnecessary. The tmpfiles.d config from bug 490676 is only necessary for systemd users.
Comment 9 Mike Gilbert gentoo-dev 2020-09-09 14:52:55 UTC
For what it's worth, I don't see any real problem with calling insinto and doins directly. The /usr/lib/tmpfiled.d path is very unlikely to change.
Comment 10 Zac Medico gentoo-dev 2020-09-09 15:57:17 UTC
(In reply to Mike Gilbert from comment #9)
> For what it's worth, I don't see any real problem with calling insinto and
> doins directly. The /usr/lib/tmpfiled.d path is very unlikely to change.

I've already tried that in the commit referenced by comment #2. However, see the response in comment #3. So, apparently we need to have unnecessary dependencies in order to comply with QA policy.
Comment 11 Ulrich Müller gentoo-dev 2020-09-09 16:09:58 UTC
(In reply to Zac Medico from comment #10)

IMHO, it doesn't make much of a difference from a QA point of view if /usr/lib/tmpfiles.d/ is hardcoded in tmpfiles.eclass or in the ebuild.

Also, if tmpfiles.eclass requires dependencies that aren't necessary for some of its functionality, then maybe that functionality should be split off to a separate eclass (like tmpfiles-common.eclass or tmpfiles-utils.eclass)?
Comment 12 Zac Medico gentoo-dev 2020-09-09 16:49:14 UTC
I guess we could use something like this to avoid hardcoding /usr/lib/tmpfiles.d:

local tmpfilesdir
tmpfilesdir=$($(tc-getPKG_CONFIG) --variable=tmpfilesdir systemd)
: ${tmpfilesdir:=${EPREFIX}/usr/lib/tmpfiles.d}
insinto "${tmpfilesdir#${EPREFIX}}"
doins "${FILESDIR}"/portage-ccache.conf
Comment 13 Mike Gilbert gentoo-dev 2020-09-09 18:56:12 UTC
(In reply to Ulrich Müller from comment #11)
> Also, if tmpfiles.eclass requires dependencies that aren't necessary for
> some of its functionality, then maybe that functionality should be split off
> to a separate eclass (like tmpfiles-common.eclass or tmpfiles-utils.eclass)?

Yeah, that would work too.
Comment 14 William Hubbs gentoo-dev 2020-10-25 20:34:44 UTC
I looked into this a bit further, and the dependency is because of the
tmpfiles_process function which can be called in pkg_postinst to
immediately process the new tmpfiles.d entries.

If you don't use that, the use of the eclass is a bit questionable
possibly, but I'm open to other thoughts also.
Comment 15 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-03-09 12:07:42 UTC
Let's set TMPFILES_OPTIONAL=1 in the ebuild?
Comment 16 Larry the Git Cow gentoo-dev 2021-03-09 16:24:45 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b45d31d6c0266c3104025a420a43fe26e58db59

commit 3b45d31d6c0266c3104025a420a43fe26e58db59
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2021-03-09 16:23:10 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2021-03-09 16:24:42 +0000

    sys-apps/portage: set TMPFILES_OPTIONAL=1
    
    Closes: https://bugs.gentoo.org/643386
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 sys-apps/portage/portage-2.3.99-r2.ebuild | 3 ++-
 sys-apps/portage/portage-3.0.12.ebuild    | 1 +
 sys-apps/portage/portage-3.0.13.ebuild    | 1 +
 sys-apps/portage/portage-3.0.16.ebuild    | 1 +
 sys-apps/portage/portage-3.0.17.ebuild    | 1 +
 sys-apps/portage/portage-9999.ebuild      | 1 +
 6 files changed, 7 insertions(+), 1 deletion(-)