<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>14179</bug_id>
          
          <creation_ts>2021-01-09 09:27:29 +0000</creation_ts>
          <short_desc>Need to validate user isn&apos;t building in a PSEUDO_IGNORE_PATHS</short_desc>
          <delta_ts>2021-01-29 14:59:02 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>3.3</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>NEWCOMER</status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>3.3 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Richard Purdie">richard.purdie</reporter>
          <assigned_to name="Dorinda">dorindabassey</assigned_to>
          <cc>dorindabassey</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>yf3yu</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>88897</commentid>
    <comment_count>0</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2021-01-09 09:27:29 +0000</bug_when>
    <thetext>If a user builds in a path in PSEUDO_IGNORE_PATHS we need to error from a sanity test in sanity.bbclass rather than give them random failures.

A recent example was an openbmi user building in /usr/local.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88953</commentid>
    <comment_count>1</comment_count>
    <who name="Dorinda">dorindabassey</who>
    <bug_when>2021-01-17 21:25:19 +0000</bug_when>
    <thetext>Hi, Would adding this check in the function in sanity.bbclass suffice?

def check_sanity_everybuild(status, d):

    # Check that user isn&apos;t building in PSEUDO_IGNORE_PATHS
    pseudoignorepaths = d.getVar(&apos;PSEUDO_IGNORE_PATHS&apos;).split(&quot;,&quot;)
    workdir = d.getVar(&apos;WORKDIR&apos;)
    for i in pseudoignorepaths:
        if(i in workdir):
            status.addresult(&quot;you are building in a path under PSEUDO_IGNORE_PATHS, please remove this&quot; + str(i) + &quot;directory in \nParsed WORKDIR: &quot; + str(workdir) + &quot;\n&quot;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88957</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2021-01-19 15:54:02 +0000</bug_when>
    <thetext>I think rather than &quot;i in workdir&quot;, you might want to use:

if workdir.startswith(i):

but otherwise it looks good to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88958</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2021-01-19 15:54:41 +0000</bug_when>
    <thetext>Oh, also, do we need to run this test everybuild? I think we already test when tmpdir changes so we probably don&apos;t need to.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88959</commentid>
    <comment_count>4</comment_count>
    <who name="Yi Fan Yu">yf3yu</who>
    <bug_when>2021-01-19 16:01:15 +0000</bug_when>
    <thetext>looks like Dorinda did the work for me.
I&apos;ll new to the project so I&apos;ll try to come up with my own solution.

Dorinda,
Feel free to send your patch in though, I can also run some tests</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88960</commentid>
    <comment_count>5</comment_count>
    <who name="Dorinda">dorindabassey</who>
    <bug_when>2021-01-19 17:48:11 +0000</bug_when>
    <thetext>Ok i get Thanks, so since workdir path already begins with tmpdir, then it might be better to add this under the conditional statement that checks when tmpdir changes:

                # Also Check that user isn&apos;t building in PSEUDO_IGNORE_PATHS
                pseudoignorepaths = d.getVar(&apos;PSEUDO_IGNORE_PATHS&apos;).split(&quot;,&quot;)
                for i in pseudoignorepaths:
                    if tmpdir.startswith(i):
                        status.addresult(&quot;your tmpdir also contains a PSEUDO_IGNORE_PATHS, please remove this&quot; + str(i) + &quot;directory in \nParsed TMPDIR: &quot; + str(tmpdir) + &quot;\n&quot;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88961</commentid>
    <comment_count>6</comment_count>
    <who name="Dorinda">dorindabassey</who>
    <bug_when>2021-01-19 17:55:36 +0000</bug_when>
    <thetext>oh Alright Yi Fan Yu, i will send a patch in due time thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88962</commentid>
    <comment_count>7</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-01-19 17:58:55 +0000</bug_when>
    <thetext>Let&apos;s make this official since Dorinda is working on this bug.  Thanks Dorinda.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88965</commentid>
    <comment_count>8</comment_count>
    <who name="Yi Fan Yu">yf3yu</who>
    <bug_when>2021-01-19 18:43:45 +0000</bug_when>
    <thetext>Since I won&apos;t be working on this anymore,

Here might be something to keep in mind with PSEUDO_IGNORE_PATH
-variables are included in the PSEUDO_IGNORE_PATH  
`${BUILDHISTORY_DIR}` and  `${CCACHE_DIR}`</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88966</commentid>
    <comment_count>9</comment_count>
    <who name="Yi Fan Yu">yf3yu</who>
    <bug_when>2021-01-19 18:59:52 +0000</bug_when>
    <thetext>More things...

-just doing `i in list` can cause issues such as if i am building in
   `home/NAME/usr/b/` the sanity check might trigger since it found `/usr`

-I think it makes sense just inserting it in `check_sanity_version_change(..)` 
    so it runs basically once.

    only issue I see is that a person might move everything to a suspicious directory after a build. -_-</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88968</commentid>
    <comment_count>10</comment_count>
    <who name="Dorinda">dorindabassey</who>
    <bug_when>2021-01-20 10:41:09 +0000</bug_when>
    <thetext>Okay i see, thank you Yi Fan Yu, took note of your points hence am adding this in 
check_sanity_version_change(status, d):

    # Check that user isn&apos;t building in PSEUDO_IGNORE_PATHS
    pseudoignorepaths = d.getVar(&apos;PSEUDO_IGNORE_PATHS&apos;, expand=True).split(&quot;,&quot;)
    workdir = d.getVar(&apos;WORKDIR&apos;, expand=True)
    for i in pseudoignorepaths:
        if workdir.startswith(i):
            status.addresult(&quot;you are building in a path under PSEUDO_IGNORE_PATHS, please remove this&quot; + str(i) + &quot;directory in \nParsed WORKDIR: &quot; + str(workdir) + &quot;\n&quot;)

i should submit a patch soon.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89073</commentid>
    <comment_count>11</comment_count>
    <who name="Dorinda">dorindabassey</who>
    <bug_when>2021-01-29 01:45:52 +0000</bug_when>
    <thetext>patch submitted to mailing list @
https://lists.openembedded.org/g/openembedded-core/message/147238?p=,,,20,0,0,0::Created,,verify+that+user,20,2,0,80117826</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89082</commentid>
    <comment_count>12</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-01-29 14:59:02 +0000</bug_when>
    <thetext>Thanks Dorinda.
Next time please provide a link to the commit since not all submissions to the emails list are merged. This one is on master:
http://cgit.openembedded.org/openembedded-core/commit/?id=7a681525e904914e938de25df5cc64209097d15d</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>