Skip to contentSkip to conversation

dnf, libdnf: Ignore if PACKAGE_CLASSES does not have rpm

PATCH Superseded Khem Raj 3 participants 6 messages Feb 12, 2020

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 dnf, libdnf: Ignore if PACKAGE_CLASSES does not have rpm

dnf does not work with opkg or dpkg/apt anyway

---
 meta/recipes-devtools/dnf/dnf_4.2.2.bb        | 8 ++++++++
 meta/recipes-devtools/libdnf/libdnf_0.28.1.bb | 7 +++++++
 2 files changed, 15 insertions(+)
meta/recipes-devtools/dnf/dnf_4.2.2.bb +8 -0
index f38167f1ad..9e6d5741af 100644
@@ -84,3 +84,11 @@ SYSTEMD_SERVICE_${PN} = "dnf-makecache.service dnf-makecache.timer \
                          dnf-automatic-notifyonly.service dnf-automatic-notifyonly.timer \
 "
 SYSTEMD_AUTO_ENABLE ?= "disable"
+
+python () {
+    pkgb = d.getVar("PACKAGE_CLASSES")
+    pkgn = d.getVar("PN")
+    pkgv = d.getVar("PV")
+    if "package_rpm" not in pkgb:
+        raise bb.parse.SkipPackage("%s-%s Needs rpmdb support in libsolv" % (pkgn, pkgv))
+}
meta/recipes-devtools/libdnf/libdnf_0.28.1.bb +7 -0
index 882c435b32..5c9326ca64 100644
@@ -27,3 +27,10 @@ EXTRA_OECMAKE_append_class-nativesdk = " -DWITH_GIR=OFF"
 
 BBCLASSEXTEND = "native nativesdk"
 
+python () {
+    pkgb = d.getVar("PACKAGE_CLASSES")
+    pkgn = d.getVar("PN")
+    pkgv = d.getVar("PV")
+    if "package_rpm" not in pkgb:
+        raise bb.parse.SkipPackage("%s-%s Needs rpmdb support in libsolv" % (pkgn, pkgv))
+}
Signature · 1 line
2.25.0
#1 lore raw

Please let’s try to avoid anonymous python. What problem does this solve? If package_rpm is not enabled, then there should not be a dependency chain that builds these anyway.

Alex

Quoted 54 lines · Khem Raj

dnf does not work with opkg or dpkg/apt anyway

---
 meta/recipes-devtools/dnf/dnf_4.2.2.bb        | 8 ++++++++
 meta/recipes-devtools/libdnf/libdnf_0.28.1.bb | 7 +++++++
 2 files changed, 15 insertions(+)
meta/recipes-devtools/dnf/dnf_4.2.2.bb +7 -0
index f38167f1ad..9e6d5741af 100644
@@ -84,3 +84,11 @@ SYSTEMD_SERVICE_${PN} = "dnf-makecache.service
 dnf-makecache.timer \
                          dnf-automatic-notifyonly.service
 dnf-automatic-notifyonly.timer \
 "
 SYSTEMD_AUTO_ENABLE ?= "disable"
+
+python () {
+    pkgb = d.getVar("PACKAGE_CLASSES")
+    pkgn = d.getVar("PN")
+    pkgv = d.getVar("PV")
+    if "package_rpm" not in pkgb:
+        raise bb.parse.SkipPackage("%s-%s Needs rpmdb support in libsolv"

% (pkgn, pkgv))

meta/recipes-devtools/dnf/dnf_4.2.2.bb +1 -0
+}
meta/recipes-devtools/libdnf/libdnf_0.28.1.bb +6 -0
index 882c435b32..5c9326ca64 100644
@@ -27,3 +27,10 @@ EXTRA_OECMAKE_append_class-nativesdk = " -DWITH_GIR=OFF"
 
 BBCLASSEXTEND = "native nativesdk"
 
+python () {
+    pkgb = d.getVar("PACKAGE_CLASSES")
+    pkgn = d.getVar("PN")
+    pkgv = d.getVar("PV")
+    if "package_rpm" not in pkgb:
+        raise bb.parse.SkipPackage("%s-%s Needs rpmdb support in libsolv"

% (pkgn, pkgv))
+}
--
2.25.0

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

author
#2 lore raw
Quoted 2 lines · Alexander Kanavin

Please let’s try to avoid anonymous python. What problem does this solve? If package_rpm is not enabled, then there should not be a dependency chain that builds these anyway.

for non rpm backend opkg, rpm is pulled in which is not desired because opkg depends on libsolv
and libsolv by default depends on rpm which I sent another patch to decouple, This caused opkg images to fail tests because testing infra found rpm in the image and ran tests for it which obviously would fail.

libsolv does have rpm support as packageconfig but when that
is disabled then libdnf does not build anymore since it expects rpmdb support in libsolv.

so when we do world builds with opkg as package management then dnf and libdbf starts to fail
due to their RPM needs.

IF there was an override to identity packaging backends then we could have used that

If you have better suggestions to avoid anon python here, I am all ears.

Quoted 52 lines

Alex

Quoted 48 lines · Khem Raj

dnf does not work with opkg or dpkg/apt anyway

---
 meta/recipes-devtools/dnf/dnf_4.2.2.bb        | 8 ++++++++
 meta/recipes-devtools/libdnf/libdnf_0.28.1.bb | 7 +++++++
 2 files changed, 15 insertions(+)
meta/recipes-devtools/dnf/dnf_4.2.2.bb +8 -0
index f38167f1ad..9e6d5741af 100644
@@ -84,3 +84,11 @@ SYSTEMD_SERVICE_${PN} = "dnf-makecache.service dnf-makecache.timer \
                          dnf-automatic-notifyonly.service dnf-automatic-notifyonly.timer \
 "
 SYSTEMD_AUTO_ENABLE ?= "disable"
+
+python () {
+    pkgb = d.getVar("PACKAGE_CLASSES")
+    pkgn = d.getVar("PN")
+    pkgv = d.getVar("PV")
+    if "package_rpm" not in pkgb:
+        raise bb.parse.SkipPackage("%s-%s Needs rpmdb support in libsolv" % (pkgn, pkgv))
+}
meta/recipes-devtools/libdnf/libdnf_0.28.1.bb +7 -1
index 882c435b32..5c9326ca64 100644
@@ -27,3 +27,10 @@ EXTRA_OECMAKE_append_class-nativesdk = " -DWITH_GIR=OFF"
 
 BBCLASSEXTEND = "native nativesdk"
 
+python () {
+    pkgb = d.getVar("PACKAGE_CLASSES")
+    pkgn = d.getVar("PN")
+    pkgv = d.getVar("PV")
+    if "package_rpm" not in pkgb:
+        raise bb.parse.SkipPackage("%s-%s Needs rpmdb support in libsolv" % (pkgn, pkgv))
+}
--

2.25.0

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#3 lore raw

Maybe we can package rpm better so that the binaries and the libraries go into separate packages? Then libsolv would only pull in the rpm libraries and rpm tests would be skipped?

Alex

Quoted 87 lines · Khem Raj
Quoted 2 lines · Alexander Kanavin

Please let’s try to avoid anonymous python. What problem does this

solve? If package_rpm is not enabled, then there should not be a dependency chain that builds these anyway.

for non rpm backend opkg, rpm is pulled in which is not desired because opkg depends on libsolv
and libsolv by default depends on rpm which I sent another patch to decouple, This caused opkg images to fail tests because testing infra found rpm in the image and ran tests for it which obviously would fail.

libsolv does have rpm support as packageconfig but when that
is disabled then libdnf does not build anymore since it expects rpmdb support in libsolv.

so when we do world builds with opkg as package management then dnf and libdbf starts to fail
due to their RPM needs.

IF there was an override to identity packaging backends then we could have used that

If you have better suggestions to avoid anon python here, I am all ears.

Quoted 7 lines

Alex

Quoted 3 lines · Khem Raj

dnf does not work with opkg or dpkg/apt anyway

Quoted 7 lines

Review

Quoted 7 lines
---
 meta/recipes-devtools/dnf/dnf_4.2.2.bb        | 8 ++++++++
 meta/recipes-devtools/libdnf/libdnf_0.28.1.bb | 7 +++++++
 2 files changed, 15 insertions(+)
(quoted diff) +0 -0

b/meta/recipes-devtools/dnf/dnf_4.2.2.bb

Quoted 4 lines

meta/recipes-devtools/dnf/dnf_4.2.2.bb SYSTEMD_SERVICE_${PN} = "dnf-makecache.service

Quoted 4 lines

index f38167f1ad..9e6d5741af 100644

meta/recipes-devtools/dnf/dnf_4.2.2.bb +0 -0
@@ -84,3 +84,11 @@ SYSTEMD_SERVICE_${PN} = "dnf-makecache.service

dnf-makecache.timer \

Quoted 1 line

meta/recipes-devtools/dnf/dnf_4.2.2.bb SYSTEMD_SERVICE_${PN} = "dnf-makecache.service · line 84

Quoted 1 line
meta/recipes-devtools/dnf/dnf_4.2.2.bb +0 -0
                          dnf-automatic-notifyonly.service

dnf-automatic-notifyonly.timer \

Quoted 9 lines

meta/recipes-devtools/dnf/dnf_4.2.2.bb SYSTEMD_SERVICE_${PN} = "dnf-makecache.service dnf-makecache.timer \

Quoted 9 lines
meta/recipes-devtools/dnf/dnf_4.2.2.bb +7 -0
 "
 SYSTEMD_AUTO_ENABLE ?= "disable"
+
+python () {
+    pkgb = d.getVar("PACKAGE_CLASSES")
+    pkgn = d.getVar("PN")
+    pkgv = d.getVar("PV")
+    if "package_rpm" not in pkgb:
+        raise bb.parse.SkipPackage("%s-%s Needs rpmdb support in

libsolv" % (pkgn, pkgv))

Quoted 2 lines

Review

Quoted 2 lines
meta/recipes-devtools/dnf/dnf_4.2.2.bb +1 -0
+}
(quoted diff) +0 -0

b/meta/recipes-devtools/libdnf/libdnf_0.28.1.bb

Quoted 4 lines

meta/recipes-devtools/libdnf/libdnf_0.28.1.bb EXTRA_OECMAKE_append_class-nativesdk = "

Quoted 4 lines

index 882c435b32..5c9326ca64 100644

meta/recipes-devtools/libdnf/libdnf_0.28.1.bb +0 -0
@@ -27,3 +27,10 @@ EXTRA_OECMAKE_append_class-nativesdk = "

-DWITH_GIR=OFF"

Quoted 9 lines

meta/recipes-devtools/libdnf/libdnf_0.28.1.bb EXTRA_OECMAKE_append_class-nativesdk = " -DWITH_GIR=OFF"

Quoted 9 lines
meta/recipes-devtools/libdnf/libdnf_0.28.1.bb +6 -0
 BBCLASSEXTEND = "native nativesdk"
 
+python () {
+    pkgb = d.getVar("PACKAGE_CLASSES")
+    pkgn = d.getVar("PN")
+    pkgv = d.getVar("PV")
+    if "package_rpm" not in pkgb:
+        raise bb.parse.SkipPackage("%s-%s Needs rpmdb support in

libsolv" % (pkgn, pkgv))

Quoted 9 lines
Quoted 9 lines
meta/recipes-devtools/libdnf/libdnf_0.28.1.bb +1 -1
+}
--

2.25.0

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#4 lore raw
In reply to Khem Raj

Will this work for you without anonymous python? I think it should.

PNBLACKLIST[dnf] ?= "${@oe.utils.conditional('PACKAGE_CLASSES', 'package_rpm', '' 'does not build correctly without package_rpm in PACKAGE_CLASSES', d)}"

Quoted 92 lines · Khem Raj
Quoted 2 lines · Alexander Kanavin

Please let’s try to avoid anonymous python. What problem does this

solve? If package_rpm is not enabled, then there should not be a dependency chain that builds these anyway.

for non rpm backend opkg, rpm is pulled in which is not desired because opkg depends on libsolv
and libsolv by default depends on rpm which I sent another patch to decouple, This caused opkg images to fail tests because testing infra found rpm in the image and ran tests for it which obviously would fail.

libsolv does have rpm support as packageconfig but when that
is disabled then libdnf does not build anymore since it expects rpmdb support in libsolv.

so when we do world builds with opkg as package management then dnf and libdbf starts to fail
due to their RPM needs.

IF there was an override to identity packaging backends then we could have used that

If you have better suggestions to avoid anon python here, I am all ears.

Quoted 7 lines

Alex

Quoted 3 lines · Khem Raj

dnf does not work with opkg or dpkg/apt anyway

Quoted 7 lines

Review

Quoted 7 lines
---
 meta/recipes-devtools/dnf/dnf_4.2.2.bb        | 8 ++++++++
 meta/recipes-devtools/libdnf/libdnf_0.28.1.bb | 7 +++++++
 2 files changed, 15 insertions(+)
(quoted diff) +0 -0

b/meta/recipes-devtools/dnf/dnf_4.2.2.bb

Quoted 4 lines

meta/recipes-devtools/dnf/dnf_4.2.2.bb SYSTEMD_SERVICE_${PN} = "dnf-makecache.service

Quoted 4 lines

index f38167f1ad..9e6d5741af 100644

meta/recipes-devtools/dnf/dnf_4.2.2.bb +0 -0
@@ -84,3 +84,11 @@ SYSTEMD_SERVICE_${PN} = "dnf-makecache.service

dnf-makecache.timer \

Quoted 1 line

meta/recipes-devtools/dnf/dnf_4.2.2.bb SYSTEMD_SERVICE_${PN} = "dnf-makecache.service · line 84

Quoted 1 line
meta/recipes-devtools/dnf/dnf_4.2.2.bb +0 -0
                          dnf-automatic-notifyonly.service

dnf-automatic-notifyonly.timer \

Quoted 9 lines

meta/recipes-devtools/dnf/dnf_4.2.2.bb SYSTEMD_SERVICE_${PN} = "dnf-makecache.service dnf-makecache.timer \

Quoted 9 lines
meta/recipes-devtools/dnf/dnf_4.2.2.bb +7 -0
 "
 SYSTEMD_AUTO_ENABLE ?= "disable"
+
+python () {
+    pkgb = d.getVar("PACKAGE_CLASSES")
+    pkgn = d.getVar("PN")
+    pkgv = d.getVar("PV")
+    if "package_rpm" not in pkgb:
+        raise bb.parse.SkipPackage("%s-%s Needs rpmdb support in

libsolv" % (pkgn, pkgv))

Quoted 2 lines

Review

Quoted 2 lines
meta/recipes-devtools/dnf/dnf_4.2.2.bb +1 -0
+}
(quoted diff) +0 -0

b/meta/recipes-devtools/libdnf/libdnf_0.28.1.bb

Quoted 4 lines

meta/recipes-devtools/libdnf/libdnf_0.28.1.bb EXTRA_OECMAKE_append_class-nativesdk = "

Quoted 4 lines

index 882c435b32..5c9326ca64 100644

meta/recipes-devtools/libdnf/libdnf_0.28.1.bb +0 -0
@@ -27,3 +27,10 @@ EXTRA_OECMAKE_append_class-nativesdk = "

-DWITH_GIR=OFF"

Quoted 9 lines

meta/recipes-devtools/libdnf/libdnf_0.28.1.bb EXTRA_OECMAKE_append_class-nativesdk = " -DWITH_GIR=OFF"

Quoted 9 lines
meta/recipes-devtools/libdnf/libdnf_0.28.1.bb +6 -0
 BBCLASSEXTEND = "native nativesdk"
 
+python () {
+    pkgb = d.getVar("PACKAGE_CLASSES")
+    pkgn = d.getVar("PN")
+    pkgv = d.getVar("PV")
+    if "package_rpm" not in pkgb:
+        raise bb.parse.SkipPackage("%s-%s Needs rpmdb support in

libsolv" % (pkgn, pkgv))

Quoted 9 lines
Quoted 9 lines
meta/recipes-devtools/libdnf/libdnf_0.28.1.bb +1 -1
+}
--

2.25.0

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

author
#5 lore raw
Quoted 3 lines · Martin Jansa

Will this work for you without anonymous python? I think it should.

PNBLACKLIST[dnf] ?= "${@oe.utils.conditional('PACKAGE_CLASSES', 'package_rpm', '' 'does not build correctly without package_rpm in PACKAGE_CLASSES', d)}"

I like this better than anon python. Perhaps worth it in a v2

Quoted 106 lines · On Wed, Feb 12, 2020 at 4:12 PM Khem Raj <[email protected]…
    On Tue, Feb 11, 2020 at 11:11 PM Alexander Kanavin
    <[email protected] <mailto:[email protected]>> wrote:
     >
     > Please let’s try to avoid anonymous python. What problem does
    this solve? If package_rpm is not enabled, then there should not be
    a dependency chain that builds these anyway.

    for non rpm backend opkg, rpm is pulled in which is not desired
    because opkg depends on libsolv
    and libsolv by default depends on rpm which I sent another patch to
    decouple, This caused opkg images to fail tests because testing infra
    found rpm in the image and ran tests for it which obviously would
    fail.

      libsolv does have rpm support as packageconfig but when that
    is disabled then libdnf does not build anymore since it expects rpmdb
    support in libsolv.

    so when we do world builds with opkg as package management then dnf
    and libdbf starts to fail
    due to their RPM needs.

    IF there was an override to identity packaging backends then we could
    have used that

    If you have better suggestions to avoid anon python here, I am all ears.

     >
     > Alex
     >
     > On Wed 12. Feb 2020 at 6.20, Khem Raj <[email protected]
    <mailto:[email protected]>> wrote:
     >>
     >> dnf does not work with opkg or dpkg/apt anyway
     >>
     >> Signed-off-by: Khem Raj <[email protected]
    <mailto:[email protected]>>
     >> ---
     >>  meta/recipes-devtools/dnf/dnf_4.2.2.bb <http://dnf_4.2.2.bb>   
         | 8 ++++++++
     >>  meta/recipes-devtools/libdnf/libdnf_0.28.1.bb
    <http://libdnf_0.28.1.bb> | 7 +++++++
     >>  2 files changed, 15 insertions(+)
     >>
     >> diff --git a/meta/recipes-devtools/dnf/dnf_4.2.2.bb
    <http://dnf_4.2.2.bb> b/meta/recipes-devtools/dnf/dnf_4.2.2.bb
    <http://dnf_4.2.2.bb>
     >> index f38167f1ad..9e6d5741af 100644
     >> --- a/meta/recipes-devtools/dnf/dnf_4.2.2.bb <http://dnf_4.2.2.bb>
     >> +++ b/meta/recipes-devtools/dnf/dnf_4.2.2.bb <http://dnf_4.2.2.bb>
     >> @@ -84,3 +84,11 @@ SYSTEMD_SERVICE_${PN} =
    "dnf-makecache.service dnf-makecache.timer \
     >>                           dnf-automatic-notifyonly.service
    dnf-automatic-notifyonly.timer \
     >>  "
     >>  SYSTEMD_AUTO_ENABLE ?= "disable"
     >> +
     >> +python () {
     >> +    pkgb = d.getVar("PACKAGE_CLASSES")
     >> +    pkgn = d.getVar("PN")
     >> +    pkgv = d.getVar("PV")
     >> +    if "package_rpm" not in pkgb:
     >> +        raise bb.parse.SkipPackage("%s-%s Needs rpmdb support
    in libsolv" % (pkgn, pkgv))
     >> +}
     >> diff --git a/meta/recipes-devtools/libdnf/libdnf_0.28.1.bb
    <http://libdnf_0.28.1.bb>
    b/meta/recipes-devtools/libdnf/libdnf_0.28.1.bb
    <http://libdnf_0.28.1.bb>
     >> index 882c435b32..5c9326ca64 100644
     >> --- a/meta/recipes-devtools/libdnf/libdnf_0.28.1.bb
    <http://libdnf_0.28.1.bb>
     >> +++ b/meta/recipes-devtools/libdnf/libdnf_0.28.1.bb
    <http://libdnf_0.28.1.bb>
     >> @@ -27,3 +27,10 @@ EXTRA_OECMAKE_append_class-nativesdk = "
    -DWITH_GIR=OFF"
     >>
     >>  BBCLASSEXTEND = "native nativesdk"
     >>
     >> +python () {
     >> +    pkgb = d.getVar("PACKAGE_CLASSES")
     >> +    pkgn = d.getVar("PN")
     >> +    pkgv = d.getVar("PV")
     >> +    if "package_rpm" not in pkgb:
     >> +        raise bb.parse.SkipPackage("%s-%s Needs rpmdb support
    in libsolv" % (pkgn, pkgv))
     >> +}
     >> --
     >> 2.25.0
     >>
     >> --
     >> _______________________________________________
     >> Openembedded-core mailing list
     >> [email protected]
    <mailto:[email protected]>
     >> http://lists.openembedded.org/mailman/listinfo/openembedded-core
    -- 
    _______________________________________________
    Openembedded-core mailing list
    [email protected]
    <mailto:[email protected]>
    http://lists.openembedded.org/mailman/listinfo/openembedded-core