<?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>5263</bug_id>
          
          <creation_ts>2013-09-25 01:50:53 +0000</creation_ts>
          <short_desc>buildhistory should always record PKG, PKGE, PKGV and PKGR</short_desc>
          <delta_ts>2013-10-28 09:59: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>core</component>
          <version>1.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>1.5 M5</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Chen Qi">Qi.Chen</reporter>
          <assigned_to name="Chen Qi">Qi.Chen</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>liezhi.yang</cc>
    
    <cc>mark.hatle</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>sgw</cc>
    
    <cc>yi.zhao</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>37150</commentid>
    <comment_count>0</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2013-09-25 01:50:53 +0000</bug_when>
    <thetext>Currently, if PKGV equals to PV, it will not be written to buildhistory.

pkgvars[&apos;PKGV&apos;] = pkginfo.pkgv if pkginfo.pkgv != pkginfo.pv else &apos;&apos;

However, in buildhistory-diff, PKGV, instead of PV, is regarded as a monitored variable.

So buildhistory.bbclass always record PV instead of PKGV, but buildhistory-diff
treats PKGV as a monitored variable instead of PV. This results in the following unexpected behavior.

If a recipe&apos;s PV changes, for example, hello_1.0.bb is renamed to hello_2.0.bb.
Then buildhistory-diff cannot report changes in PV area. And actually, the PKGV is not recorded.

So I would like to suggest that in buildhistory.bbclass, we always record PKGV.
The same logic applies to PKG, PKGE and PKGR.

-        pkgvars[&apos;PKG&apos;] = pkginfo.pkg if pkginfo.pkg != pkginfo.name else &apos;&apos;
-        pkgvars[&apos;PKGE&apos;] = pkginfo.pkge if pkginfo.pkge != pkginfo.pe else &apos;&apos;
-        pkgvars[&apos;PKGV&apos;] = pkginfo.pkgv if pkginfo.pkgv != pkginfo.pv else &apos;&apos;
-        pkgvars[&apos;PKGR&apos;] = pkginfo.pkgr if pkginfo.pkgr != pkginfo.pr else &apos;&apos;
+        pkgvars[&apos;PKG&apos;] = pkginfo.pkg
+        pkgvars[&apos;PKGE&apos;] = pkginfo.pkge
+        pkgvars[&apos;PKGV&apos;] = pkginfo.pkgv
+        pkgvars[&apos;PKGR&apos;] = pkginfo.pkgr

//Chen Qi</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37361</commentid>
    <comment_count>1</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2013-09-30 15:25:49 +0000</bug_when>
    <thetext>I&apos;m a bit confused as to what issue you&apos;re actually trying to solve here. buildhistory-diff is only supposed to report PKG, PKGE, PKGV and PKGR changing if the value has been set differently from the corresponding standard variable, so as far as I can tell it&apos;s working as designed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37442</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2013-10-01 17:25:12 +0000</bug_when>
    <thetext>Chen Qi is on vacation for a few days, so I&apos;m going to step in and attempt to answer the question from Paul.

I believe this change is requested because otherwise there is no way to detect a package upgrade/uprev when using buildhistory.  This type of upgrade can happy when comparing no-GPLv3 and GPLv3 builds -- or just simple software updates when a layer gets updated.

We want to use the buildhistory from one build to the next to look for changes that have occurred that may be unexpected.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37726</commentid>
    <comment_count>3</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2013-10-08 02:03:21 +0000</bug_when>
    <thetext>Hi Paul,

In bitbake.conf, we have:
PKGV ?= &quot;${PV}&quot;

So if not set specially, when PV changes, PKGV changes as well; it&apos;s just that PKGV is not recorded and buildhistory-diff only catches changes of PKGV instead of PV.

Here&apos;s an example showing that when changing PV, PKGV actually changes.
chenqi@pek-qchen1-d1:~/poky/build$ bitbake useradd-example -e | grep ^PKGV
PKGV=&quot;1.0&quot;
chenqi@pek-qchen1-d1:~/poky/build$ mv ../meta-skeleton/recipes-skeleton/useradd/useradd-example.bb ../meta-skeleton/recipes-skeleton/useradd/useradd-example_2.0.bb
chenqi@pek-qchen1-d1:~/poky/build$ bitbake useradd-example -e | grep ^PKGV
PKGV=&quot;2.0&quot;

The problem I&apos;m solving here is to make buildhistory catch PKGV changes correctly. For now, even if PKGV changes, buildhistory-diff cannot catch the change as PKGV equals to PV and is not recorded.

Best Regards,
Chen Qi</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38193</commentid>
    <comment_count>4</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2013-10-28 09:59:55 +0000</bug_when>
    <thetext>This has been fixed in a slightly different way in master:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=f995febd2ebd43774cb1cc5917f3f3c46a744519</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>