All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] insane: Add test for native/nativesdk inherit order
@ 2021-01-24  9:55 Tomasz Dziendzielski
  2021-01-24  9:55 ` [PATCH 2/2] meta: Fix native inheritance order in recipes Tomasz Dziendzielski
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Tomasz Dziendzielski @ 2021-01-24  9:55 UTC (permalink / raw)
  To: openembedded-core; +Cc: Tomasz Dziendzielski

Classes native/nativesdk should be inherited last to prevent unexpected
behaviour.

[YOCTO #5729]

Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
---
 meta/classes/insane.bbclass | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 105d2a5ce8..3597943ddd 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -27,7 +27,7 @@ WARN_QA ?= " libdir xorg-driver-abi \
             infodir build-deps src-uri-bad symlink-to-sysroot multilib \
             invalid-packageconfig host-user-contaminated uppercase-pn patch-fuzz \
             mime mime-xdg unlisted-pkg-lics unhandled-features-check \
-            missing-update-alternatives \
+            missing-update-alternatives native-last \
             "
 ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
             perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
@@ -1366,6 +1366,32 @@ python () {
         d.setVarFlag('do_package_qa', 'rdeptask', '')
     for i in issues:
         package_qa_handle_error("pkgvarcheck", "%s: Variable %s is set as not being package specific, please fix this." % (d.getVar("FILE"), i), d)
+
+    for native_class in ['native', 'nativesdk']:
+        if bb.data.inherits_class(native_class, d):
+
+            inherited_classes = d.getVar('__inherit_cache', False) or []
+            needle = os.path.join('classes', native_class)
+
+            bbclassextend = (d.getVar('BBCLASSEXTEND') or '').split()
+            # BBCLASSEXTEND items are always added in the end
+            skip_classes = bbclassextend
+            if bb.data.inherits_class('native', d) or 'native' in bbclassextend:
+                # native also inherits nopackages and relocatable bbclasses
+                skip_classes.extend(['nopackages', 'relocatable'])
+
+            for class_item in reversed(inherited_classes):
+                if needle not in class_item:
+                    for extend_item in skip_classes:
+                        if os.path.join('classes', '%s.bbclass' % extend_item) in class_item:
+                            break
+                    else:
+                        pn = d.getVar('PN')
+                        package_qa_handle_error("native-last", "%s: native/nativesdk class is not inherited last, this can result in unexpected behaviour. " % pn, d)
+                        break
+                else:
+                    break
+
     qa_sane = d.getVar("QA_SANE")
     if not qa_sane:
         bb.fatal("Fatal QA errors found, failing task.")
-- 
2.29.2


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

end of thread, other threads:[~2021-02-22  9:32 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-24  9:55 [PATCH 1/2] insane: Add test for native/nativesdk inherit order Tomasz Dziendzielski
2021-01-24  9:55 ` [PATCH 2/2] meta: Fix native inheritance order in recipes Tomasz Dziendzielski
2021-01-27 19:11 ` [OE-core] [PATCH 1/2] insane: Add test for native/nativesdk inherit order Martin Jansa
2021-01-27 19:54   ` Tomasz Dziendzielski
     [not found]   ` <165E2EBA5493813B.12137@lists.openembedded.org>
2021-01-27 21:36     ` Tomasz Dziendzielski
2021-02-11  7:21 ` Konrad Weihmann
2021-02-11 10:30   ` Tomasz Dziendzielski
2021-02-12 18:26     ` Peter Kjellerstedt
2021-02-12 23:12       ` Richard Purdie
2021-02-11 11:43   ` Richard Purdie
2021-02-11 12:10     ` Konrad Weihmann
2021-02-11 13:04       ` Richard Purdie
2021-02-11 14:47         ` Konrad Weihmann
2021-02-11 14:59           ` Richard Purdie
2021-02-11 15:12             ` Konrad Weihmann
     [not found]             ` <1662BA34B045612A.24722@lists.openembedded.org>
2021-02-22  9:31               ` Konrad Weihmann

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.