]> code.ossystems Code Review - openembedded-core.git/commitdiff
sanity: Verify that user isn't building in PSEUDO_IGNORE_PATHS
authorDorinda <dorindabassey@gmail.com>
Tue, 26 Jan 2021 00:53:47 +0000 (01:53 +0100)
committerAnuj Mittal <anuj.mittal@intel.com>
Mon, 1 Feb 2021 05:43:10 +0000 (13:43 +0800)
If a user builds in a path in PSEUDO_IGNORE_PATHS, random failures
are generated. Hence this patch adds a sanity check in sanity.bbclass
to ensure that a user isn't building in PSEUDO_IGNORE_PATHS.

[YOCTO #14179]

(From OE-Core rev: 7a681525e904914e938de25df5cc64209097d15d)

Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit bfeeaf9ff148a61868e0c882b7455dc02ca8ed76)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
meta/classes/sanity.bbclass

index 3262d08fbfe5f5140418d27e87b6f444482dbc3c..0e7ad45c94e190089a136c8805dc35b3b1a68f7d 100644 (file)
@@ -703,6 +703,13 @@ def check_sanity_version_change(status, d):
     if (tmpdirmode & stat.S_ISUID):
         status.addresult("TMPDIR is setuid, please don't build in a setuid directory")
 
+    # Check that a user isn't building in a path in PSEUDO_IGNORE_PATHS
+    pseudoignorepaths = d.getVar('PSEUDO_IGNORE_PATHS', expand=True).split(",")
+    workdir = d.getVar('WORKDIR', expand=True)
+    for i in pseudoignorepaths:
+        if i and workdir.startswith(i):
+            status.addresult("You are building in a path included in PSEUDO_IGNORE_PATHS " + str(i) + " please locate the build outside this path.\n")
+
     # Some third-party software apparently relies on chmod etc. being suid root (!!)
     import stat
     suid_check_bins = "chown chmod mknod".split()