summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorTomasz Dziendzielski <tomasz.dziendzielski@gmail.com>2021-01-24 10:55:45 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-01-27 10:17:45 +0000
commit0f0c0df63391b95b35e7a71176e672ed92add610 (patch)
treeb6361b6f6b3069d02328c57787caae61b2eb7181 /meta/classes
parenta2a34451c933ce0084c5f59dba6c125b9d32eb6a (diff)
downloadpoky-0f0c0df63391b95b35e7a71176e672ed92add610.tar.gz
insane: Add test for native/nativesdk inherit order
Classes native/nativesdk should be inherited last to prevent unexpected behaviour. [YOCTO #5729] (From OE-Core rev: 55a0197fe62577fd51d41d87822e6d64d85c7680) Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/insane.bbclass28
1 files changed, 27 insertions, 1 deletions
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 \
27 infodir build-deps src-uri-bad symlink-to-sysroot multilib \ 27 infodir build-deps src-uri-bad symlink-to-sysroot multilib \
28 invalid-packageconfig host-user-contaminated uppercase-pn patch-fuzz \ 28 invalid-packageconfig host-user-contaminated uppercase-pn patch-fuzz \
29 mime mime-xdg unlisted-pkg-lics unhandled-features-check \ 29 mime mime-xdg unlisted-pkg-lics unhandled-features-check \
30 missing-update-alternatives \ 30 missing-update-alternatives native-last \
31 " 31 "
32ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \ 32ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
33 perms dep-cmp pkgvarcheck perm-config perm-line perm-link \ 33 perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
@@ -1366,6 +1366,32 @@ python () {
1366 d.setVarFlag('do_package_qa', 'rdeptask', '') 1366 d.setVarFlag('do_package_qa', 'rdeptask', '')
1367 for i in issues: 1367 for i in issues:
1368 package_qa_handle_error("pkgvarcheck", "%s: Variable %s is set as not being package specific, please fix this." % (d.getVar("FILE"), i), d) 1368 package_qa_handle_error("pkgvarcheck", "%s: Variable %s is set as not being package specific, please fix this." % (d.getVar("FILE"), i), d)
1369
1370 for native_class in ['native', 'nativesdk']:
1371 if bb.data.inherits_class(native_class, d):
1372
1373 inherited_classes = d.getVar('__inherit_cache', False) or []
1374 needle = os.path.join('classes', native_class)
1375
1376 bbclassextend = (d.getVar('BBCLASSEXTEND') or '').split()
1377 # BBCLASSEXTEND items are always added in the end
1378 skip_classes = bbclassextend
1379 if bb.data.inherits_class('native', d) or 'native' in bbclassextend:
1380 # native also inherits nopackages and relocatable bbclasses
1381 skip_classes.extend(['nopackages', 'relocatable'])
1382
1383 for class_item in reversed(inherited_classes):
1384 if needle not in class_item:
1385 for extend_item in skip_classes:
1386 if os.path.join('classes', '%s.bbclass' % extend_item) in class_item:
1387 break
1388 else:
1389 pn = d.getVar('PN')
1390 package_qa_handle_error("native-last", "%s: native/nativesdk class is not inherited last, this can result in unexpected behaviour. " % pn, d)
1391 break
1392 else:
1393 break
1394
1369 qa_sane = d.getVar("QA_SANE") 1395 qa_sane = d.getVar("QA_SANE")
1370 if not qa_sane: 1396 if not qa_sane:
1371 bb.fatal("Fatal QA errors found, failing task.") 1397 bb.fatal("Fatal QA errors found, failing task.")