<?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>7602</bug_id>
          
          <creation_ts>2015-04-13 14:32:36 +0000</creation_ts>
          <short_desc>devtool: improve handling for recipes that point to local source next to recipe</short_desc>
          <delta_ts>2015-10-01 12:49: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>devtools / tool chain</component>
          <version>1.8</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.0</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Eggleton">bluelightning</reporter>
          <assigned_to name="Markus Lehtonen">markus.lehtonen</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>50267</commentid>
    <comment_count>0</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-04-13 14:32:36 +0000</bug_when>
    <thetext>At the moment if you run devtool modify -x on a recipe that points directly to source files in SRC_URI (such as the makedevs recipe), it copies all files into the external source tree. It does appear that you can edit the .c file there and it will be used, however also copied over is a .patch file which is not as useful. It&apos;s not also clear to me what&apos;s supposed to happen when you then edit the original files next to the recipe when externalsrc is being used.

Additionally, will devtool update-recipe update the original source file with any changes? Arguably it should.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50355</commentid>
    <comment_count>1</comment_count>
    <who name="Markus Lehtonen">markus.lehtonen</who>
    <bug_when>2015-04-16 15:27:10 +0000</bug_when>
    <thetext>Devtool should somehow make a difference between upstream sources (unpacked from an archive or cloned SCM etc) and &quot;packaging&quot; files, i.e. the local files under the layer directory. I&apos;m not sure if devtool should even work with packages like makedevs as the files can be conveniently modified directly in the layer dir, anyway(?) If we support this, we should also support &quot;extracting&quot; the local files to the srctree (and &quot;updating&quot; back to layer dir) for packages which have both an upstream source and local files, like udev.

What do you think?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50356</commentid>
    <comment_count>2</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-04-16 15:41:54 +0000</bug_when>
    <thetext>I&apos;m unsure as to what to do for recipes where you have a mixture of upstream source and some local files - the question would be where should those files appear once extracted given that it still has to work when you do &apos;devtool modify&apos; without -x and supply your own &quot;pristine&quot; source tree that doesn&apos;t have those files. (It could be that we just fall back to fetching them from their original location, which shouldn&apos;t be too hard.)

At the moment it appears it does mostly work for recipes like makedevs, it just needs some fine-tuning. If practical I&apos;d like to err on the side of having devtool work for as many recipes as possible even if in some cases you&apos;re only gaining the benefit of having the same workflow working and not much else.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50382</commentid>
    <comment_count>3</comment_count>
    <who name="Markus Lehtonen">markus.lehtonen</who>
    <bug_when>2015-04-17 12:35:38 +0000</bug_when>
    <thetext>AFAIU, there are two packages in this regard:
1. S=${WORKDIR} (e.g. makedevs.)
2. Other packages (e.g. udev)

For #1 we could just ignore/remove patches (.patch and .diff files) and not commit them into srctree. With this modification it should be fairly consistent and usable.

#2 is bit more complicated. Somehow it would be nice to be able to modify the local files in the srctree in this case, too (like #1). Not least for the sake of consistency, IMO. Would it be feasible to put the local files into a subdir in the srctree (&apos;meta&apos;, or &apos;localfiles&apos; or whatever) and the trick the fetcher to fetch them from there?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50446</commentid>
    <comment_count>4</comment_count>
    <who name="Markus Lehtonen">markus.lehtonen</who>
    <bug_when>2015-04-21 15:02:25 +0000</bug_when>
    <thetext>I&apos;m also wondering what to do when source files are modified (i.e. makedevs.c in case of makedevs) and update-recipe is run. Should we just create a patch which is what devtool currently does? Or update the original in the layer directory?

The second one is hard to accomplish because we run git format-patch to generate patches and there is no way (that I know of) to exclude files/patches. We need to run format-patch anyway because some files are handled as patches.

Makedevs is a tricky (and good) example because &apos;COPYING&apos; is created/modified as a patch but &apos;makedevs.c&apos; is a plain source file in the layer meta data.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50448</commentid>
    <comment_count>5</comment_count>
    <who name="Markus Lehtonen">markus.lehtonen</who>
    <bug_when>2015-04-21 15:51:05 +0000</bug_when>
    <thetext>What assumptions can we make about the git version for users using devtool? I ask because git v1.9.0 added a nice feature called &quot;negative pathspecs&quot; which could do exactly what I&apos;d want. I.e. something like:
$ git format-patch -- . &apos;:!makedevs.c&apos;

for excluding changes to makedevs.c from the patches.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50450</commentid>
    <comment_count>6</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-04-21 15:58:21 +0000</bug_when>
    <thetext>Well, if we are applying changes back to the recipe then I would have thought we would just replace the .c file.

As far as git version is concerned, our current minimum is 1.7.8 so that might prevent us relying on that option...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50471</commentid>
    <comment_count>7</comment_count>
    <who name="Markus Lehtonen">markus.lehtonen</who>
    <bug_when>2015-04-22 13:59:20 +0000</bug_when>
    <thetext>Ok, bad luck with the git version. I try to cook up something.

So, the logic for changes would be something like:
1. If the file already exists in recipe space -&gt; update the original source
2. Otherwise (e.g. new files, archived files etc) upload a patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54867</commentid>
    <comment_count>8</comment_count>
    <who name="Markus Lehtonen">markus.lehtonen</who>
    <bug_when>2015-10-01 12:49:11 +0000</bug_when>
    <thetext>The feature was merged into master in
http://git.openembedded.org/openembedded-core/commit/?id=c94cf6e6e8a0645c822a708a432901dcb5ce5bf4

through

http://git.openembedded.org/openembedded-core/commit/?id=b7ab82485e4514e07ab8a76e554da27ddc92e6c0</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>