<?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>8585</bug_id>
          
          <creation_ts>2015-10-27 11:13:03 +0000</creation_ts>
          <short_desc>Improve detection of missing host dependencies</short_desc>
          <delta_ts>2016-04-01 17:16:11 +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>2.0</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>2.1 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Eggleton">bluelightning</reporter>
          <assigned_to name="Bill Randle">bill.randle</assigned_to>
          <cc>alexandru.c.georgescu</cc>
    
    <cc>bill.randle</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>ross.burton</cc>
          
          <qa_contact name="Daniel Istrate">daniel.alexandrux.istrate</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>55810</commentid>
    <comment_count>0</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-10-27 11:13:03 +0000</bug_when>
    <thetext>We have several checks in sanity.bbclass to verify that certain tools are installed on the host. A while back we decided to make these checks run only once and then we stamp that they are done and effectively never run them again unless TMPDIR gets deleted or we bump SANITY_VERSION.

As far as I can tell we have never bumped SANITY_VERSION, despite having adjusted the dependencies and checks numerous times. Additionally, users have occasionally removed packages or upgraded their distributions and then find slightly obscure errors that are traced to these tools being missing; had the checks been run the issue would have been spotted immediately.

I&apos;d like to re-evaluate how long these checks actually take and if it&apos;s still too expensive to run them every time, it would be nice if we could at least somehow detect when a distro upgrade has taken place and trigger re-running all of the sanity checks if it has.

Additionally, we might consider using some sort of signature in conf/sanity_info so that if e.g. SANITY_REQUIRED_UTILITIES changed then the corresponding check would be re-run automatically rather than us having to remember to bump SANITY_VERSION.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55811</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2015-10-27 11:18:00 +0000</bug_when>
    <thetext>Surely checking $PATH for ten binaries can&apos;t take that long, even in the context of just the metadata parse, and memory-resident bitbake will only need to perform the check at startup anyway.

Marking medium+ 2.1M2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58231</commentid>
    <comment_count>2</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-01-26 13:26:06 +0000</bug_when>
    <thetext>check_sanity_version_changed() takes my machine 2.8 seconds, 2.7 seconds of which is the &quot;am I online&quot; test as that hits both the main Yocto download site and bugzilla.

Removing bugzilla from CONNECTIVITY_URLS so it just pings the main yocto download site reduces the time taken to 1 second.  Changing the URL to just google.com reduces the time for the connectivity test to 0.2s.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58232</commentid>
    <comment_count>3</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-01-26 14:18:21 +0000</bug_when>
    <thetext>Some real numbers:

NOTE: connectivity took 0.156 seconds
NOTE: sanity took 0.316 seconds

The connectivity ping to google.com took 0.156 seconds, and check_sanity_version_changed() (including the ping) took 0.316 seconds.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58247</commentid>
    <comment_count>4</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-01-26 17:26:11 +0000</bug_when>
    <thetext>Adding Richard to the CC as he has strong opinions that bitbake startup shouldn&apos;t be slower.  Fight!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58452</commentid>
    <comment_count>5</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-02-02 14:45:13 +0000</bug_when>
    <thetext>Connectivity check change was merged in meta-yocto b253c6073be44090a19d1743deb58ef566853056.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58458</commentid>
    <comment_count>6</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2016-02-02 15:44:40 +0000</bug_when>
    <thetext>I believe we already have far too much junk/busy work going on with bitbake startup already. Memory resident bitbake might change that but we&apos;re not there yet.

Even then, I don&apos;t think we want to check all these things every time, just in case. We should however get more diligent about bumping SANITY_VERSION, or use the checksums mechanism we now have to test when to rerun the sanity tests. We could save NATIVELSBSTRING to detect distro upgrades?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58471</commentid>
    <comment_count>7</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2016-02-02 19:43:49 +0000</bug_when>
    <thetext>Yes - I think we should definitely use NATIVELSBSTRING to force the checks to re-execute, and we should be bumping SANITY_VERSION pretty much every time we change the checks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60256</commentid>
    <comment_count>8</comment_count>
      <attachid>3054</attachid>
    <who name="Bill Randle">bill.randle</who>
    <bug_when>2016-03-22 00:47:33 +0000</bug_when>
    <thetext>Created attachment 3054
Proposed fix using NATIVELSBSTRING

Here&apos;s a proposed fix for your consideration. It uses a change in NATIVELSBSTRING to flag a recheck. The true value of NATIVELSBSTRING is saved in the sanity_info file.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60300</commentid>
    <comment_count>9</comment_count>
    <who name="Bill Randle">bill.randle</who>
    <bug_when>2016-03-22 17:27:06 +0000</bug_when>
    <thetext>Patch submitted to OE mailing list.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60696</commentid>
    <comment_count>10</comment_count>
    <who name="Bill Randle">bill.randle</who>
    <bug_when>2016-04-01 17:16:11 +0000</bug_when>
    <thetext>Merged to master and verified by Richard Purdie.

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta/classes/sanity.bbclass?id=e33124f828d0cd2dd600fff3f6ad3dc98d2723a1</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>3054</attachid>
            <date>2016-03-22 00:47:33 +0000</date>
            <delta_ts>2016-03-22 00:47:33 +0000</delta_ts>
            <desc>Proposed fix using NATIVELSBSTRING</desc>
            <filename>bug_8585_proposed_fix</filename>
            <type>text/plain</type>
            <size>2358</size>
            <attacher name="Bill Randle">bill.randle</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL21ldGEvY2xhc3Nlcy9zYW5pdHkuYmJjbGFzcyBiL21ldGEvY2xhc3Nlcy9z
YW5pdHkuYmJjbGFzcwppbmRleCA1OTdmM2RlLi5mYWRhZDFiIDEwMDY0NAotLS0gYS9tZXRhL2Ns
YXNzZXMvc2FuaXR5LmJiY2xhc3MKKysrIGIvbWV0YS9jbGFzc2VzL3Nhbml0eS5iYmNsYXNzCkBA
IC02NDEsOSArNjQxLDkgQEAgZGVmIGNoZWNrX3Nhbml0eV9zc3RhdGVfZGlyX2NoYW5nZShzc3Rh
dGVfZGlyLCBkYXRhKToKICAgICByZXR1cm4gdGVzdG1zZwogICAgICAgIAogZGVmIGNoZWNrX3Nh
bml0eV92ZXJzaW9uX2NoYW5nZShzdGF0dXMsIGQpOgotICAgICMgU2FuaXR5IGNoZWNrcyB0byBi
ZSBkb25lIHdoZW4gU0FOSVRZX1ZFUlNJT04gY2hhbmdlcworICAgICMgU2FuaXR5IGNoZWNrcy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