<?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>5442</bug_id>
          
          <creation_ts>2013-11-01 06:40:06 +0000</creation_ts>
          <short_desc>sanity.bbclass: check TMPDIR is not on nfs</short_desc>
          <delta_ts>2014-03-26 14:29:21 +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>1.6</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>26 March 2014: Setting documentation flag to &quot;Done.&quot;</status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>1.6 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Robert Yang">liezhi.yang</reporter>
          <assigned_to name="Robert Yang">liezhi.yang</assigned_to>
          <cc>mark.hatle</cc>
    
    <cc>mcrapet</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
    
    <cc>srifenbark</cc>
    
    <cc>tudor.florea</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Done (doc changes complete)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>38412</commentid>
    <comment_count>0</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2013-11-01 06:40:06 +0000</bug_when>
    <thetext>From RP:
Only specific directories are expected to work on nfs, not the whole tmpdir,  basically SSTATE_DIR and DL_DIR. There is an argument for making DEPLOY_DIR work on nfs too but it currently doesn&apos;t.

Then we will add a check in sanity.bbclass to check TMPDIR is not on nfs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39928</commentid>
    <comment_count>1</comment_count>
      <attachid>1738</attachid>
    <who name="Matthieu Crapet">mcrapet</who>
    <bug_when>2014-01-20 13:18:41 +0000</bug_when>
    <thetext>Created attachment 1738
v1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39929</commentid>
    <comment_count>2</comment_count>
    <who name="Matthieu Crapet">mcrapet</who>
    <bug_when>2014-01-20 13:19:38 +0000</bug_when>
    <thetext>Here is my proposal. I chose to use oe.utils.getstatusoutput instead of subprocess.Popen for more portability.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39967</commentid>
    <comment_count>3</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2014-01-21 14:53:51 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Here is my proposal. I chose to use oe.utils.getstatusoutput instead of
&gt; subprocess.Popen for more portability.

Hi Matthieu,

Thank you very much for taking care of this, it seems that the &quot;stat -f -c&quot; is a little better to check the nfs, I had sent a patch for it on Nov. 1st, 2013, but it had been pending because of where to put the checking, I will update it a little and re-send it again.

http://lists.openembedded.org/pipermail/openembedded-core/2013-November/085833.html

Thank you very much again.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39972</commentid>
    <comment_count>4</comment_count>
    <who name="Matthieu Crapet">mcrapet</who>
    <bug_when>2014-01-21 15:11:15 +0000</bug_when>
    <thetext>Hi Robert,

stat is indeed better. But I was wondering if NFS was the only network
filesystem with troubles (for example Coda or CIFS?).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39977</commentid>
    <comment_count>5</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2014-01-21 15:27:34 +0000</bug_when>
    <thetext>It&apos;s not actually &quot;NFS&quot; that the problem occurs.  It&apos;s any filesystem that doesn&apos;t have consistent inodes and/or doesn&apos;t honor all of the locking and related items that POSIX dictates for a Unix-like filesystem.

NFS just seems to be the biggest offender as it usually violates both locking and inode consistency.

I&apos;m not sure if any of the other network filesystems have a similar problem or not, but until someone has a problem -- it&apos;s not easy to check for.

(The old reiserfs had the inode issue as well, at least original versions of it did..)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>40224</commentid>
    <comment_count>6</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2014-02-07 06:08:58 +0000</bug_when>
    <thetext>Merged into master:
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=47208175027686339dd18df52b60ec2c43594918</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41525</commentid>
    <comment_count>7</comment_count>
    <who name="Tudor Florea">tudor.florea</who>
    <bug_when>2014-03-20 13:51:21 +0000</bug_when>
    <thetext>I&apos;m having a hard time understanding what was the initial problem that was solved by checking nfs is not used for TMPDIR. I&apos;ve created various poky based images on tnf without apparent issue so far. 
Thank you.
  Tudor</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41530</commentid>
    <comment_count>8</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2014-03-20 14:23:03 +0000</bug_when>
    <thetext>(In reply to comment #7)

Most NFS systems have significant issues with inode number re-use as well as issues with POSIX locking.

When doing a build where the TMPDIR is on NFS, pseudo (the fake root user wrapper) can fail to properly identify the files being used and their faked permissions, owners and groups.  This will lead to the file itself being properly created, but when packaged the permissions can be incorrect.

If you inspect the logs, you will find that various pseudo diagnostic warnings will occur where it was unable to identify the initial creator of the file, so it has to assume something based on either the inode number or the file path.  (Since inode numbers are reused, this doesn&apos;t always work.)

Locking is a similar issue in that RPM, bitbake, pseudo and other components require functional POSIX locking.  Some NFS systems appear to work, while others don&apos;t work reliably.  There does not appear to be any way to reliably detect if the locking is working before it simply fails.

Thus you can run your builds with your configured &apos;build&apos; directory on NFS, but the TMPDIR -must- be on a filesystem with proper</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41578</commentid>
    <comment_count>9</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2014-03-21 14:57:51 +0000</bug_when>
    <thetext>Hi, 

I dropped in a note in the insane.bbclass section of the reference manual stating that the class did not support tests on TMPDIR when it is on NFS.  I don&apos;t know if this note is sufficient or not to take care of the documentation part of this issue. 

Mark.. could you review the note and see if I need to add any more detail or clarity to what is going on?  For one thing, I don&apos;t know the consequences if TMPDIR is on NFS.  Do the tests just not get run?  I would like to state something about that in the note.

See the change here - http://www.yoctoproject.org/docs/1.6/ref-manual/ref-manual.html#ref-classes-insane

Thanks, 
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41581</commentid>
    <comment_count>10</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2014-03-21 16:40:15 +0000</bug_when>
    <thetext>(In reply to comment #9)
&gt; See the change here -
&gt; http://www.yoctoproject.org/docs/1.6/ref-manual/ref-manual.html#ref-classes-
&gt; insane


Thats not correct..  It&apos;s actually the sanity class that this change affects.

Specifically:

sanity.bbclass:
+    # Check that TMPDIR isn&apos;t located on nfs
+    status.addresult(check_not_nfs(tmpdir, &quot;TMPDIR&quot;))

So I think you should revert your documentation change.  Instead make reference somewhere in the docs (1.3 maybe? or maybe 3.1) that the TMPDIR must reside on a local disk as NFS isn&apos;t supported.  This is due to limitations and bugs within the NFS protocol and many NFS implementations.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41720</commentid>
    <comment_count>11</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2014-03-25 18:43:54 +0000</bug_when>
    <thetext>Mark, 

Thanks for the correction.  I took the change out of the insane class but left an explanation in the TMPDIR variable in the glossary at http://www.yoctoproject.org/docs/1.6/ref-manual/ref-manual.html#var-TMPDIR.

Regarding another important place where we might like this note I was thinking of where we define the term &quot;Build Directory&quot; since that is where TMPDIR will ultimately be.  Throughout the YP manual set, the term &quot;Build Directory&quot; is linked liberally back to this definition.

http://www.yoctoproject.org/docs/1.6/dev-manual/dev-manual.html#build-directory

How does this sound?

Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41721</commentid>
    <comment_count>12</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2014-03-25 19:00:48 +0000</bug_when>
    <thetext>(In reply to comment #11)
&gt; Mark, 
&gt; 
&gt; Thanks for the correction.  I took the change out of the insane class but
&gt; left an explanation in the TMPDIR variable in the glossary at
&gt; http://www.yoctoproject.org/docs/1.6/ref-manual/ref-manual.html#var-TMPDIR.
&gt; 
&gt; Regarding another important place where we might like this note I was
&gt; thinking of where we define the term &quot;Build Directory&quot; since that is where
&gt; TMPDIR will ultimately be.  Throughout the YP manual set, the term &quot;Build
&gt; Directory&quot; is linked liberally back to this definition.
&gt; 
&gt; http://www.yoctoproject.org/docs/1.6/dev-manual/dev-manual.html#build-
&gt; directory

I think that is correct.  The on caveat is that the TMPDIR is by default within the build-directory -- but does not have to be.  This is where the notion of setting the TMPDIR to a local disk, and using NFS for the build-directory comes into play.

--Mark</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41722</commentid>
    <comment_count>13</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2014-03-25 19:08:58 +0000</bug_when>
    <thetext>Mark, 

Good point on TMPDIR purposely getting set outside the build directory.  I will bring that caveat up in the explanation... probably both in the term and in the TMPDIR glossary entry.  

When I get the changes in I will comment with some links for review. 

thanks, 
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41769</commentid>
    <comment_count>14</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2014-03-26 13:35:06 +0000</bug_when>
    <thetext>Mark, 

Please look at these two areas now and see if we are good for this doc part of the bug:

http://www.yoctoproject.org/docs/1.6/ref-manual/ref-manual.html#var-TMPDIR

http://www.yoctoproject.org/docs/1.6/dev-manual/dev-manual.html#build-directory

Thanks, 
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41772</commentid>
    <comment_count>15</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2014-03-26 14:24:47 +0000</bug_when>
    <thetext>(In reply to comment #14)
&gt; Please look at these two areas now and see if we are good for this doc part
&gt; of the bug:
&gt; 
&gt; http://www.yoctoproject.org/docs/1.6/ref-manual/ref-manual.html#var-TMPDIR
&gt; 
&gt; http://www.yoctoproject.org/docs/1.6/dev-manual/dev-manual.html#build-
&gt; directory

I think the above properly explains the issue.  New users may still be a bit confused -- but I don&apos;t see an easier way of explaining things.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41774</commentid>
    <comment_count>16</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2014-03-26 14:29:21 +0000</bug_when>
    <thetext>Thanks Mark, 

New users in a state of confusion is a constant :)

I am resetting the doc flag to &quot;Done.&quot;

Scott</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>1738</attachid>
            <date>2014-01-20 13:18:41 +0000</date>
            <delta_ts>2014-01-20 13:18:41 +0000</delta_ts>
            <desc>v1</desc>
            <filename>0001-sanity.bbclass-check-TMPDIR-is-not-on-nfs.patch</filename>
            <type>text/plain</type>
            <size>2076</size>
            <attacher name="Matthieu Crapet">mcrapet</attacher>
            
              <data encoding="base64">RnJvbSA4MjQ1OGRkMzE4ZjFjYWU4ZTZjNjA5ZDFiOTg3OTNmOTc2YjBhNTc4IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBNYXR0aGlldSBDcmFwZXQgPE1hdHRoaWV1LkNyYXBldEBpbmdl
bmljby5jb20+CkRhdGU6IE1vbiwgMjAgSmFuIDIwMTQgMTU6MTA6MzEgKzAxMDAKU3ViamVjdDog
W1BBVENIXSBzYW5pdHkuYmJjbGFzczog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