* [PATCH v3] sanity.bbclass: check if PSEUDO_IGNORE_PATHS and paths under pseudo control overlap
@ 2021-01-31 19:26 Dorinda
2021-01-31 21:50 ` [OE-core] " Richard Purdie
0 siblings, 1 reply; 3+ messages in thread
From: Dorinda @ 2021-01-31 19:26 UTC (permalink / raw
To: openembedded-core; +Cc: dorindabassey
added a sanity check for when PSEUDO_IGNORE_PATHS and paths under pseudo control overlap to avoid random failures generated.
[YOCTO #14193]
Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com>
---
v3:
changed commit log
changed the conditional statement for sanity check
meta/classes/sanity.bbclass | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index c6842ff549..a64d15166f 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -710,6 +710,16 @@ 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 and paths under pseudo control overlap
+ pseudoignorepaths = d.getVar('PSEUDO_IGNORE_PATHS', expand=True).split(",")
+ pseudo_control_dir = "${D},${PKGD},${PKGDEST},${IMAGEROOTFS},${SDK_OUTPUT}"
+ pseudocontroldir = d.getVar('pseudo_control_dir', expand=True).split(",")
+ for i in pseudoignorepaths:
+ for j in pseudocontroldir:
+ if i and j:
+ if j.startswith(i):
+ status.addresult("a path included in PSEUDO_IGNORE_PATHS " + str(i) + " and the path " + str(j) + " are overlapping each other, please set this path " + str(j) + " 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()
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [OE-core] [PATCH v3] sanity.bbclass: check if PSEUDO_IGNORE_PATHS and paths under pseudo control overlap
2021-01-31 19:26 [PATCH v3] sanity.bbclass: check if PSEUDO_IGNORE_PATHS and paths under pseudo control overlap Dorinda
@ 2021-01-31 21:50 ` Richard Purdie
2021-02-01 3:18 ` Dorinda
0 siblings, 1 reply; 3+ messages in thread
From: Richard Purdie @ 2021-01-31 21:50 UTC (permalink / raw
To: Dorinda, openembedded-core
On Sun, 2021-01-31 at 14:26 -0500, Dorinda wrote:
>
> + # Check if PSEUDO_IGNORE_PATHS and and paths under pseudo control overlap
> + pseudoignorepaths = d.getVar('PSEUDO_IGNORE_PATHS', expand=True).split(",")
> + pseudo_control_dir = "${D},${PKGD},${PKGDEST},${IMAGEROOTFS},${SDK_OUTPUT}"
> + pseudocontroldir = d.getVar('pseudo_control_dir', expand=True).split(",")
I'm not sure that would actually work without a setVar as
pseudo_control_dir isn't a variable.
What you probably want is:
pseudocontroldir = d.expand(pseudo_control_dir, expand=True).split(",")
How did you test this? Did you try setting S = "${WORKDIR}/pack" in a
recipe to ensure it correctly detects the issue?
> + for i in pseudoignorepaths:
> + for j in pseudocontroldir:
> + if i and j:
> + if j.startswith(i):
> + status.addresult("a path included in PSEUDO_IGNORE_PATHS " + str(i) + " and the path " + str(j) + " are overlapping each other, please set this path " + str(j) + " to point to a different directory. \n")
How about improving this to:
'''
A path in PSEUDO_IGNORE_PATHS " + str(i) + " and the path " + str(j) +
" overlap and this will break pseudo permission and ownership tracking.
Please set the path " + str(j) + " to a different directory which does
not overlap with pseudo controlled directories.
'''
Cheers,
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [OE-core] [PATCH v3] sanity.bbclass: check if PSEUDO_IGNORE_PATHS and paths under pseudo control overlap
2021-01-31 21:50 ` [OE-core] " Richard Purdie
@ 2021-02-01 3:18 ` Dorinda
0 siblings, 0 replies; 3+ messages in thread
From: Dorinda @ 2021-02-01 3:18 UTC (permalink / raw
To: Richard Purdie; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 1630 bytes --]
I agree.
Thanks for the helpful hints here, will be more thorough in future patches
:)
Thanks,
Dorinda
On Jan 31, 2021 22:50, "Richard Purdie" <richard.purdie@linuxfoundation.org>
wrote:
On Sun, 2021-01-31 at 14:26 -0500, Dorinda wrote:
>
> + # Check if PSEUDO_IGNORE_PATHS and and paths under pseudo control
overlap
> + pseudoignorepaths = d.getVar('PSEUDO_IGNORE_PATHS',
expand=True).split(",")
> + pseudo_control_dir = "${D},${PKGD},${PKGDEST},${
IMAGEROOTFS},${SDK_OUTPUT}"
> + pseudocontroldir = d.getVar('pseudo_control_dir',
expand=True).split(",")
I'm not sure that would actually work without a setVar as
pseudo_control_dir isn't a variable.
What you probably want is:
pseudocontroldir = d.expand(pseudo_control_dir, expand=True).split(",")
How did you test this? Did you try setting S = "${WORKDIR}/pack" in a
recipe to ensure it correctly detects the issue?
> + for i in pseudoignorepaths:
> + for j in pseudocontroldir:
> + if i and j:
> + if j.startswith(i):
> + status.addresult("a path included in
PSEUDO_IGNORE_PATHS " + str(i) + " and the path " + str(j) + " are
overlapping each other, please set this path " + str(j) + " to point to a
different directory. \n")
How about improving this to:
'''
A path in PSEUDO_IGNORE_PATHS " + str(i) + " and the path " + str(j) +
" overlap and this will break pseudo permission and ownership tracking.
Please set the path " + str(j) + " to a different directory which does
not overlap with pseudo controlled directories.
'''
Cheers,
Richard
[-- Attachment #2: Type: text/html, Size: 2474 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-02-01 3:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-31 19:26 [PATCH v3] sanity.bbclass: check if PSEUDO_IGNORE_PATHS and paths under pseudo control overlap Dorinda
2021-01-31 21:50 ` [OE-core] " Richard Purdie
2021-02-01 3:18 ` Dorinda
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.