[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&#39;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, &quot;Richard Purdie&quot; &lt;<a \
href="mailto:richard.purdie@linuxfoundation.org">richard.purdie@linuxfoundation.org</a>&gt; \
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> &gt; added a sanity check for when \
PSEUDO_IGNORE_PATHS and ${S} overlap to avoid random failures generated.<br> &gt; \
<br> &gt; [YOCTO #14193]<br>
&gt; <br>
&gt; Signed-off-by: Dorinda Bassey &lt;<a \
href="mailto:dorindabassey@gmail.com">dorindabassey@gmail.com</a>&gt;<br> &gt; \
---<br> &gt; v2:<br>
&gt; added a condition for when {WORKDIR}={S}<br>
&gt; <br>
&gt;   meta/classes/sanity.bbclass | 10 ++++++++++<br>
&gt;   1 file changed, 10 insertions(+)<br>
&gt; <br>
&gt; diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass<br>
&gt; index c6842ff549..63284b7917 100644<br>
&gt; --- a/meta/classes/sanity.bbclass<br>
&gt; +++ b/meta/classes/sanity.bbclass<br>
&gt; @@ -710,6 +710,16 @@ def check_sanity_version_change(<wbr>status, d):<br>
&gt;                   if i and workdir.startswith(i):<br>
&gt;                           status.addresult(<wbr>&quot;You are building in a path \
included in PSEUDO_IGNORE_PATHS &quot; + str(i) + &quot; please locate the build \
outside this path.\n&quot;)<br> &gt;   <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; +      # Check if PSEUDO_IGNORE_PATHS and ${S} overlap<br>
&gt; +      pseudoignorepaths = d.getVar(&#39;PSEUDO_IGNORE_PATHS&#39;<wbr>, \
expand=True).split(&quot;,&quot;)<br> &gt; +      workdir = \
d.getVar(&#39;WORKDIR&#39;)<br> &gt; +      sourcefile = d.getVar(&#39;S&#39;)<br>
&gt; +      if (workdir == sourcefile):<br>
&gt; +            for i in pseudoignorepaths:<br>
&gt; +                  if i and sourcefile:<br>
&gt; +                        if sourcefile.startswith(i) or \
i.startswith(sourcefile):<br> &gt; +                              \
status.addresult(&quot;a path included in PSEUDO_IGNORE_PATHS &quot; + str(i) + \
&quot; and ${S} (source files) path &quot; + str(sourcefile) + &quot; are overlapping \
each other, please set ${S} in your recipe to point to a different directory. \
\n&quot;)<br> &gt; +<br>
&gt;           # Some third-party software apparently relies on chmod etc. being suid \
root (!!)<br> &gt;           import stat<br>
&gt;           suid_check_bins = &quot;chown chmod mknod&quot;.split()<br>
<br>
<br>
</div>This isn&#39;t quite solving the problem in bug 14193. In that bug lets<br>
say:<br>
<br>
S = &quot;${WORKDIR}/pack&quot;<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