Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 802015 - sys-apps/systemd-tmpfiles pulls in kernel-headers at runtime
Summary: sys-apps/systemd-tmpfiles pulls in kernel-headers at runtime
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Georgy Yakovlev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-13 14:08 UTC by Ed Wildgoose
Modified: 2021-07-13 19:11 UTC (History)
3 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 Ed Wildgoose 2021-07-13 14:08:52 UTC
Both sys-apps/systemd-tmpfiles-{246,248.3}.ebuild pull in linux-headers as a *runtime* dependency? Is this really correct? Can it be moved to BDEPEND please?

DEPEND="
	sys-apps/acl:0=
	>=sys-apps/util-linux-2.30:0=
	>=sys-kernel/linux-headers-${MINKV}
	sys-libs/libcap:0=
	selinux? ( sys-libs/libselinux:0= )
"
RDEPEND="${DEPEND}
	!sys-apps/opentmpfiles
	!sys-apps/systemd
"

Note, building embedded small systems user here. Thanks
Comment 1 Mike Gilbert gentoo-dev 2021-07-13 16:36:50 UTC
It should be in DEPEND, not BDEPEND.
Comment 2 Ed Wildgoose 2021-07-13 18:52:15 UTC
Thankyou for responding.

Could I ask for a few more minutes of your time to educate me here please? I guess I have 2 questions:

1) Do we have a runtime requirement to have these headers available? (I've only just hit this upgrading from a previous tmpfiles option, so I've not needed kernel headers for this fairly substantial installation previously)

2) If we don't need the headers to be deployed, then what is the correct way to explain this to the build system? I apparently don't understand the documentation correctly, a pointer would be helpful? My understanding was that the RDEPEND would be used for the runtime dep and BDEPEND for build time depends (this leaves me unclear how DEPEND is now used actually?)

The upshot is that this is definitely pulling things into my chroot (ROOT=/blah emerge opentmpfiles), and to my eye it doesn't need to do this?

Thanks for a gentle education...
Comment 3 Larry the Git Cow gentoo-dev 2021-07-13 18:52:49 UTC
The bug has been closed via the following commit(s):

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

commit 3fd5e624ae1c24b83d6093ca876f39fa567e872c
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2021-07-13 18:47:08 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2021-07-13 18:52:36 +0000

    sys-apps/systemd-tmpfiles: move linux-headers to DEPEND
    
    no revbump, since it generally affects only new/cross installs
    
    Closes: https://bugs.gentoo.org/802015
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 sys-apps/systemd-tmpfiles/systemd-tmpfiles-246.ebuild   | 10 ++++++----
 sys-apps/systemd-tmpfiles/systemd-tmpfiles-248.3.ebuild | 10 ++++++----
 2 files changed, 12 insertions(+), 8 deletions(-)
Comment 4 Georgy Yakovlev archtester gentoo-dev 2021-07-13 18:56:42 UTC
RDEPEND - needed at runtime. so you are correct here.
BDEPEND - needed at build time at BROOT, build root.
DEPEND - needed at build time on ROOT, host root. host as in autotools host. the system that hosts resulting binaries.


but note, DEPEND deps can be deleted later with no runtime effect. that's the difference between DEPEND and RDEPEND.
BDEPEND will not be pulled into chroot/ROOT at all.
Comment 5 Mike Gilbert gentoo-dev 2021-07-13 18:59:12 UTC
(In reply to Ed Wildgoose from comment #2)
> 1) Do we have a runtime requirement to have these headers available? (I've
> only just hit this upgrading from a previous tmpfiles option, so I've not
> needed kernel headers for this fairly substantial installation previously)

There is no runtime requirement. Including it in RDEPEND was a mistake.

> 2) If we don't need the headers to be deployed, then what is the correct way
> to explain this to the build system? I apparently don't understand the
> documentation correctly, a pointer would be helpful? My understanding was
> that the RDEPEND would be used for the runtime dep and BDEPEND for build
> time depends (this leaves me unclear how DEPEND is now used actually?)

The difference between BDEPEND and DEPEND is explained here:

https://devmanual.gentoo.org/general-concepts/dependencies/index.html#build-dependencies
Comment 6 Georgy Yakovlev archtester gentoo-dev 2021-07-13 19:03:34 UTC
so after this change you may be able to remove linux-headers and other DEPEND stuff from chroot via

emerge --with-bdeps=n -cp

but it may expose more packages specifying incorrect deps, use with care.
Comment 7 Mike Gilbert gentoo-dev 2021-07-13 19:04:40 UTC
> The upshot is that this is definitely pulling things into my chroot (ROOT=/blah emerge opentmpfiles), and to my eye it doesn't need to do this?

For your specific example, it's probably redundant.

However, when cross-compiling, ROOT might contain libraries and headers for a completely different CPU architecture.

System headers (*.h) sometimes vary depending on the CPU being targeted. This is especially true of the linux-headers package.