<?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>11017</bug_id>
          
          <creation_ts>2017-02-06 16:19:37 +0000</creation_ts>
          <short_desc>wic: per-image native tool dependencies</short_desc>
          <delta_ts>2017-04-04 19:22:19 +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>04 April 2017: RESOLVED</status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.3 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Patrick Ohly">patrick.ohly</reporter>
          <assigned_to name="Patrick Ohly">patrick.ohly</assigned_to>
          <cc>mikko.ylinen</cc>
    
    <cc>ross.burton</cc>
    
    <cc>srifenbark</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>70446</commentid>
    <comment_count>0</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2017-02-06 16:19:37 +0000</bug_when>
    <thetext>Image recipes can specify their own .wks files, and that file might use a custom source plugin. Currently there is no way to specify a dependency on native tools used by such a plugin without modifying the distro config of how wic-tools gets built.

The approch that Ed and I discussed on IRC is to let wic check the native sysroot of the current image recipe first, then fall back to the sysroot of wic-tools.

Ed, bonus points if those dependencies only get added to DEPENDS of the image recipe when the &quot;wic&quot; image type is really active.

Something like (untested):
my-image.bb:
WKS_FILE_DEPENDS = &quot;some-tool-native&quot;

image_types_wic.bbclass:
WKS_FILE_DEPENDS ??= &apos;&apos;
DEPENDS += &quot;${@ &apos;${WKS_FILE_DEPENDS}&apos; if d.getVar(&apos;USING_WIC&apos;) else &apos;&apos; }&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70447</commentid>
    <comment_count>1</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2017-02-06 16:20:59 +0000</bug_when>
    <thetext>While at it, also enhance the error message in exec_native_cmd() such that it is more obvious where the command was searched. I had to extend the output before I realized why my image recipe&apos;s DEPENDS was not having an effect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70863</commentid>
    <comment_count>2</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-02-21 15:32:44 +0000</bug_when>
    <thetext>Fix has been sent to the mailing list for review: http://lists.openembedded.org/pipermail/openembedded-core/2017-February/133080.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70865</commentid>
    <comment_count>3</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-02-21 15:35:22 +0000</bug_when>
    <thetext>Scott, can you help us to add WKS_FILE_DEPENDS to the documentation, please?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70988</commentid>
    <comment_count>4</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2017-02-28 17:51:37 +0000</bug_when>
    <thetext>Ed, 

Yes - can you send me a base description of the variable?  It doesn&apos;t have to be polished.  Just make sure you include information on how a user applies it (i.e. conf file?) and what the possible values are and what effects they have.  I will create a glossary entry for the variable and see about integrating it into wics documentation appropriately. 

Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70993</commentid>
    <comment_count>5</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-02-28 19:04:12 +0000</bug_when>
    <thetext>Here is what I came up with. Patrick, feel free to suggest better description.

WKS_FILE_DEPENDS[doc] = &quot;Lists a recipe&apos;s build-time dependencies specific to wic.&quot;

This variable is similar to DEPENDS variable. It lists build-time dependencies that will be used only when wic images are active,
i.e. when IMAGE_FSTYPES variable contains wic related entries.
In this case dependencies mentioned in WIC_FILE_DEPENDS variable will be added to DEPENDS variable. If wic images are not active this variable
doesn&apos;t influence the build.

This approach gives recipe developer a possibility to specify list of additional dependencies that are required to build wic images: native tools, bootloaders, etc.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71079</commentid>
    <comment_count>6</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-03-06 11:39:53 +0000</bug_when>
    <thetext>The patchset has been merged to master.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71452</commentid>
    <comment_count>7</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2017-03-20 16:40:05 +0000</bug_when>
    <thetext>Hi Patrick, 

I have created a new variable glossary definition for WKS_FILE_DEPENDS in the ref-manual at http://www.yoctoproject.org/docs/2.3/ref-manual/ref-manual.html#var-WKS_FILE_DEPENDS.  Check it out and let me know if it is okay.  If not, we can adjust it.

Also, in the dev-manual in the section that covers how to use Wic, I added a small note in the &quot;Plug-ins&quot; section to cross-reference to the variable in context.  See http://www.yoctoproject.org/docs/2.3/dev-manual/dev-manual.html#openembedded-kickstart-plugins.

One thing I noticed in your original Comment 1 is that a class &quot;image_types_wic.bbclass&quot; is mentioned.  We have a reference section for classes in the ref-manual and we do not document this class.  Does the user have to alter this class in order to get dependencies to work as well?  If so, we probably should list that class in the reference.  

I am REOPENING the bug since there is a documentation component.  Also putting the target to 2.3 M4.

Please review and send me your feedback here. 

Thanks,
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71469</commentid>
    <comment_count>8</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2017-03-20 17:51:33 +0000</bug_when>
    <thetext>Setting to 2.3 M4 and putting at IN PROGRESS REVIEW</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71779</commentid>
    <comment_count>9</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2017-03-27 21:27:36 +0000</bug_when>
    <thetext>Still need some input on my question in Comment 7.

Setting to NEEDINFO.

Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72059</commentid>
    <comment_count>10</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2017-04-04 07:41:18 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; Hi Patrick, 
&gt; 
&gt; I have created a new variable glossary definition for WKS_FILE_DEPENDS in
&gt; the ref-manual at
&gt; http://www.yoctoproject.org/docs/2.3/ref-manual/ref-manual.html#var-
&gt; WKS_FILE_DEPENDS.  Check it out and let me know if it is okay.  If not, we
&gt; can adjust it.
&gt; 
&gt; Also, in the dev-manual in the section that covers how to use Wic, I added a
&gt; small note in the &quot;Plug-ins&quot; section to cross-reference to the variable in
&gt; context.  See
&gt; http://www.yoctoproject.org/docs/2.3/dev-manual/dev-manual.html#openembedded-
&gt; kickstart-plugins.

Both looks good.

&gt; One thing I noticed in your original Comment 1 is that a class
&gt; &quot;image_types_wic.bbclass&quot; is mentioned.  We have a reference section for
&gt; classes in the ref-manual and we do not document this class.  Does the user
&gt; have to alter this class in order to get dependencies to work as well?

No. It&apos;s an internal helper class that users typically won&apos;t interact with.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72083</commentid>
    <comment_count>11</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2017-04-04 19:22:19 +0000</bug_when>
    <thetext>Thanks Patrick.

I am going to mark the doc flag as &quot;done.&quot;

Scott</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>