<?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>11239</bug_id>
          
          <creation_ts>2017-03-24 14:03:14 +0000</creation_ts>
          <short_desc>native recipes should not care about DISTRO_FEATURES / MACHINE_FEATURES</short_desc>
          <delta_ts>2017-04-13 16:12:13 +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.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>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.3 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jussi Kukkonen">jku</reporter>
          <assigned_to name="Jussi Kukkonen">jku</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>ross.burton</cc>
          
          
          <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>71693</commentid>
    <comment_count>0</comment_count>
    <who name="Jussi Kukkonen">jku</who>
    <bug_when>2017-03-24 14:03:14 +0000</bug_when>
    <thetext>Currently a change in DISTRO_FEATURES means we end up rebuilding a bunch native recipes. So far I have not found a single feature where this would be useful: maybe we can just define a constant set of features that will always be used for -native?

I&apos;m looking at this next week, filing now as reminder.

For background, here&apos;s a list of distro features we refer to in oe-core (possibly not 100% exhaustive). Most of the libc- ones should probably be removed: none of our libcs respect those.

---
3g
acl
alsa
api-documentation
argp
bluetooth
bluez5
bssplt
cramfs
directfb
efi
ext2
gobject-introspection-data
ipsec
ipv4
ipv6
irda
largefile
ldconfig
ld-is-gold
libc-backtrace
libc-big-macros
libc-bsd
libc-catgets
libc-charsets
libc-crypt
libc-crypt-ufc
libc-cxx-tests
libc-db-aliases
libc-envz
libc-fcvt
libc-fmtmsg
libc-fstab
libc-ftraverse
libc-getlogin
libc-idn
libc-inet
libc-inet-anl
libc-libm
libc-locale-code
libc-locales
libc-memusage
libc-nis
libc-nsswitch
libc-posix-clang-wchar
libc-posix-regexp
libc-posix-regexp-glibc
libc-posix-wchar-io
libc-rcmd
libc-rtld-debug
libc-spawn
libc-streams
libc-sunrpc
libc-utmp
libc-utmpx
libc-wordexp
mplt
multiarch
nfc
nfs
nls
opengl
pam
pci
pcmcia
ppp
ptest
pulseaudio
selinux
smbfs
systemd
sysvinit
usbgadget
usbhost
wayland
wifi
x11
xattr
zeroconf</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71744</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2017-03-27 14:05:46 +0000</bug_when>
    <thetext>I think the main one we might care about in the native case is largefile which we&apos;d always want turn on and we&apos;re likely deprecating anyway (in favour of always enabled).

I can&apos;t see much of a case for not fixing the native list of features. I also agree that the libc ones are pretty much dead now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72096</commentid>
    <comment_count>2</comment_count>
    <who name="Jussi Kukkonen">jku</who>
    <bug_when>2017-04-05 08:23:50 +0000</bug_when>
    <thetext>This really stretches my understanding of bitbake variables... documenting some details:

My initial approach is just to modify DISTRO_FEATURES (and if needed other variables) in native.bbclass. This turned out to be tricky:

* DISTRO_FEATURES = &quot;&lt;features we want for native&gt;&quot; 
This will be overriden by at least DISTRO_FEATURES_append in any configuration as well as DISTRO_FEATURES_BACKFILL. This makes sense to me.

* DISTRO_FEATURES_forcevariable = &quot;&lt;features we want for native&gt;&quot;
Same results -- appends and backfill still get added to the list. I don&apos;t really understand why.

* anonymous python with d.setVar(&quot;DISTRO_FEATURES&quot;, &quot;&lt;features we want for native&gt;&quot;)
This is so ugly but does ensure DISTRO_FEATURES is correct when tasks run. Unfortunately there are other anonymous python functions that do d.getVar(&quot;DISTRO_FEATURES&quot;) and end up getting the wrong value and modifying the build based on that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72102</commentid>
    <comment_count>3</comment_count>
    <who name="Jussi Kukkonen">jku</who>
    <bug_when>2017-04-05 17:20:17 +0000</bug_when>
    <thetext>On Richards suggestion I tried d.SetVar() in native_virtclass_handler(): this seems to work. My test case was:
 $ bitbake core-image-minimal
 # append &quot; systemd&quot; to DISTRO_FEATURES
 $ bitbake core-image-minimal

With a native_virtclass_handler patch the second build had 135 tasks less to do. Sadly this doesn&apos;t show up in wallclock time: all the native tasks are done while glibc is still bottlenecking everything else. I&apos;m sure there is a effect on cpu-time, I just didn&apos;t take note of it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72107</commentid>
    <comment_count>4</comment_count>
    <who name="Jussi Kukkonen">jku</who>
    <bug_when>2017-04-05 20:03:42 +0000</bug_when>
    <thetext>I redid the tests with timing:
 $ bitbake core-image-minimal
 # append &quot; systemd&quot; to DISTRO_FEATURES
 $ bitbake core-image-minimal


With master the second build was:
real    15m23.533s
user    135m19.244s
sys     16m55.816s

After patching:
real    14m48.574s
user    94m31.776s
sys     13m54.560s


user+sys difference is -44 minutes or -28% so definitely worth it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72480</commentid>
    <comment_count>5</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2017-04-13 16:05:38 +0000</bug_when>
    <thetext>oe-core 731744d5538e315702be828e6f2bd556309dee07 solves this for DISTRO_FEATURES.

oe-core 96c20c9df714cdf3f0e9461ec566c4f5d3bdb5f1 solves the native case for MACHINE_FEATURES.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72481</commentid>
    <comment_count>6</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2017-04-13 16:12:13 +0000</bug_when>
    <thetext>I *think* we&apos;re done with this. Closing!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>