The recipe unconditionally declared RDEPENDS on 'systemd', which is an
init manager, not an installable package. On distros like poky that do
not enable the systemd DISTRO_FEATURE, the dependency resolver cannot
satisfy this, causing the recipe and anything that inherits
memory-control.bbclass to become unbuildable in a world build:
ERROR: Nothing RPROVIDES 'systemd'
NOTE: Runtime target 'memory-control' is unbuildable
Fix by adding 'inherit features_check' and REQUIRED_DISTRO_FEATURES =
"systemd" to the recipe so it is cleanly skipped on non-systemd distros,
removing 'systemd' from RDEPENDS:${PN} in the recipe (the tool shells out
to systemctl at runtime, but systemd is an init manager present on the
running system, not a package dependency to install), and guarding the
RDEPENDS injection in memory-control.bbclass with bb.utils.contains so
recipes that inherit the class do not pull in the memory-control package
on non-systemd distros. Also add the missing RECIPE_MAINTAINER entry to
maintainers.inc.
Reported-by: Mathieu Dubois-Briand <[email protected]>
AI-Generated: Uses IBM Bob
Signed-off-by: Ishaan Desai <[email protected]>
---
meta/classes-recipe/memory-control.bbclass | 4 +++-
meta/conf/distro/include/maintainers.inc | 1 +
meta/recipes-support/memory-control/memory-control_1.0.bb | 6 ++++--
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/meta/classes-recipe/memory-control.bbclass
b/meta/classes-recipe/memory-control.bbclass
index 4b45720a1d..ebde5ed46b 100644
--- a/meta/classes-recipe/memory-control.bbclass
+++ b/meta/classes-recipe/memory-control.bbclass
@@ -25,7 +25,9 @@ MEMORY_LIMIT ?= ""
MEMORY_LIMIT_SERVICE ?= "${PN}.service"
MEMORY_OOM_POLICY ?= "reboot"
-RDEPENDS:${PN} += "memory-control"
+# Only inject the runtime dependency when the distro actually has systemd;
+# memory-control itself requires the systemd DISTRO_FEATURE.
+RDEPENDS:${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd',
'memory-control', '', d)}"
python memory_control_do_install() {
import os
diff --git a/meta/conf/distro/include/maintainers.inc
b/meta/conf/distro/include/maintainers.inc
index 4c6307086c..8589a67fa4 100644
--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -520,6 +520,7 @@ RECIPE_MAINTAINER:pn-matchbox-wm = "Ross Burton
<[email protected]>"
RECIPE_MAINTAINER:pn-mc = "Ross Burton <[email protected]>"
RECIPE_MAINTAINER:pn-mdadm = "Ross Burton <[email protected]>"
RECIPE_MAINTAINER:pn-menu-cache = "Ross Burton <[email protected]>"
+RECIPE_MAINTAINER:pn-memory-control = "Ishaan Desai <[email protected]>"
RECIPE_MAINTAINER:pn-mesa = "Unassigned <[email protected]>"
RECIPE_MAINTAINER:pn-mesa-demos = "Unassigned <[email protected]>"
RECIPE_MAINTAINER:pn-mesa-gl = "Unassigned <[email protected]>"
diff --git a/meta/recipes-support/memory-control/memory-control_1.0.bb
b/meta/recipes-support/memory-control/memory-control_1.0.bb
index 3740b783b6..56b156be4b 100644
--- a/meta/recipes-support/memory-control/memory-control_1.0.bb
+++ b/meta/recipes-support/memory-control/memory-control_1.0.bb
@@ -7,7 +7,9 @@ BUGTRACKER = "https://bugzilla.yoctoproject.org"
LICENSE = "MIT"
LIC_FILES_CHKSUM =
"file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
-inherit systemd
+inherit systemd features_check
+
+REQUIRED_DISTRO_FEATURES = "systemd"
SRC_URI = " \
file://memory-control.sh \
@@ -18,7 +20,7 @@ SRC_URI = " \
SYSTEMD_SERVICE:${PN} = ""
SYSTEMD_AUTO_ENABLE = "disable"
-RDEPENDS:${PN} = "bash systemd"
+RDEPENDS:${PN} = "bash"
do_install() {
install -d ${D}${bindir}
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#240842):
https://lists.openembedded.org/g/openembedded-core/message/240842
Mute This Topic: https://lists.openembedded.org/mt/120250712/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-