[prev in list] [next in list] [prev in thread] [next in thread]
List: openembedded-core
Subject: Re: [OE-core] [PATCH v2] sanity.bbclass: check if PSEUDO_IGNORE_PATHS and ${S} overlap
From: "Dorinda" <dorindabassey () gmail ! com>
Date: 2021-01-31 21:15:10
Message-ID: CAJSnhzszhvySJQizqP4HtWyDh2kZCAnDrRtA5TFm1a80ekQuCg () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Alright, I understand Thanks.
I've added the directories under pseudo control and sent a v3 patch to the
list.
Thanks,
Dorinda.
On Jan 30, 2021 12:01, "Richard Purdie" <richard.purdie@linuxfoundation.org>
wrote:
On Thu, 2021-01-28 at 20:51 +0100, Dorinda wrote:
> added a sanity check for when PSEUDO_IGNORE_PATHS and ${S} overlap to
avoid random failures generated.
>
> [YOCTO #14193]
>
> Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com>
> ---
> v2:
> added a condition for when {WORKDIR}={S}
>
> meta/classes/sanity.bbclass | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
> index c6842ff549..63284b7917 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 ${S} overlap
> + pseudoignorepaths = d.getVar('PSEUDO_IGNORE_PATHS',
expand=True).split(",")
> + workdir = d.getVar('WORKDIR')
> + sourcefile = d.getVar('S')
> + if (workdir == sourcefile):
> + 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()
This isn't quite solving the problem in bug 14193. In that bug lets
say:
S = "${WORKDIR}/pack"
and this overlaps with ${WORKDIR}/package (PKGD) and
${WORKDIR}/packages-split (PKGDEST) which are set in package.bbclass.
So the sanity test we need here is to test whether any element of
PSEUDO_IGNORE_PATHS overlaps with directories we know need to be under
pseudo control. Qi already had a list of these in a different patch:
${D},${PKGD},${PKGDEST},${IMAGE_ROOTFS},${SDK_OUTPUT}
Cheers,
Richard
[Attachment #5 (text/html)]
<div dir="auto"><div>Alright, I understand Thanks.<div dir="auto">I've added the \
directories under pseudo control and sent a v3 patch to the list.</div><div \
dir="auto"><br></div><div dir="auto">Thanks,</div><div \
dir="auto">Dorinda.</div><br><div class="gmail_extra"><br><div class="gmail_quote">On \
Jan 30, 2021 12:01, "Richard Purdie" <<a \
href="mailto:richard.purdie@linuxfoundation.org">richard.purdie@linuxfoundation.org</a>> \
wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="elided-text">On Thu, \
2021-01-28 at 20:51 +0100, Dorinda wrote:<br> > added a sanity check for when \
PSEUDO_IGNORE_PATHS and ${S} overlap to avoid random failures generated.<br> > \
<br> > [YOCTO #14193]<br>
> <br>
> Signed-off-by: Dorinda Bassey <<a \
href="mailto:dorindabassey@gmail.com">dorindabassey@gmail.com</a>><br> > \
---<br> > v2:<br>
> added a condition for when {WORKDIR}={S}<br>
> <br>
> meta/classes/sanity.bbclass | 10 ++++++++++<br>
> 1 file changed, 10 insertions(+)<br>
> <br>
> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass<br>
> index c6842ff549..63284b7917 100644<br>
> --- a/meta/classes/sanity.bbclass<br>
> +++ b/meta/classes/sanity.bbclass<br>
> @@ -710,6 +710,16 @@ def check_sanity_version_change(<wbr>status, d):<br>
> if i and workdir.startswith(i):<br>
> status.addresult(<wbr>"You are building in a path \
included in PSEUDO_IGNORE_PATHS " + str(i) + " please locate the build \
outside this path.\n")<br> > <br>
> <br>
> <br>
> <br>
> + # Check if PSEUDO_IGNORE_PATHS and ${S} overlap<br>
> + pseudoignorepaths = d.getVar('PSEUDO_IGNORE_PATHS'<wbr>, \
expand=True).split(",")<br> > + workdir = \
d.getVar('WORKDIR')<br> > + sourcefile = d.getVar('S')<br>
> + if (workdir == sourcefile):<br>
> + for i in pseudoignorepaths:<br>
> + if i and sourcefile:<br>
> + if sourcefile.startswith(i) or \
i.startswith(sourcefile):<br> > + \
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")<br> > +<br>
> # Some third-party software apparently relies on chmod etc. being suid \
root (!!)<br> > import stat<br>
> suid_check_bins = "chown chmod mknod".split()<br>
<br>
<br>
</div>This isn't quite solving the problem in bug 14193. In that bug lets<br>
say:<br>
<br>
S = "${WORKDIR}/pack"<br>
<br>
and this overlaps with ${WORKDIR}/package (PKGD) and<br>
${WORKDIR}/packages-split (PKGDEST) which are set in package.bbclass.<br>
<br>
So the sanity test we need here is to test whether any element of<br>
PSEUDO_IGNORE_PATHS overlaps with directories we know need to be under<br>
pseudo control. Qi already had a list of these in a different patch:<br>
<br>
${D},${PKGD},${PKGDEST},${<wbr>IMAGE_ROOTFS},${SDK_OUTPUT}<br>
<br>
Cheers,<br>
<br>
Richard<br>
<br>
<br>
<br>
</blockquote></div><br></div></div></div>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#147497): https://lists.openembedded.org/g/openembedded-core/message/147497
Mute This Topic: https://lists.openembedded.org/mt/80192676/4454766
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [openembedded-core@marc.info]
-=-=-=-=-=-=-=-=-=-=-=-
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic