All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] package_manager: Change complementary package handling to not include soft dependencies
@ 2022-06-26  9:45 Richard Purdie
  2022-06-26  9:45 ` [PATCH 2/4] bitbake.conf/recipes: Introduce add DEV_PKG_DEPENDENCY to change RDEPENDS:${PN}-dev Richard Purdie
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Richard Purdie @ 2022-06-26  9:45 UTC (permalink / raw)
  To: openembedded-core; +Cc: Ross Burton

From: Ross Burton <ross.burton@arm.com>

We've some long standing bugs where the RDEPENDS from -dev packages causes
problems, e.g. dropbear and openssh components on an image working fine together
but then the SDK failing to build as the main openssh and dropbear packages
conflict with each other (pulled in by openssh-dev and dropbear-dev).

We propose changing the behavour of complementary package installation to
ignore RRECOMMENDS. If we then change the ${PN}-dev dependency on ${PN}
to a RRECOMMENDS, we can avoid many of the issues people run into yet still
have the desired behaviour of ${PN}-dev pulling in ${PN}.

This therefore changes the package manager code so that it doesn't follow
RRECOMMENDS for completementary package globs.

[RP: Added deb support]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/lib/oe/package_manager/__init__.py     |  4 ++--
 meta/lib/oe/package_manager/deb/__init__.py | 10 +++++++---
 meta/lib/oe/package_manager/ipk/__init__.py |  4 +++-
 meta/lib/oe/package_manager/rpm/__init__.py |  4 ++--
 4 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/meta/lib/oe/package_manager/__init__.py b/meta/lib/oe/package_manager/__init__.py
index 80bc1a6bc6a..d3b45705ec4 100644
--- a/meta/lib/oe/package_manager/__init__.py
+++ b/meta/lib/oe/package_manager/__init__.py
@@ -266,7 +266,7 @@ class PackageManager(object, metaclass=ABCMeta):
         pass
 
     @abstractmethod
-    def install(self, pkgs, attempt_only=False):
+    def install(self, pkgs, attempt_only=False, hard_depends_only=False):
         """
         Install a list of packages. 'pkgs' is a list object. If 'attempt_only' is
         True, installation failures are ignored.
@@ -396,7 +396,7 @@ class PackageManager(object, metaclass=ABCMeta):
                 bb.note("Installing complementary packages ... %s (skipped already provided packages %s)" % (
                     ' '.join(install_pkgs),
                     ' '.join(skip_pkgs)))
-                self.install(install_pkgs)
+                self.install(install_pkgs, hard_depends_only=True)
             except subprocess.CalledProcessError as e:
                 bb.fatal("Could not compute complementary packages list. Command "
                          "'%s' returned %d:\n%s" %
diff --git a/meta/lib/oe/package_manager/deb/__init__.py b/meta/lib/oe/package_manager/deb/__init__.py
index 86ddb130adf..b96ea0bad46 100644
--- a/meta/lib/oe/package_manager/deb/__init__.py
+++ b/meta/lib/oe/package_manager/deb/__init__.py
@@ -289,14 +289,18 @@ class DpkgPM(OpkgDpkgPM):
 
         self.deploy_dir_unlock()
 
-    def install(self, pkgs, attempt_only=False):
+    def install(self, pkgs, attempt_only=False, hard_depends_only=False):
         if attempt_only and len(pkgs) == 0:
             return
 
         os.environ['APT_CONFIG'] = self.apt_conf_file
 
-        cmd = "%s %s install --allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated --no-remove %s" % \
-              (self.apt_get_cmd, self.apt_args, ' '.join(pkgs))
+        extra_args = ""
+        if hard_depends_only:
+            extra_args = "--no-install-recommends"
+
+        cmd = "%s %s install --allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated --no-remove %s %s" % \
+              (self.apt_get_cmd, self.apt_args, extra_args, ' '.join(pkgs))
 
         try:
             bb.note("Installing the following packages: %s" % ' '.join(pkgs))
diff --git a/meta/lib/oe/package_manager/ipk/__init__.py b/meta/lib/oe/package_manager/ipk/__init__.py
index 4cd3963111c..6fd2f021b68 100644
--- a/meta/lib/oe/package_manager/ipk/__init__.py
+++ b/meta/lib/oe/package_manager/ipk/__init__.py
@@ -337,7 +337,7 @@ class OpkgPM(OpkgDpkgPM):
 
         self.deploy_dir_unlock()
 
-    def install(self, pkgs, attempt_only=False):
+    def install(self, pkgs, attempt_only=False, hard_depends_only=False):
         if not pkgs:
             return
 
@@ -346,6 +346,8 @@ class OpkgPM(OpkgDpkgPM):
             cmd += " --add-exclude %s" % exclude
         for bad_recommendation in (self.d.getVar("BAD_RECOMMENDATIONS") or "").split():
             cmd += " --add-ignore-recommends %s" % bad_recommendation
+        if hard_depends_only:
+            cmd += " --no-install-recommends"
         cmd += " install "
         cmd += " ".join(pkgs)
 
diff --git a/meta/lib/oe/package_manager/rpm/__init__.py b/meta/lib/oe/package_manager/rpm/__init__.py
index b392581069c..d97dab32938 100644
--- a/meta/lib/oe/package_manager/rpm/__init__.py
+++ b/meta/lib/oe/package_manager/rpm/__init__.py
@@ -181,7 +181,7 @@ class RpmPM(PackageManager):
         os.environ['NATIVE_ROOT'] = self.d.getVar('STAGING_DIR_NATIVE')
 
 
-    def install(self, pkgs, attempt_only = False):
+    def install(self, pkgs, attempt_only=False, hard_depends_only=False):
         if len(pkgs) == 0:
             return
         self._prepare_pkg_transaction()
@@ -192,7 +192,7 @@ class RpmPM(PackageManager):
 
         output = self._invoke_dnf((["--skip-broken"] if attempt_only else []) +
                          (["-x", ",".join(exclude_pkgs)] if len(exclude_pkgs) > 0 else []) +
-                         (["--setopt=install_weak_deps=False"] if self.d.getVar('NO_RECOMMENDATIONS') == "1" else []) +
+                         (["--setopt=install_weak_deps=False"] if (hard_depends_only or self.d.getVar('NO_RECOMMENDATIONS') == "1") else []) +
                          (["--nogpgcheck"] if self.d.getVar('RPM_SIGN_PACKAGES') != '1' else ["--setopt=gpgcheck=True"]) +
                          ["install"] +
                          pkgs)
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/4] bitbake.conf/recipes: Introduce add DEV_PKG_DEPENDENCY to change RDEPENDS:${PN}-dev
  2022-06-26  9:45 [PATCH 1/4] package_manager: Change complementary package handling to not include soft dependencies Richard Purdie
@ 2022-06-26  9:45 ` Richard Purdie
  2022-06-26  9:45 ` [PATCH 3/4] bitbake.conf: Change -dev RDEPENDS to RRECOMMENDS Richard Purdie
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Richard Purdie @ 2022-06-26  9:45 UTC (permalink / raw)
  To: openembedded-core

There is a pattern that several recipes need to break the dependency of ${PN}-dev
on ${PN}, most often as ${PN} may be be empty. Add a new variable to parameterise
this and allow it to be changed more easily.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/conf/bitbake.conf                                        | 3 ++-
 meta/recipes-connectivity/avahi/avahi_0.8.bb                  | 4 ++--
 meta/recipes-connectivity/bind/bind_9.18.4.bb                 | 2 +-
 meta/recipes-core/glibc/glibc-package.inc                     | 2 +-
 meta/recipes-core/musl/bsd-headers.bb                         | 2 +-
 meta/recipes-core/musl/libssp-nonshared.bb                    | 2 +-
 meta/recipes-core/newlib/newlib_4.2.0.bb                      | 2 +-
 meta/recipes-devtools/gcc/libgcc-common.inc                   | 4 ++--
 meta/recipes-devtools/python/python3_3.10.5.bb                | 2 +-
 meta/recipes-graphics/mesa/libglu_9.0.2.bb                    | 2 +-
 meta/recipes-graphics/mesa/mesa.inc                           | 2 +-
 meta/recipes-graphics/xorg-lib/libpthread-stubs_0.4.bb        | 2 +-
 meta/recipes-graphics/xorg-lib/xtrans_1.4.0.bb                | 2 +-
 meta/recipes-graphics/xorg-proto/xcb-proto_1.15.bb            | 2 +-
 meta/recipes-graphics/xorg-proto/xorgproto_2022.1.bb          | 2 +-
 meta/recipes-graphics/xorg-util/util-macros_1.19.3.bb         | 2 +-
 meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc | 2 +-
 meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb  | 2 +-
 meta/recipes-support/argp-standalone/argp-standalone_1.3.bb   | 2 +-
 19 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 2a3cf6f8aa4..40a893fe1c6 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -349,7 +349,8 @@ FILES:${PN}-dev = "${includedir} ${FILES_SOLIBSDEV} ${libdir}/*.la \
                 ${libdir}/cmake ${datadir}/cmake"
 SECTION:${PN}-dev = "devel"
 ALLOW_EMPTY:${PN}-dev = "1"
-RDEPENDS:${PN}-dev = "${PN} (= ${EXTENDPKGV})"
+DEV_PKG_DEPENDENCY = "${PN} (= ${EXTENDPKGV})"
+RDEPENDS:${PN}-dev = "${DEV_PKG_DEPENDENCY}"
 
 FILES:${PN}-staticdev = "${libdir}/*.a ${base_libdir}/*.a ${libdir}/${BPN}/*.a"
 SECTION:${PN}-staticdev = "devel"
diff --git a/meta/recipes-connectivity/avahi/avahi_0.8.bb b/meta/recipes-connectivity/avahi/avahi_0.8.bb
index 9bb5e5861ed..a2efe7e80ab 100644
--- a/meta/recipes-connectivity/avahi/avahi_0.8.bb
+++ b/meta/recipes-connectivity/avahi/avahi_0.8.bb
@@ -147,8 +147,8 @@ FILES:libavahi-glib = "${libdir}/libavahi-glib.so.*"
 FILES:libavahi-gobject = "${libdir}/libavahi-gobject.so.*  ${libdir}/girepository-1.0/Avahi*.typelib"
 FILES:avahi-utils = "${bindir}/avahi-* ${bindir}/b* ${datadir}/applications/b*"
 
-RDEPENDS:${PN}-dev = "avahi-daemon (= ${EXTENDPKGV}) libavahi-core (= ${EXTENDPKGV})"
-RDEPENDS:${PN}-dev += "${@["", " libavahi-client (= ${EXTENDPKGV})"][bb.utils.contains('PACKAGECONFIG', 'dbus', 1, 0, d)]}"
+DEV_PKG_DEPENDENCY = "avahi-daemon (= ${EXTENDPKGV}) libavahi-core (= ${EXTENDPKGV})"
+DEV_PKG_DEPENDENCY += "${@["", " libavahi-client (= ${EXTENDPKGV})"][bb.utils.contains('PACKAGECONFIG', 'dbus', 1, 0, d)]}"
 RDEPENDS:${PN}-dnsconfd = "${PN}-daemon"
 
 RRECOMMENDS:avahi-daemon:append:libc-glibc = " libnss-mdns"
diff --git a/meta/recipes-connectivity/bind/bind_9.18.4.bb b/meta/recipes-connectivity/bind/bind_9.18.4.bb
index 5af20221296..c68816c06ec 100644
--- a/meta/recipes-connectivity/bind/bind_9.18.4.bb
+++ b/meta/recipes-connectivity/bind/bind_9.18.4.bb
@@ -123,5 +123,5 @@ PACKAGE_BEFORE_PN += "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-
 FILES:python3-bind = "${sbindir}/dnssec-coverage ${sbindir}/dnssec-checkds \
                 ${sbindir}/dnssec-keymgr ${PYTHON_SITEPACKAGES_DIR}"
 
-RDEPENDS:${PN}-dev = ""
+DEV_PKG_DEPENDENCY = ""
 RDEPENDS:python3-bind = "python3-core python3-ply"
diff --git a/meta/recipes-core/glibc/glibc-package.inc b/meta/recipes-core/glibc/glibc-package.inc
index 7f9e7503a1c..278e1b7cc12 100644
--- a/meta/recipes-core/glibc/glibc-package.inc
+++ b/meta/recipes-core/glibc/glibc-package.inc
@@ -40,7 +40,7 @@ FILES:${PN}-pic = "${libdir}/*_pic.a ${libdir}/*_pic.map ${libdir}/libc_pic/*.o"
 FILES:libsotruss = "${libdir}/audit/sotruss-lib.so"
 FILES_SOLIBSDEV = "${libdir}/lib*${SOLIBSDEV}"
 FILES:${PN}-dev += "${libdir}/libpthread.a ${libdir}/libdl.a ${libdir}/libutil.a ${libdir}/libanl.a ${libdir}/*_nonshared.a ${base_libdir}/*_nonshared.a ${base_libdir}/*.o ${datadir}/aclocal"
-RDEPENDS:${PN}-dev = "linux-libc-headers-dev"
+DEV_PKG_DEPENDENCY = "linux-libc-headers-dev"
 FILES:${PN}-staticdev += "${libdir}/*.a ${base_libdir}/*.a"
 FILES:nscd = "${sbindir}/nscd* ${sysconfdir}/init.d/nscd ${systemd_system_unitdir}/nscd* ${sysconfdir}/tmpfiles.d/nscd.conf \
               ${sysconfdir}/nscd.conf ${sysconfdir}/default/volatiles/98_nscd ${localstatedir}/db/nscd"
diff --git a/meta/recipes-core/musl/bsd-headers.bb b/meta/recipes-core/musl/bsd-headers.bb
index cf8af0da3cd..887a8160313 100644
--- a/meta/recipes-core/musl/bsd-headers.bb
+++ b/meta/recipes-core/musl/bsd-headers.bb
@@ -27,5 +27,5 @@ do_install() {
 #
 
 COMPATIBLE_HOST = ".*-musl.*"
-RDEPENDS:${PN}-dev = ""
+DEV_PKG_DEPENDENCY = ""
 RRECOMMENDS:${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
diff --git a/meta/recipes-core/musl/libssp-nonshared.bb b/meta/recipes-core/musl/libssp-nonshared.bb
index 748dacf3126..3faf8f00c3c 100644
--- a/meta/recipes-core/musl/libssp-nonshared.bb
+++ b/meta/recipes-core/musl/libssp-nonshared.bb
@@ -31,5 +31,5 @@ do_install() {
 #
 COMPATIBLE_HOST = ".*-musl.*"
 RDEPENDS:${PN}-staticdev = ""
-RDEPENDS:${PN}-dev = ""
+DEV_PKG_DEPENDENCY = ""
 RRECOMMENDS:${PN}-dbg = "${PN}-staticdev (= ${EXTENDPKGV})"
diff --git a/meta/recipes-core/newlib/newlib_4.2.0.bb b/meta/recipes-core/newlib/newlib_4.2.0.bb
index 0542c596bad..fb922d65d1d 100644
--- a/meta/recipes-core/newlib/newlib_4.2.0.bb
+++ b/meta/recipes-core/newlib/newlib_4.2.0.bb
@@ -17,4 +17,4 @@ do_install:append() {
 }
 
 # No rpm package is actually created but -dev depends on it, avoid dnf error
-RDEPENDS:${PN}-dev:libc-newlib = ""
+DEV_PKG_DEPENDENCY:libc-newlib = ""
diff --git a/meta/recipes-devtools/gcc/libgcc-common.inc b/meta/recipes-devtools/gcc/libgcc-common.inc
index d48dc8b8230..fbeb43d7186 100644
--- a/meta/recipes-devtools/gcc/libgcc-common.inc
+++ b/meta/recipes-devtools/gcc/libgcc-common.inc
@@ -52,8 +52,8 @@ do_install:append:libc-newlib () {
 }
 
 # No rpm package is actually created but -dev depends on it, avoid dnf error
-RDEPENDS:${PN}-dev:libc-baremetal = ""
-RDEPENDS:${PN}-dev:libc-newlib = ""
+DEV_PKG_DEPENDENCY:libc-baremetal = ""
+DEV_PKG_DEPENDENCY:libc-newlib = ""
 
 BBCLASSEXTEND = "nativesdk"
 
diff --git a/meta/recipes-devtools/python/python3_3.10.5.bb b/meta/recipes-devtools/python/python3_3.10.5.bb
index 599a1884b42..b237c487358 100644
--- a/meta/recipes-devtools/python/python3_3.10.5.bb
+++ b/meta/recipes-devtools/python/python3_3.10.5.bb
@@ -416,7 +416,7 @@ RDEPENDS:${PN}-ptest = "${PN}-modules ${PN}-tests ${PN}-dev unzip bzip2 libgcc t
 RDEPENDS:${PN}-ptest:append:libc-glibc = " locale-base-tr-tr.iso-8859-9"
 RDEPENDS:${PN}-tkinter += "${@bb.utils.contains('PACKAGECONFIG', 'tk', '${MLPREFIX}tk ${MLPREFIX}tk-lib', '', d)}"
 RDEPENDS:${PN}-idle += "${@bb.utils.contains('PACKAGECONFIG', 'tk', '${PN}-tkinter ${MLPREFIX}tcl', '', d)}"
-RDEPENDS:${PN}-dev = ""
+DEV_PKG_DEPENDENCY = ""
 RDEPENDS:${PN}-pydoc += "${PN}-io"
 
 RDEPENDS:${PN}-tests:append:class-target = " ${MLPREFIX}bash"
diff --git a/meta/recipes-graphics/mesa/libglu_9.0.2.bb b/meta/recipes-graphics/mesa/libglu_9.0.2.bb
index 64fa82e5a80..0d27dd116b0 100644
--- a/meta/recipes-graphics/mesa/libglu_9.0.2.bb
+++ b/meta/recipes-graphics/mesa/libglu_9.0.2.bb
@@ -25,4 +25,4 @@ inherit autotools pkgconfig features_check
 REQUIRED_DISTRO_FEATURES = "x11 opengl"
 
 # Remove the mesa-glu dependency in mesa-glu-dev, as mesa-glu is empty
-RDEPENDS:${PN}-dev = ""
+DEV_PKG_DEPENDENCY = ""
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index 83705fc34df..bb39e2f369c 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -183,7 +183,7 @@ CFLAGS:append:armv5 = " -DMISSING_64BIT_ATOMICS"
 CFLAGS:append:armv6 = " -DMISSING_64BIT_ATOMICS"
 
 # Remove the mesa dependency on mesa-dev, as mesa is empty
-RDEPENDS:${PN}-dev = ""
+DEV_PKG_DEPENDENCY = ""
 
 # Khronos documentation says that include/GLES2/gl2ext.h can be used for
 # OpenGL ES 3 specification as well as for OpenGL ES 2.
diff --git a/meta/recipes-graphics/xorg-lib/libpthread-stubs_0.4.bb b/meta/recipes-graphics/xorg-lib/libpthread-stubs_0.4.bb
index b398e8b626c..7bf702076d7 100644
--- a/meta/recipes-graphics/xorg-lib/libpthread-stubs_0.4.bb
+++ b/meta/recipes-graphics/xorg-lib/libpthread-stubs_0.4.bb
@@ -13,7 +13,7 @@ SRC_URI[sha256sum] = "e4d05911a3165d3b18321cc067fdd2f023f06436e391c6a28dff618a78
 
 inherit autotools
 
-RDEPENDS:${PN}-dev = ""
+DEV_PKG_DEPENDENCY = ""
 RRECOMMENDS:${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
 
 BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-graphics/xorg-lib/xtrans_1.4.0.bb b/meta/recipes-graphics/xorg-lib/xtrans_1.4.0.bb
index 08773c8ccc5..83f11769f5a 100644
--- a/meta/recipes-graphics/xorg-lib/xtrans_1.4.0.bb
+++ b/meta/recipes-graphics/xorg-lib/xtrans_1.4.0.bb
@@ -16,7 +16,7 @@ SRC_URI += "file://multilibfix.patch"
 
 PE = "1"
 
-RDEPENDS:${PN}-dev = ""
+DEV_PKG_DEPENDENCY = ""
 
 inherit gettext
 
diff --git a/meta/recipes-graphics/xorg-proto/xcb-proto_1.15.bb b/meta/recipes-graphics/xorg-proto/xcb-proto_1.15.bb
index f050ed366cf..070fb624558 100644
--- a/meta/recipes-graphics/xorg-proto/xcb-proto_1.15.bb
+++ b/meta/recipes-graphics/xorg-proto/xcb-proto_1.15.bb
@@ -22,7 +22,7 @@ FILES:${PN} = ""
 FILES:${PN}-dev += "${datadir}/xcb/*.xml ${datadir}/xcb/*.xsd"
 FILES:python-xcbgen = "${PYTHON_SITEPACKAGES_DIR}"
 
-RDEPENDS:${PN}-dev = ""
+DEV_PKG_DEPENDENCY = ""
 RRECOMMENDS:${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
 
 BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-graphics/xorg-proto/xorgproto_2022.1.bb b/meta/recipes-graphics/xorg-proto/xorgproto_2022.1.bb
index 7786318476c..a1e852b9eb1 100644
--- a/meta/recipes-graphics/xorg-proto/xorgproto_2022.1.bb
+++ b/meta/recipes-graphics/xorg-proto/xorgproto_2022.1.bb
@@ -19,7 +19,7 @@ PACKAGECONFIG[legacy] = "-Dlegacy=true,-Dlegacy=false"
 # Datadir only used to install pc files, $datadir/pkgconfig
 datadir="${libdir}"
 # ${PN} is empty so we need to tweak -dev and -dbg package dependencies
-RDEPENDS:${PN}-dev = ""
+DEV_PKG_DEPENDENCY = ""
 RRECOMMENDS:${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
 
 BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-graphics/xorg-util/util-macros_1.19.3.bb b/meta/recipes-graphics/xorg-util/util-macros_1.19.3.bb
index 0164256eb46..13d8ce22dfe 100644
--- a/meta/recipes-graphics/xorg-util/util-macros_1.19.3.bb
+++ b/meta/recipes-graphics/xorg-util/util-macros_1.19.3.bb
@@ -13,7 +13,7 @@ SRC_URI[md5sum] = "66cb74d4a0120a06e32c3b01c29417d8"
 SRC_URI[sha256sum] = "624bb6c3a4613d18114a7e3849a3d70f2d7af9dc6eabeaba98060d87e3aef35b"
 
 # ${PN} is empty so we need to tweak -dev and -dbg package dependencies
-RDEPENDS:${PN}-dev = ""
+DEV_PKG_DEPENDENCY = ""
 RRECOMMENDS:${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
 
 BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
index 47f09952de6..71778bb4e36 100644
--- a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
+++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
@@ -103,7 +103,7 @@ do_install_armmultilib () {
 
 BBCLASSEXTEND = "nativesdk"
 
-RDEPENDS:${PN}-dev = ""
+DEV_PKG_DEPENDENCY = ""
 RRECOMMENDS:${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
 
 INHIBIT_DEFAULT_DEPS = "1"
diff --git a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
index 0e420a25d91..9afd6714f0d 100644
--- a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
+++ b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
@@ -13,7 +13,7 @@ S = "${WORKDIR}"
 do_configure[depends] += "virtual/kernel:do_shared_workdir openssl-native:do_populate_sysroot"
 do_compile[depends] += "virtual/kernel:do_compile_kernelmodules"
 
-RDEPENDS:${PN}-dev = ""
+DEV_PKG_DEPENDENCY = ""
 
 DEPENDS += "bc-native bison-native"
 DEPENDS += "gmp-native"
diff --git a/meta/recipes-support/argp-standalone/argp-standalone_1.3.bb b/meta/recipes-support/argp-standalone/argp-standalone_1.3.bb
index e7599d69d62..8d8122612a2 100644
--- a/meta/recipes-support/argp-standalone/argp-standalone_1.3.bb
+++ b/meta/recipes-support/argp-standalone/argp-standalone_1.3.bb
@@ -20,7 +20,7 @@ inherit autotools
 
 CFLAGS += "-fPIC -U__OPTIMIZE__"
 
-RDEPENDS:${PN}-dev = ""
+DEV_PKG_DEPENDENCY = ""
 RDEPENDS:${PN}-staticdev = ""
 
 do_install() {
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/4] bitbake.conf: Change -dev RDEPENDS to RRECOMMENDS
  2022-06-26  9:45 [PATCH 1/4] package_manager: Change complementary package handling to not include soft dependencies Richard Purdie
  2022-06-26  9:45 ` [PATCH 2/4] bitbake.conf/recipes: Introduce add DEV_PKG_DEPENDENCY to change RDEPENDS:${PN}-dev Richard Purdie
@ 2022-06-26  9:45 ` Richard Purdie
  2022-06-26  9:45 ` [PATCH 4/4] coreutils: Tweak packaging variable names for coreutils-dev Richard Purdie
  2022-06-27 16:12 ` [PATCH 1/4] package_manager: Change complementary package handling to not include soft dependencies Ross Burton
  3 siblings, 0 replies; 6+ messages in thread
From: Richard Purdie @ 2022-06-26  9:45 UTC (permalink / raw)
  To: openembedded-core

Switch the default DEPENDS for ${PN}-dev to be a RRECOMMENDS instead. This
takes advantage of a change to complmentary package globbing to not follow
RRECOMMENDS and means and SDK for an image with both openssh and dropbear
compoments will now build successfully.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/conf/bitbake.conf                    | 2 +-
 meta/lib/oeqa/selftest/cases/oescripts.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 40a893fe1c6..1d36aae8b35 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -350,7 +350,7 @@ FILES:${PN}-dev = "${includedir} ${FILES_SOLIBSDEV} ${libdir}/*.la \
 SECTION:${PN}-dev = "devel"
 ALLOW_EMPTY:${PN}-dev = "1"
 DEV_PKG_DEPENDENCY = "${PN} (= ${EXTENDPKGV})"
-RDEPENDS:${PN}-dev = "${DEV_PKG_DEPENDENCY}"
+RRECOMMENDS:${PN}-dev = "${DEV_PKG_DEPENDENCY}"
 
 FILES:${PN}-staticdev = "${libdir}/*.a ${base_libdir}/*.a ${libdir}/${BPN}/*.a"
 SECTION:${PN}-staticdev = "devel"
diff --git a/meta/lib/oeqa/selftest/cases/oescripts.py b/meta/lib/oeqa/selftest/cases/oescripts.py
index bd84f151cb3..d3a789a6a77 100644
--- a/meta/lib/oeqa/selftest/cases/oescripts.py
+++ b/meta/lib/oeqa/selftest/cases/oescripts.py
@@ -21,7 +21,7 @@ class BuildhistoryDiffTests(BuildhistoryBase):
         pkgv = result.output.rstrip()
         result = runCmd("buildhistory-diff -p %s" % get_bb_var('BUILDHISTORY_DIR'))
         expected_endlines = [
-            "xcursor-transparent-theme-dev: RDEPENDS: removed \"xcursor-transparent-theme (['= %s-r1'])\", added \"xcursor-transparent-theme (['= %s-r0'])\"" % (pkgv, pkgv),
+            "xcursor-transparent-theme-dev: RRECOMMENDS: removed \"xcursor-transparent-theme (['= %s-r1'])\", added \"xcursor-transparent-theme (['= %s-r0'])\"" % (pkgv, pkgv),
             "xcursor-transparent-theme-staticdev: RDEPENDS: removed \"xcursor-transparent-theme-dev (['= %s-r1'])\", added \"xcursor-transparent-theme-dev (['= %s-r0'])\"" % (pkgv, pkgv)
         ]
         for line in result.output.splitlines():
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/4] coreutils: Tweak packaging variable names for coreutils-dev
  2022-06-26  9:45 [PATCH 1/4] package_manager: Change complementary package handling to not include soft dependencies Richard Purdie
  2022-06-26  9:45 ` [PATCH 2/4] bitbake.conf/recipes: Introduce add DEV_PKG_DEPENDENCY to change RDEPENDS:${PN}-dev Richard Purdie
  2022-06-26  9:45 ` [PATCH 3/4] bitbake.conf: Change -dev RDEPENDS to RRECOMMENDS Richard Purdie
@ 2022-06-26  9:45 ` Richard Purdie
  2022-06-27 16:12 ` [PATCH 1/4] package_manager: Change complementary package handling to not include soft dependencies Ross Burton
  3 siblings, 0 replies; 6+ messages in thread
From: Richard Purdie @ 2022-06-26  9:45 UTC (permalink / raw)
  To: openembedded-core

PACKAGES uses ${PN}-dev so be consistent with the addition to the
variable to avoid weird variable conflicts.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-core/coreutils/coreutils_9.1.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/coreutils/coreutils_9.1.bb b/meta/recipes-core/coreutils/coreutils_9.1.bb
index d57e147a7e0..0f57372369d 100644
--- a/meta/recipes-core/coreutils/coreutils_9.1.bb
+++ b/meta/recipes-core/coreutils/coreutils_9.1.bb
@@ -171,8 +171,8 @@ RDEPENDS:${PN}-ptest += "bash findutils gawk liberror-perl make perl perl-module
 
 # -dev automatic dependencies fails as we don't want libmodule-build-perl-dev, its too heavy
 # may need tweaking if DEPENDS changes
-RRECOMMENDS:coreutils-dev[nodeprrecs] = "1"
-RRECOMMENDS:coreutils-dev = "acl-dev attr-dev gmp-dev libcap-dev bash-dev findutils-dev gawk-dev shadow-dev"
+RRECOMMENDS:${PN}-dev[nodeprrecs] = "1"
+RRECOMMENDS:${PN}-dev += "acl-dev attr-dev gmp-dev libcap-dev bash-dev findutils-dev gawk-dev shadow-dev"
 
 do_install_ptest () {
     install -d ${D}${PTEST_PATH}/tests
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/4] package_manager: Change complementary package handling to not include soft dependencies
  2022-06-26  9:45 [PATCH 1/4] package_manager: Change complementary package handling to not include soft dependencies Richard Purdie
                   ` (2 preceding siblings ...)
  2022-06-26  9:45 ` [PATCH 4/4] coreutils: Tweak packaging variable names for coreutils-dev Richard Purdie
@ 2022-06-27 16:12 ` Ross Burton
  2022-06-27 16:51   ` Richard Purdie
  3 siblings, 1 reply; 6+ messages in thread
From: Ross Burton @ 2022-06-27 16:12 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

Whilst I agree with this series in general (obviously…), some commentary.

First, the impact of this can’t be understated.  If you enable dev-pkgs on core-image-base, and extra 424 packages are installed *ignoring any package with -dev in its name*. This includes behaviour-changing packages such as the full-fat versions of coreutils, util-linux, findutils, most of Python, a whole slew of libraries.  That is *not* good and this is a step in the right direction.

There are still some edge cases though, repeating the same test with core-image-base installs these extra non-dev packages:

alsa-topology-conf
libatopology2
libavahi-client3
libavahi-glib1
libavahi-gobject0
libc-malloc-debug0
libc6-extra-nss
libc6-thread-db
libc6-utils
libfdisk1
libform5
libformw5
libgcc1
libmenu5
libmenuw5
libncurses5
libncursesw5
libnl-3-cli
libnl-idiag-3-200
libnl-nf-3-200
libnl-xfrm-3-200
libnss-db2
libpanel5
libpanelw5
libpcrecpp0
libpcreposix0
libsmartcols1
libss2
libstdc++6
libtic5
libticw5
libx11-xcb1
libxcb-composite0
libxcb-damage0
libxcb-dpms0
libxcb-dri2-0
libxcb-dri3-0
libxcb-glx0
libxcb-present0
libxcb-randr0
libxcb-record0
libxcb-render0
libxcb-res0
libxcb-screensaver0
libxcb-shape0
libxcb-shm0
libxcb-sync1
libxcb-xf86dri0
libxcb-xfixes0
libxcb-xinerama0
libxcb-xinput0
libxcb-xkb1
libxcb-xtest0
libxcb-xv0
libxcb-xvmc0

The bulk of these are likely from the -dev package depending on the real package to satisfy dangling symlinks.  This may actually be desirable behaviour?  Not sure I’d want a broken -dev package.

Ross



> On 26 Jun 2022, at 10:45, Richard Purdie <richard.purdie@linuxfoundation.org> wrote:
>
> From: Ross Burton <ross.burton@arm.com>
>
> We've some long standing bugs where the RDEPENDS from -dev packages causes
> problems, e.g. dropbear and openssh components on an image working fine together
> but then the SDK failing to build as the main openssh and dropbear packages
> conflict with each other (pulled in by openssh-dev and dropbear-dev).
>
> We propose changing the behavour of complementary package installation to
> ignore RRECOMMENDS. If we then change the ${PN}-dev dependency on ${PN}
> to a RRECOMMENDS, we can avoid many of the issues people run into yet still
> have the desired behaviour of ${PN}-dev pulling in ${PN}.
>
> This therefore changes the package manager code so that it doesn't follow
> RRECOMMENDS for completementary package globs.
>
> [RP: Added deb support]
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
> meta/lib/oe/package_manager/__init__.py     |  4 ++--
> meta/lib/oe/package_manager/deb/__init__.py | 10 +++++++---
> meta/lib/oe/package_manager/ipk/__init__.py |  4 +++-
> meta/lib/oe/package_manager/rpm/__init__.py |  4 ++--
> 4 files changed, 14 insertions(+), 8 deletions(-)
>
> diff --git a/meta/lib/oe/package_manager/__init__.py b/meta/lib/oe/package_manager/__init__.py
> index 80bc1a6bc6a..d3b45705ec4 100644
> --- a/meta/lib/oe/package_manager/__init__.py
> +++ b/meta/lib/oe/package_manager/__init__.py
> @@ -266,7 +266,7 @@ class PackageManager(object, metaclass=ABCMeta):
>         pass
>
>     @abstractmethod
> -    def install(self, pkgs, attempt_only=False):
> +    def install(self, pkgs, attempt_only=False, hard_depends_only=False):
>         """
>         Install a list of packages. 'pkgs' is a list object. If 'attempt_only' is
>         True, installation failures are ignored.
> @@ -396,7 +396,7 @@ class PackageManager(object, metaclass=ABCMeta):
>                 bb.note("Installing complementary packages ... %s (skipped already provided packages %s)" % (
>                     ' '.join(install_pkgs),
>                     ' '.join(skip_pkgs)))
> -                self.install(install_pkgs)
> +                self.install(install_pkgs, hard_depends_only=True)
>             except subprocess.CalledProcessError as e:
>                 bb.fatal("Could not compute complementary packages list. Command "
>                          "'%s' returned %d:\n%s" %
> diff --git a/meta/lib/oe/package_manager/deb/__init__.py b/meta/lib/oe/package_manager/deb/__init__.py
> index 86ddb130adf..b96ea0bad46 100644
> --- a/meta/lib/oe/package_manager/deb/__init__.py
> +++ b/meta/lib/oe/package_manager/deb/__init__.py
> @@ -289,14 +289,18 @@ class DpkgPM(OpkgDpkgPM):
>
>         self.deploy_dir_unlock()
>
> -    def install(self, pkgs, attempt_only=False):
> +    def install(self, pkgs, attempt_only=False, hard_depends_only=False):
>         if attempt_only and len(pkgs) == 0:
>             return
>
>         os.environ['APT_CONFIG'] = self.apt_conf_file
>
> -        cmd = "%s %s install --allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated --no-remove %s" % \
> -              (self.apt_get_cmd, self.apt_args, ' '.join(pkgs))
> +        extra_args = ""
> +        if hard_depends_only:
> +            extra_args = "--no-install-recommends"
> +
> +        cmd = "%s %s install --allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated --no-remove %s %s" % \
> +              (self.apt_get_cmd, self.apt_args, extra_args, ' '.join(pkgs))
>
>         try:
>             bb.note("Installing the following packages: %s" % ' '.join(pkgs))
> diff --git a/meta/lib/oe/package_manager/ipk/__init__.py b/meta/lib/oe/package_manager/ipk/__init__.py
> index 4cd3963111c..6fd2f021b68 100644
> --- a/meta/lib/oe/package_manager/ipk/__init__.py
> +++ b/meta/lib/oe/package_manager/ipk/__init__.py
> @@ -337,7 +337,7 @@ class OpkgPM(OpkgDpkgPM):
>
>         self.deploy_dir_unlock()
>
> -    def install(self, pkgs, attempt_only=False):
> +    def install(self, pkgs, attempt_only=False, hard_depends_only=False):
>         if not pkgs:
>             return
>
> @@ -346,6 +346,8 @@ class OpkgPM(OpkgDpkgPM):
>             cmd += " --add-exclude %s" % exclude
>         for bad_recommendation in (self.d.getVar("BAD_RECOMMENDATIONS") or "").split():
>             cmd += " --add-ignore-recommends %s" % bad_recommendation
> +        if hard_depends_only:
> +            cmd += " --no-install-recommends"
>         cmd += " install "
>         cmd += " ".join(pkgs)
>
> diff --git a/meta/lib/oe/package_manager/rpm/__init__.py b/meta/lib/oe/package_manager/rpm/__init__.py
> index b392581069c..d97dab32938 100644
> --- a/meta/lib/oe/package_manager/rpm/__init__.py
> +++ b/meta/lib/oe/package_manager/rpm/__init__.py
> @@ -181,7 +181,7 @@ class RpmPM(PackageManager):
>         os.environ['NATIVE_ROOT'] = self.d.getVar('STAGING_DIR_NATIVE')
>
>
> -    def install(self, pkgs, attempt_only = False):
> +    def install(self, pkgs, attempt_only=False, hard_depends_only=False):
>         if len(pkgs) == 0:
>             return
>         self._prepare_pkg_transaction()
> @@ -192,7 +192,7 @@ class RpmPM(PackageManager):
>
>         output = self._invoke_dnf((["--skip-broken"] if attempt_only else []) +
>                          (["-x", ",".join(exclude_pkgs)] if len(exclude_pkgs) > 0 else []) +
> -                         (["--setopt=install_weak_deps=False"] if self.d.getVar('NO_RECOMMENDATIONS') == "1" else []) +
> +                         (["--setopt=install_weak_deps=False"] if (hard_depends_only or self.d.getVar('NO_RECOMMENDATIONS') == "1") else []) +
>                          (["--nogpgcheck"] if self.d.getVar('RPM_SIGN_PACKAGES') != '1' else ["--setopt=gpgcheck=True"]) +
>                          ["install"] +
>                          pkgs)
> --
> 2.34.1
>

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/4] package_manager: Change complementary package handling to not include soft dependencies
  2022-06-27 16:12 ` [PATCH 1/4] package_manager: Change complementary package handling to not include soft dependencies Ross Burton
@ 2022-06-27 16:51   ` Richard Purdie
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Purdie @ 2022-06-27 16:51 UTC (permalink / raw)
  To: Ross Burton; +Cc: openembedded-core

On Mon, 2022-06-27 at 16:12 +0000, Ross Burton wrote:
> Whilst I agree with this series in general (obviously…), some
> commentary.
> 
> First, the impact of this can’t be understated.  If you enable dev-
> pkgs on core-image-base, and extra 424 packages are installed
> *ignoring any package with -dev in its name*. This includes
> behaviour-changing packages such as the full-fat versions of
> coreutils, util-linux, findutils, most of Python, a whole slew of
> libraries.  That is *not* good and this is a step in the right
> direction.
> 
> There are still some edge cases though, repeating the same test with
> core-image-base installs these extra non-dev packages:
> 
> alsa-topology-conf
> libatopology2
> libavahi-client3
> libavahi-glib1
> libavahi-gobject0
> libc-malloc-debug0
> libc6-extra-nss
> libc6-thread-db
> libc6-utils
> libfdisk1
> libform5
> libformw5
> libgcc1
> libmenu5
> libmenuw5
> libncurses5
> libncursesw5
> libnl-3-cli
> libnl-idiag-3-200
> libnl-nf-3-200
> libnl-xfrm-3-200
> libnss-db2
> libpanel5
> libpanelw5
> libpcrecpp0
> libpcreposix0
> libsmartcols1
> libss2
> libstdc++6
> libtic5
> libticw5
> libx11-xcb1
> libxcb-composite0
> libxcb-damage0
> libxcb-dpms0
> libxcb-dri2-0
> libxcb-dri3-0
> libxcb-glx0
> libxcb-present0
> libxcb-randr0
> libxcb-record0
> libxcb-render0
> libxcb-res0
> libxcb-screensaver0
> libxcb-shape0
> libxcb-shm0
> libxcb-sync1
> libxcb-xf86dri0
> libxcb-xfixes0
> libxcb-xinerama0
> libxcb-xinput0
> libxcb-xkb1
> libxcb-xtest0
> libxcb-xv0
> libxcb-xvmc0
> 
> The bulk of these are likely from the -dev package depending on the
> real package to satisfy dangling symlinks.  This may actually be
> desirable behaviour?  Not sure I’d want a broken -dev package.


I did a test build and changing package_fixsymlinks() in
package.bbclaass to use RRECOMMENDS instead of RDEPENDS does remove the
packages listed above too.

I'm torn on that, making that change would complete the picture and
you'd still have the dependency there, just as a slightly weaker level
and means dev-pkgs no longer radically changes the contents of the
image which is probably a good thing?

Cheers,

Richard





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-06-27 16:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-26  9:45 [PATCH 1/4] package_manager: Change complementary package handling to not include soft dependencies Richard Purdie
2022-06-26  9:45 ` [PATCH 2/4] bitbake.conf/recipes: Introduce add DEV_PKG_DEPENDENCY to change RDEPENDS:${PN}-dev Richard Purdie
2022-06-26  9:45 ` [PATCH 3/4] bitbake.conf: Change -dev RDEPENDS to RRECOMMENDS Richard Purdie
2022-06-26  9:45 ` [PATCH 4/4] coreutils: Tweak packaging variable names for coreutils-dev Richard Purdie
2022-06-27 16:12 ` [PATCH 1/4] package_manager: Change complementary package handling to not include soft dependencies Ross Burton
2022-06-27 16:51   ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.