<?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>12559</bug_id>
          
          <creation_ts>2018-02-19 23:54:25 +0000</creation_ts>
          <short_desc>buildhistory-diff: directory rename detection sometimes goes crazy</short_desc>
          <delta_ts>2018-03-08 14:54:55 +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>2.5</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.5 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ross Burton">ross.burton</reporter>
          <assigned_to name="Anuj Mittal">anuj.mittal</assigned_to>
          <cc>apoorv.sangal</cc>
    
    <cc>ross.burton</cc>
    
    <cc>stephano</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>79509</commentid>
    <comment_count>0</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2018-02-19 23:54:25 +0000</bug_when>
    <thetext>Sometimes and not always, and I&apos;m yet to spot the pattern, the directory rename detection goes wrong:

directory renamed /usr/src/debug/nativesdk-qemu/2.11.0-r0/build/accel/kvm -&gt; /usr/src/debug/nativesdk-qemu/2.11.1-r0/build/hw/misc

directory renamed /usr/src/debug/nativesdk-qemu/2.11.0-r0/build/accel/kvm -&gt; /usr/src/debug/nativesdk-qemu/2.11.1-r0/build/hw/i386

directory renamed /usr/src/debug/nativesdk-qemu/2.11.0-r0/build/accel/kvm -&gt; /
usr/src/debug/nativesdk-qemu/2.11.1-r0/build/audio

directory renamed /usr/src/debug/nativesdk-qemu/2.11.0-r0/build/accel/kvm -&gt; /usr/src/debug/nativesdk-qemu/2.11.1-r0/build/hw/char

directory renamed /usr/src/debug/nativesdk-qemu/2.11.0-r0/build/accel/kvm -&gt; /usr/src/debug/nativesdk-qemu/2.11.1-r0/build/util

directory renamed /usr/src/debug/nativesdk-qemu/2.11.0-r0/build/accel/kvm -&gt; /usr/src/debug/nativesdk-qemu/2.11.1-r0/build/net

directory renamed /usr/src/debug/nativesdk-qemu/2.11.0-r0/build/accel/kvm -&gt; /usr/src/debug/nativesdk-qemu/2.11.1-r0/build/chardev

Repeat this pattern for another hundred directories as the target, and then again for every source directory, and you end up with hundreds of pages of garbage.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79572</commentid>
    <comment_count>1</comment_count>
    <who name="Anuj Mittal">anuj.mittal</who>
    <bug_when>2018-02-23 07:07:34 +0000</bug_when>
    <thetext>I was able to reproduce this by updating qemu to 2.11.1 from 2.11.0. So this will happen if there are files with same names in different folders if a package is upgraded.

In case of qemu, there&apos;re a lot of trace.c/h files in the folders listed here. Directory rename logic thinks that if file names are same and directory is different, it&apos;s a directory rename and prints it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79574</commentid>
    <comment_count>2</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2018-02-23 09:48:45 +0000</bug_when>
    <thetext>I can see how it&apos;s getting confused, but it definitely needs to be trying harder to find the minimal change (numbers change only would deal with every -dbg rename) and more importantly only report a rename pair once.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79640</commentid>
    <comment_count>3</comment_count>
    <who name="Anuj Mittal">anuj.mittal</who>
    <bug_when>2018-03-01 09:32:26 +0000</bug_when>
    <thetext>Since this is all using metadata only, using file names is probably the only way here to check if two directories are same. But, we should be able to skip the dirs that have been detected as a rename once. If the entire list is sorted, the first hit is actually the closest ...

Right now, the entire list is dumped twice and in a nested for loop, that means 2*n (n=number of dirs) changes displayed for every dir even when a rename has already been processed. I will send a change after doing some more testing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79764</commentid>
    <comment_count>4</comment_count>
    <who name="Anuj Mittal">anuj.mittal</who>
    <bug_when>2018-03-08 14:54:55 +0000</bug_when>
    <thetext>Merged: http://git.openembedded.org/openembedded-core/commit/?id=cff000c43d6e9a183911338951026dfbef88f838</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>