summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex@linutronix.de>2025-06-16 11:49:58 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-06-20 12:07:26 +0100
commit4dd321f8b83afecd962393101b2a6861275b5265 (patch)
treef3d668847457a1f55ee54b8cb2f287c7d2fa1b81
parent4547232c71590797af75b59a9890d38b61ff7890 (diff)
downloadpoky-4dd321f8b83afecd962393101b2a6861275b5265.tar.gz
insane/do_qa_unpack: add checks that ensure S is set correctly
The checks are fatal, as this avoids rather more cryptic errors further down the build. Example: ERROR: gnu-config-native-20240823+git-r0 do_unpack: Recipes that set S = "${WORKDIR}/git" or S = "${UNPACKDIR}/git" should remove that assignment, as S set by bitbake.conf in oe-core now works. ERROR: perlcross-native-1.6.2-r0 do_unpack: S should be set relative to UNPACKDIR, e.g. replace WORKDIR with UNPACKDIR in "S = ${WORKDIR}/perl-cross-${PV}" Dropping the S = ${WORKDIR}/git assignment (addressing the first error) can be done with a single sed command when there is a lot of recipes: sed -i "/^S = \"\${WORKDIR}\/git\"/d" `find . -name *.bb -o -name *.inc -o -name *.bbclass` Replacing WORKDIR with UNPACKDIR can be done similarly, but should be done after the removals: sed -i "s/^S = \"\${WORKDIR}\//S = \"\${UNPACKDIR}\//g" `find . -name *.bb -o -name *.inc -o -name *.bbclass` (From OE-Core rev: 46480a5e66747a673041fe4452a0ab14a1736d5e) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes-global/insane.bbclass8
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass
index c45650291f..4ef664b3ce 100644
--- a/meta/classes-global/insane.bbclass
+++ b/meta/classes-global/insane.bbclass
@@ -1431,6 +1431,14 @@ Rerun configure task after fixing this."""
1431python do_qa_unpack() { 1431python do_qa_unpack() {
1432 src_uri = d.getVar('SRC_URI') 1432 src_uri = d.getVar('SRC_URI')
1433 s_dir = d.getVar('S') 1433 s_dir = d.getVar('S')
1434 s_dir_orig = d.getVar('S', False)
1435
1436 if s_dir_orig == '${WORKDIR}/git' or s_dir_orig == '${UNPACKDIR}/git':
1437 bb.fatal('Recipes that set S = "${WORKDIR}/git" or S = "${UNPACKDIR}/git" should remove that assignment, as S set by bitbake.conf in oe-core now works.')
1438
1439 if '${WORKDIR}' in s_dir_orig:
1440 bb.fatal('S should be set relative to UNPACKDIR, e.g. replace WORKDIR with UNPACKDIR in "S = {}"'.format(s_dir_orig))
1441
1434 if src_uri and not os.path.exists(s_dir): 1442 if src_uri and not os.path.exists(s_dir):
1435 bb.warn('%s: the directory %s (%s) pointed to by the S variable doesn\'t exist - please set S within the recipe to point to where the source has been unpacked to' % (d.getVar('PN'), d.getVar('S', False), s_dir)) 1443 bb.warn('%s: the directory %s (%s) pointed to by the S variable doesn\'t exist - please set S within the recipe to point to where the source has been unpacked to' % (d.getVar('PN'), d.getVar('S', False), s_dir))
1436} 1444}