sanity.bbclass: check if PSEUDO_IGNORE_PATHS and ${S} overlap
PATCH 1/1 sanity.bbclass: check if PSEUDO_IGNORE_PATHS and ${S} overlap
added a sanity check for when PSEUDO_IGNORE_PATHS and ${S} overlap to avoid random failures generated.
[YOCTO #14193]
--- meta/classes/sanity.bbclass | 8 ++++++++ 1 file changed, 8 insertions(+)
meta/classes/sanity.bbclass +8 -0
@@ -710,6 +710,14 @@ def check_sanity_version_change(status, d): 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") + # Check if PSEUDO_IGNORE_PATHS and ${S} overlap + pseudoignorepaths = d.getVar('PSEUDO_IGNORE_PATHS', expand=True).split(",") + sourcefile = d.getVar('S') + for i in pseudoignorepaths: + if i and sourcefile: + if sourcefile.startswith(i) or i.startswith(sourcefile): + status.addresult("a path included in PSEUDO_IGNORE_PATHS " + str(i) + " and ${S} (source files) path " + str(sourcefile) + " are overlapping each other, please set ${S} in your recipe to point to a different directory. \n") + # Some third-party software apparently relies on chmod etc. being suid root (!!) import stat suid_check_bins = "chown chmod mknod".split()
Signature · 1 line
2.17.1
Review
Quoted 2 lines
(quoted diff) +2
-0+ # Check if PSEUDO_IGNORE_PATHS and ${S} overlap + pseudoignorepaths = d.getVar('PSEUDO_IGNORE_PATHS',
expand=True).split(",")
meta/classes/sanity.bbclass def check_sanity_version_change(status, d):
Quoted 5 lines
meta/classes/sanity.bbclass +5
-0+ sourcefile = d.getVar('S') + for i in pseudoignorepaths: + if i and sourcefile: + if sourcefile.startswith(i) or i.startswith(sourcefile): + status.addresult("a path included in PSEUDO_IGNORE_PATHS
" + str(i) + " and ${S} (source files) path " + str(sourcefile) + " are overlapping each other, please set ${S} in your recipe to point to a different directory. \n")
Isn't ${S} added to PSEUDO_IGNORE_PATHS almost every time in meta/classes/base.bbclass?
if os.path.normpath(d.getVar("WORKDIR")) !=
os.path.normpath(d.getVar("S")):
d.appendVar("PSEUDO_IGNORE_PATHS", ",${S}")Best regards,
Tomasz Dziendzielski
Hmm, thanks for spotting this, I think that was an oversight on my part. IMHO i think this patch should apply to cases where {WORKDIR} = {S}. so i'll make some changes to the patch soon.
Thanks,
Dorinda.
Quoted 21 lines · Tomasz Dziendzielski
Review
Quoted 2 lines
(quoted diff) +2
-0+ # Check if PSEUDO_IGNORE_PATHS and ${S} overlap + pseudoignorepaths = d.getVar('PSEUDO_IGNORE_PATHS',expand=True).split(",")
meta/classes/sanity.bbclass def check_sanity_version_change(status, d):
Quoted 5 lines
meta/classes/sanity.bbclass +5
-0+ sourcefile = d.getVar('S') + for i in pseudoignorepaths: + if i and sourcefile: + if sourcefile.startswith(i) or i.startswith(sourcefile): + status.addresult("a path included in PSEUDO_IGNORE_PATHS" + str(i) + " and ${S} (source files) path " + str(sourcefile) + " are overlapping each other, please set ${S} in your recipe to point to a different directory. \n")
Isn't ${S} added to
PSEUDO_IGNORE_PATHSalmost every time in meta/classes/base.bbclass?if os.path.normpath(d.getVar("WORKDIR")) != os.path.normpath(d.getVar("S")): d.appendVar("PSEUDO_IGNORE_PATHS", ",${S}")Best regards,
Tomasz Dziendzielski