From 14f14957c90ed0a3c998ca676e943774b0d4d849 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Wed, 2 Oct 2019 22:27:17 -0400 Subject: podman: add build flexibility to dependencies In a similar manner to cri-o, we don't want to make meta-selinux or meta-security a hard dependency to meta-virtualization. So we implement a similar anonymous python check that allows the recipe to be skipped if the dependent layers are not present (and hence we are yocto compatible). If we get more than two recipes doing layer checks (this is the 2nd), we can move the functionality to a class. We also make the runc dependency be virtual/runc versus picking a specific provider (even if only runc-opencontainers has been tested). Signed-off-by: Bruce Ashfield --- recipes-containers/podman/podman_git.bb | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/recipes-containers/podman/podman_git.bb b/recipes-containers/podman/podman_git.bb index 09c3ce05..cad48f48 100644 --- a/recipes-containers/podman/podman_git.bb +++ b/recipes-containers/podman/podman_git.bb @@ -14,6 +14,22 @@ DEPENDS = " \ ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \ " +python __anonymous() { + msg = "" + # ERROR: Nothing PROVIDES 'libseccomp' (but /buildarea/layers/meta-virtualization/recipes-containers/cri-o/cri-o_git.bb DEPENDS on or otherwise requires it). + # ERROR: Required build target 'meta-world-pkgdata' has no buildable providers. + # Missing or unbuildable dependency chain was: ['meta-world-pkgdata', 'cri-o', 'libseccomp'] + if 'security' not in d.getVar('BBFILE_COLLECTIONS').split(): + msg += "Make sure meta-security should be present as it provides 'libseccomp'" + raise bb.parse.SkipRecipe(msg) + # ERROR: Nothing PROVIDES 'libselinux' (but /buildarea/layers/meta-virtualization/recipes-containers/cri-o/cri-o_git.bb DEPENDS on or otherwise requires it). + # ERROR: Required build target 'meta-world-pkgdata' has no buildable providers. + # Missing or unbuildable dependency chain was: ['meta-world-pkgdata', 'cri-o', 'libselinux'] + elif 'selinux' not in d.getVar('BBFILE_COLLECTIONS').split(): + msg += "Make sure meta-selinux should be present as it provides 'libselinux'" + raise bb.parse.SkipRecipe(msg) +} + SRCREV = "00057929f5acfd98341964d85722383363376d52" SRC_URI = " \ git://github.com/containers/libpod.git;branch=master \ @@ -89,5 +105,7 @@ FILES_${PN} += " \ ${sysconfdir}/cni \ " -RDEPENDS_${PN} += "conmon runc-opencontainers iptables cni skopeo" +# Note that runc-opencontainers is the only currently tested +# runc provider. +RDEPENDS_${PN} += "conmon virtual/runc iptables cni skopeo" RRECOMMENDS_${PN} += "slirp4netns" -- cgit v1.2.3-54-g00ecf