<?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>2421</bug_id>
          
          <creation_ts>2012-05-04 13:33:09 +0000</creation_ts>
          <short_desc>[Performance] Further improvements for turning off doc generation for -native (and similar) packages</short_desc>
          <delta_ts>2017-06-13 10:52:25 +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>Meta-yocto</product>
          <component>meta-yocto</component>
          <version>1.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></status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Richard Purdie">richard.purdie</reporter>
          <assigned_to name="Unassigned">unassigned</assigned_to>
          <cc>elizabeth.flanagan</cc>
    
    <cc>max.eliaser</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>ross.burton</cc>
    
    <cc>sgw</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>21104</commentid>
    <comment_count>0</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2012-05-04 13:33:09 +0000</bug_when>
    <thetext>There is no point in generating documentation for -native packages (or -cross for that matter). We should see if this gives any performance improvement (both speed and size of sstate in particular), If so, it would be good to add PACKAGECONFIG[doc] entries to recipes and default to turning this flag off in the native case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42483</commentid>
    <comment_count>1</comment_count>
    <who name="Max Eliaser">max.eliaser</who>
    <bug_when>2014-04-09 23:26:30 +0000</bug_when>
    <thetext>Okay, I&apos;ve been looking into</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42558</commentid>
    <comment_count>2</comment_count>
    <who name="Max Eliaser">max.eliaser</who>
    <bug_when>2014-04-10 17:12:28 +0000</bug_when>
    <thetext>I&apos;ve</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42561</commentid>
    <comment_count>3</comment_count>
    <who name="Max Eliaser">max.eliaser</who>
    <bug_when>2014-04-10 17:49:51 +0000</bug_when>
    <thetext>Sorry about those comment fragments. I&apos;m still new here.

Anyway, I&apos;ve been looking into this, and I&apos;ve made some discoveries.

A consequence of the design of PACKAGECONFIG is that none of the flags can be default-on. If a flag is not specified, that means &quot;off,&quot; not &quot;don&apos;t know if off or on, can use default.&quot; So the flag will have to be &quot;no-doc&quot; instead. Also, PACKAGECONFIG supports configure flags only with Autotools, CMake, and Waf-- recipies that use other build systems only get the build and run-time dependencies. For example, Perl&apos;s Module::Build seems to have a really clean separation of docs and code, but you can&apos;t get configure flags to it with PACKAGECONFIG as far as I can tell. Anyway, I&apos;m just focusing on Autotools for now.

Defining the no-doc flag in the Autotools class is easy, then it&apos;s a matter of setting the flag on by default in every -native and -cross recipe that uses Autotools. I&apos;ve identified 59 such recipies, and will start making those changes now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43152</commentid>
    <comment_count>4</comment_count>
    <who name="Max Eliaser">max.eliaser</who>
    <bug_when>2014-05-07 17:00:21 +0000</bug_when>
    <thetext>OK, all recipes (native or otherwise) that require the texinfo utilities in order to build now inherit texinfo.bbclass. In trunk right now, texinfo.bbclass is still blank. 

In the poky-contrib repository, I&apos;ve got a branch meliaser/texinfo-build that adds a texinfo-dummy-native recipe. This recipe has a set of &quot;fake&quot; texinfo utilities that install to a subdir and can then be conditionally used or not used by altering the PATH. These programs suppress documentation generation by simply not doing anything when they are invoked, save for creating some blank output files. (NOTE: some upstream projects use other programs from outside the Texinfo suite, like groff and pod2man, and these are neither intercepted nor suppressed by texinfo-dummy-native.)

I&apos;ve experimented with different combinations of using the texinfo-native recipe we ship, the texinfo-dummy-native recipe I&apos;ve added, and the host system&apos;s texinfo utils, to see which combinations have the best performance. Different combinations can be achieved by putting different code in texinfo.bbclass.

All comparisons are based on the time to build eglibc with a clean sstate-cache and working directory:
    rm -rf /yoctostate/sstate-cache/ tmp/
    time bitbake -k eglibc
I believe eglibc must be built before any of the other target architecture recipes, making it a major bottleneck and a good way to isolate the compilation time of the native and cross toolchain. That justifies its use as a benchmark. 

Since I was also doing other stuff with my workstation while running these timing runs, I&apos;d say the fastest run in each configuration is probably closest to the true number.

Completely blank texinfo.bbclass, imitating the status quo:
Run 1:
    real	15m8.546s
    user	70m5.365s
    sys	13m56.883s
Run 2:
    real	15m17.377s
    user	69m49.976s
    sys	13m56.380s
Run 3:
    real	15m13.980s
    user	70m5.775s
    sys	13m58.166s

With changes to texinfo.bbclass to suppress doc gen for -native:
Code:
    TEXDEP = &quot;texinfo-native&quot;
    TEXDEP_class-native = &quot;texinfo-dummy-native&quot;
    DEPENDS_append = &quot; ${TEXDEP}&quot;
    PATH_prepend_class-native = &quot;${STAGING_BINDIR_NATIVE}/texinfo-dummy-native:&quot;
Run 1:
    real	15m25.430s
    user	70m17.126s
    sys	14m6.556s
Run 2:
    real	15m38.784s
    user	70m2.807s
    sys	14m6.507s
Run 3: 
    real	15m32.600s
    user	70m32.279s
    sys	14m7.440s

Suppressing doc gen for -native *and* -cross:
Code:
    TEXDEP = &quot;texinfo-native&quot;
    TEXDEP_class-native = &quot;texinfo-dummy-native&quot;
    TEXDEP_class-cross = &quot;texinfo-dummy-native&quot;
    DEPENDS_append = &quot; ${TEXDEP}&quot;
    PATH_prepend_class-native = &quot;${STAGING_BINDIR_NATIVE}/texinfo-dummy-native:&quot;
    PATH_prepend_class-cross = &quot;${STAGING_BINDIR_NATIVE}/texinfo-dummy-native:&quot;
Run 1:
    real	15m4.869s
    user	70m26.672s
    sys	14m15.161s
Run 2:
    real	15m23.064s
    user	70m50.325s
    sys	14m16.383s
Run 3:
    real	15m2.125s
    user	70m28.214s
    sys	14m26.571s

Suppressing doc gen for *all* recipes: (NOTE: this saves building texinfo-native, which is likely the main source of the speedup)
Code:
    DEPENDS_append = &quot; texinfo-dummy-native&quot;
    PATH_prepend = &quot;${STAGING_BINDIR_NATIVE}/texinfo-dummy-native:&quot;
Run 1:
    real	14m14.873s
    user	68m43.605s
    sys	13m57.721s
Run 2:
    real	14m21.572s
    user	68m43.443s
    sys	13m58.856s
Run 3:
    real	14m21.632s
    user	68m41.563s
    sys	13m55.674s

Suppressing doc gen for -native and -cross, doc gen using host system&apos;s texinfo for target arch:
Code:
    DEPENDS_append_class-native = &quot; texinfo-dummy-native&quot;
    DEPENDS_append_class-cross = &quot; texinfo-dummy-native&quot;
    PATH_prepend_class-native = &quot;${STAGING_BINDIR_NATIVE}/texinfo-dummy-native:&quot;
    PATH_prepend_class-cross = &quot;${STAGING_BINDIR_NATIVE}/texinfo-dummy-native:&quot;
Run 1:
    real	14m49.500s
    user	69m28.189s
    sys	14m8.641s
Run 2:
    real	14m54.150s
    user	69m14.851s
    sys	14m9.262s
Run 3:
    real	15m5.754s
    user	69m23.275s
    sys	14m10.814s</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43346</commentid>
    <comment_count>5</comment_count>
    <who name="Max Eliaser">max.eliaser</who>
    <bug_when>2014-05-14 21:26:34 +0000</bug_when>
    <thetext>At Richard Purdie&apos;s suggestion, the final code is a variation on the 3rd test case of the previous post, but with texinfo-native added to ASSUME_PROVIDED, which causes it to behave identically to the last test case. I only did one timing run, and the results are close to what I was expecting:
    real	14m42.082s
    user	69m21.533s
    sys	14m4.483s
Pretty much in the same range as the last test case of my previous comment. 

I am submitting a patch series with this code now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45380</commentid>
    <comment_count>6</comment_count>
    <who name="Max Eliaser">max.eliaser</who>
    <bug_when>2014-09-03 22:13:12 +0000</bug_when>
    <thetext>Unassigning this bug given my pending departure. The texinfo stuff works well, but there are other systems, like groff, that could also be attacked. Perl&apos;s module build system (which we have a class for already) has a really clean way to disable documentation building that could be used. 

Ignore references to a universal Autotools configure flag to disable doc generation, as mentioned in previous comments. It doesn&apos;t exist.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74047</commentid>
    <comment_count>7</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2017-06-13 10:52:25 +0000</bug_when>
    <thetext>There&apos;s now an api-documentation DISTRO_FEATURE which the manpages and gtk-doc classes respect and turn off for native.  I consider this closed and there&apos;s now a standard way to do it.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>