<?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>11552</bug_id>
          
          <creation_ts>2017-05-22 09:28:31 +0000</creation_ts>
          <short_desc>wic: avoid unnecessary dependencies</short_desc>
          <delta_ts>2017-07-18 10:39:37 +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>Scripts and Tools</component>
          <version>unspecified</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.4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Patrick Ohly">patrick.ohly</reporter>
          <assigned_to name="Ed Bartosh">eduard.bartosh</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>mikko.ylinen</cc>
    
    <cc>ross.burton</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>73402</commentid>
    <comment_count>0</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2017-05-22 09:28:31 +0000</bug_when>
    <thetext>At the moment, when building images with IMAGE_FSTYPES=wic one ends up depending on wic-tools and thus syslinux and grub-efi even when not using those at all. Ideally, building an image with wic should only build the tools and components really needed.

The problem is that &quot;wic-tools&quot; is needed also for the manual invocations of wic, in which case everything that might be needed has to be built in advance.

Proposal: &quot;wic-tools&quot; should be reserved for this &quot;use wic manually&quot; case and automatic building via bitbake should use something else (&quot;wic-tools-light&quot;) or no wic-tools at all.

Then &quot;manual mode&quot; uses wic as a generic tool that works for multiple images (at the expense of having to build things with might not be needed), while building through bitbake can be as efficient as possible for the desired images.

A &quot;wic-tools-light&quot; could be used to stage content that is absolutely needed for all images, which might be a bit more efficient than staging them once per image. Remains to be seen...

Has implications on documentation because users of the manual mode need to know that they have to build &quot;wic-tools&quot; - details to be provided by Ed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73403</commentid>
    <comment_count>1</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-05-22 09:35:57 +0000</bug_when>
    <thetext>I&apos;ll try to completely remove dependency to wic-tools from image_types_wic.bbclass. All dependencies should be brought by the image recipe I believe.

sic-tools will be left for usage only in manual mode, i.e. when wic is run by user as a command line tool.

Does this make sense for you?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73404</commentid>
    <comment_count>2</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2017-05-22 09:46:49 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; Does this make sense for you?

Yes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74671</commentid>
    <comment_count>3</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2017-06-30 06:18:41 +0000</bug_when>
    <thetext>To capture a discussion I had with Ed on IRC:
- Dependencies depend (sic) on the actual .wks file that is used,
  not the image recipe. So together with setting a WKS_FILE, one also
  has to set the corresponding WKS_FILE_DEPENDS.
- Removing the default dependencies brought in via the current wic-tools
  would break image recipes that currently do not set WKS_FILE_DEPENDS.
  Therefore we need a WKS_FILE_DEPENDS default that mirrors the &quot;common&quot;
  tools that might be needed by a .wks file. Then nothing breaks
  and developers can set more restrictive dependencies when (and if)
  they care.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74672</commentid>
    <comment_count>4</comment_count>
    <who name="Mikko Ylinen">mikko.ylinen</who>
    <bug_when>2017-06-30 06:29:52 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt;   Therefore we need a WKS_FILE_DEPENDS default that mirrors the &quot;common&quot;
&gt;   tools that might be needed by a .wks file. Then nothing breaks
&gt;   and developers can set more restrictive dependencies when (and if)
&gt;   they care.

Looks like we could try this already now in refkit. WKS_FILE_DEPENDS has been there since RSS was introduced (based on a quick git blame check). Why wic-tools was needed in the first place?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74677</commentid>
    <comment_count>5</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-06-30 07:23:24 +0000</bug_when>
    <thetext>we decided to use wic-tools in a rush to fix RSS issues. At that time it seemed to be acceptable compromise that works in both modes - when wic is run by bitbake and when it&apos;s run manually.

Now it looks like this is not that acceptable anymore and we need to do something better than quick workaround.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74681</commentid>
    <comment_count>6</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-06-30 14:15:37 +0000</bug_when>
    <thetext>Looks like we have a problem here.

Adding dependency to image recipe doesn&apos;t generally mean that it will be available from its sysroot. That breaks wic as it can&apos;t find bootloader artifacts.

For example, adding 
WKS_FILE_DEPENDS_append_x86 = &quot; syslinux grub-efi systemd-boot&quot;
to image_types_wic.bbclass doesn&apos;t make grub-efi to appear in its sysroot.
However, doing the same for wic-tools does the trick:

$ bitbake core-image-minimal wic-tools
$ find ./tmp/ -name x86_64-efi
./tmp/work/core2-64-poky-linux/grub-efi/2.02-r0/sysroot-destdir/usr/lib/grub/x86_64-efi
./tmp/work/x86_64-linux/wic-tools/1.0-r0/recipe-sysroot/usr/lib/grub/x86_64-efi
./tmp/sysroots-components/core2-64/grub-efi/usr/lib/grub/x86_64-efi


I think it&apos;s because wic-tools considered as a native package, but image recipies are not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74682</commentid>
    <comment_count>7</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-06-30 14:35:24 +0000</bug_when>
    <thetext>I forgot to add &apos;wic&apos; to IMAGE_FSTYPES. That caused the above issue. Sorry for the noise.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74798</commentid>
    <comment_count>8</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-07-06 08:19:42 +0000</bug_when>
    <thetext>The fix has been sent for review: http://lists.openembedded.org/pipermail/openembedded-core/2017-July/139158.html

It removes wic-tools from the list of image dependencies and gets rid of wic-tools usage in wic core and plugins. wic-tools will still be used when wic is run manually.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75030</commentid>
    <comment_count>9</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-07-14 12:49:22 +0000</bug_when>
    <thetext>v2: http://lists.openembedded.org/pipermail/openembedded-core/2017-July/139637.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75100</commentid>
    <comment_count>10</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-07-18 10:39:37 +0000</bug_when>
    <thetext>the patchset has been accepted to poky master</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>