Bug 6973 - Buildhistory-diff is not working
Summary: Buildhistory-diff is not working
Status: VERIFIED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.6.3
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.9 M1
Assignee: Paul Eggleton
QA Contact: Costin
URL:
Whiteboard:
: 7807 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-11-17 14:35 UTC by Costin
Modified: 2015-09-15 13:48 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: Regression (Used to work)
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
local.conf (10.75 KB, application/octet-stream)
2014-11-17 14:35 UTC, Costin
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Costin 2014-11-17 14:35:15 UTC
Created attachment 2248 [details]
local.conf

Hello,

While performing TC 295 - Use buildhistory-diff to analyse changes for 2 builds ,  having the following content:

"
1. build some recipes and get the buildhistory log(for example, recipe "xcursor-transparent-theme") with INHERIT += "buildhistory" and BUILDHISTORY_COMMIT = "1" in local.conf
2. change the PR of xcursor-transparent-theme backwards, for example from "r4" to "r3"
3. re-build the recipe and run buildhistory-diff to check if there is any change
"

the buildhistory-diff tool is not working.

I performed the steps as instructed on step 1 and on step 2 (after modifying meta-yocto/conf/distro/poky.conf adding "version-going-backwards" to WARN_QA):


[cosscat@Fedora-CCC build]$ bitbake xcursor-transparent-theme
Loading cache: 100% |####################################################################################################################################################################################################| ETA:  00:00:00
Loaded 1222 entries from dependency cache.
Parsing recipes: 100% |##################################################################################################################################################################################################| Time: 00:00:00
Parsing of 862 .bb files complete (861 cached, 1 parsed). 1221 targets, 38 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = "1.22.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Fedora-20"
TARGET_SYS        = "i586-poky-linux"
MACHINE           = "qemux86"
DISTRO            = "poky"
DISTRO_VERSION    = "1.6.2"
TUNE_FEATURES     = "m32 i586"
TARGET_FPU        = ""
meta              
meta-yocto        
meta-yocto-bsp    = "(detachedfrom30b8d93):30b8d9378b8260e452552b806610dc9b6fe0b69f"

NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
WARNING: QA Issue: Package version for package xcursor-transparent-theme-dbg went backwards which would break package feeds from (0:0.1.1-r4 to 0:0.1.1-r3)
WARNING: QA Issue: Package version for package xcursor-transparent-theme-staticdev went backwards which would break package feeds from (0:0.1.1-r4 to 0:0.1.1-r3)
WARNING: QA Issue: Package version for package xcursor-transparent-theme-dev went backwards which would break package feeds from (0:0.1.1-r4 to 0:0.1.1-r3)
WARNING: QA Issue: Package version for package xcursor-transparent-theme-doc went backwards which would break package feeds from (0:0.1.1-r4 to 0:0.1.1-r3)
WARNING: QA Issue: Package version for package xcursor-transparent-theme-locale went backwards which would break package feeds from (0:0.1.1-r4 to 0:0.1.1-r3)
WARNING: QA Issue: Package version for package xcursor-transparent-theme went backwards which would break package feeds from (0:0.1.1-r4 to 0:0.1.1-r3)
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 237 tasks of which 236 didn't need to be rerun and all succeeded.
NOTE: Writing buildhistory
...

then tried buildhistory-diff with the following result:

[cosscat@Fedora-CCC build]$ buildhistory-diff
Unable to find previous build revision in buildhistory repository

Usage: 
    buildhistory-diff [options] [from-revision [to-revision]]
(if not specified, from-revision defaults to build-minus-1, and to-revision defaults to HEAD)

Reports significant differences in the buildhistory repository.

Options:
  -h, --help            show this help message and exit
  -p BUILDHISTORY_DIR, --buildhistory-dir=BUILDHISTORY_DIR
                        Specify path to buildhistory directory (defaults to
                        buildhistory/ under cwd)
  -v, --report-version  Report changes in PKGE/PKGV/PKGR even when the values
                        are still the default (PE/PV/PR)
  -a, --report-all      Report all changes, not just the default significant
                        ones


[cosscat@Fedora-CCC build]$ ls 
bitbake.lock  buildhistory  cache  conf  downloads  sstate-cache  tmp


I also tried with explicit directory:  [cosscat@Fedora-CCC build]$ buildhistory-diff -p buildhistory
but same result.

For reference the local.conf file is attached.

Costin
Comment 1 Costin 2014-11-17 14:53:45 UTC
Hello,

I forgot to add that I tested this on 3 different machines:
1x Fedore 20
1x Ubuntu desktop 14.04
1x Ubuntu server 14.04

... all behaved the same

Costin
Comment 2 Paul Eggleton 2014-11-18 16:23:31 UTC
I cannot reproduce this with daisy on either a CentOS 6 or an Ubuntu 14.04 machine. I am attempting the following:

1. bitbake xcursor-transparent-theme
2. Change PR in the recipe from "r4" to "r3"
3. bitbake xcursor-transparent-theme
4. Run buildhistory-diff

I've also tried both with an existing buildhistory directory and without.

Can you check to see if any commits are being made at all in the buildhistory directory?
Comment 3 Alexandru Georgescu 2014-11-19 10:30:31 UTC
Costin, can you check?
Comment 4 Costin 2015-01-12 14:31:00 UTC
Hello,

I just tried again (with latest commit given to be tested: 6dd21a9f152a93e2df1178d7a5bd903d7edcf4be) both with an existing copy of poky and with a new one (though should be no difference) on an Ubuntu 14.10. 

The buildhistory dir is created alongside with its subdirs:

cosscat@ubnt:/media/poky/3poky/build$ df -h buildhistory/
Filesystem      Size  Used Avail Use% Mounted on
/dev/md0        793G  108G  646G  15% /media/poky
cosscat@ubnt:/media/poky/3poky/build$ du -h buildhistory/
12K	buildhistory/packages/all-poky-linux/xcursor-transparent-theme/xcursor-transparent-theme
8,0K	buildhistory/packages/all-poky-linux/xcursor-transparent-theme/xcursor-transparent-theme-staticdev
8,0K	buildhistory/packages/all-poky-linux/xcursor-transparent-theme/xcursor-transparent-theme-dbg
8,0K	buildhistory/packages/all-poky-linux/xcursor-transparent-theme/xcursor-transparent-theme-doc
8,0K	buildhistory/packages/all-poky-linux/xcursor-transparent-theme/xcursor-transparent-theme-dev
8,0K	buildhistory/packages/all-poky-linux/xcursor-transparent-theme/xcursor-transparent-theme-locale
60K	buildhistory/packages/all-poky-linux/xcursor-transparent-theme
64K	buildhistory/packages/all-poky-linux
68K	buildhistory/packages
8,0K	buildhistory/.git/logs/refs/heads
12K	buildhistory/.git/logs/refs
20K	buildhistory/.git/logs
4,0K	buildhistory/.git/refs/tags
8,0K	buildhistory/.git/refs/heads
16K	buildhistory/.git/refs
44K	buildhistory/.git/hooks
8,0K	buildhistory/.git/info
8,0K	buildhistory/.git/objects/fd
4,0K	buildhistory/.git/objects/pack
8,0K	buildhistory/.git/objects/71
8,0K	buildhistory/.git/objects/37
8,0K	buildhistory/.git/objects/66
8,0K	buildhistory/.git/objects/78
4,0K	buildhistory/.git/objects/info
8,0K	buildhistory/.git/objects/b5
8,0K	buildhistory/.git/objects/07
8,0K	buildhistory/.git/objects/35
8,0K	buildhistory/.git/objects/5a
8,0K	buildhistory/.git/objects/18
8,0K	buildhistory/.git/objects/2e
8,0K	buildhistory/.git/objects/bf
8,0K	buildhistory/.git/objects/b3
8,0K	buildhistory/.git/objects/91
8,0K	buildhistory/.git/objects/64
8,0K	buildhistory/.git/objects/76
8,0K	buildhistory/.git/objects/ee
12K	buildhistory/.git/objects/f5
160K	buildhistory/.git/objects
4,0K	buildhistory/.git/branches
276K	buildhistory/.git
352K	buildhistory/
cosscat@ubnt:/media/poky/3poky/build$ 

Regarding commits, the given commit is taken into consideration: 

cosscat@ubnt:/media/poky/3poky/build/buildhistory$ cat metadata-revs 
meta              = (detachedfrom6dd21a9):6dd21a9f152a93e2df1178d7a5bd903d7edcf4be
meta-yocto        = (detachedfrom6dd21a9):6dd21a9f152a93e2df1178d7a5bd903d7edcf4be
meta-yocto-bsp    = (detachedfrom6dd21a9):6dd21a9f152a93e2df1178d7a5bd903d7edcf4be
meta-intel        = master:a72da6350e7a77256ad597e8e8c40909590a2a40
cosscat@ubnt:/media/poky/3poky/build/buildhistory$ 

Costin
Comment 5 Costin 2015-05-19 12:20:24 UTC
Hello,

I have the same issue on 1.6.3 RC4: b2ba41b57550aa912da93b4aef789ff562a67fce.
This time, after building the xcursor-transparent-theme for rc4 i erased tmp, cache and sstate-cache dirs and then rebuilt for r3

Costin
Comment 6 Paul Eggleton 2015-05-19 12:42:17 UTC
I'm still struggling to reproduce this - Costin I am going to need your help.
Comment 7 Costin 2015-05-21 11:36:00 UTC
Hi Pual,

After your recommendation with 
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=paule/buildhistory-fix&id=dcaf857899f76f5c41fe0d4ae1d83b5e7ef7f87d

It worked fine. Here is the result:

[cosscat@Fedora-CCC build]$ buildhistory-diff 
packages/all-poky-linux/xcursor-transparent-theme/xcursor-transparent-theme-dev: RDEPENDS: removed "xcursor-transparent-theme (['= 0.1.1-r4'])" added "xcursor-transparent-theme (['= 0.1.1-r3'])"
  * PR changed from "r4" to "r3"
packages/all-poky-linux/xcursor-transparent-theme/xcursor-transparent-theme-staticdev: RDEPENDS: removed "xcursor-transparent-theme-dev (['= 0.1.1-r4'])" added "xcursor-transparent-theme-dev (['= 0.1.1-r3'])"
  * PR changed from "r4" to "r3"
[cosscat@Fedora-CCC build]$ 

Please let me know when to mark the bug as Verified. (after merging the patch i guess)

Costin
Comment 8 Paul Eggleton 2015-05-21 12:19:24 UTC
With access to Constin's setup I was able to see that the problem was that user.email and user.name weren't set in git's configuration (which git was complaining about at the end of the build). This isn't covered in the manual though and buildhistory ought to set these locally for the repository if the user hasn't done it globally. I've just sent a patch to the OE-Core list to do that.
Comment 9 Ross Burton 2015-05-26 08:58:21 UTC
Fixed in f62255bfa6c5a322c867b7c4ea5686ea7bfab3fe.
Comment 10 Ross Burton 2015-05-26 08:59:11 UTC
*** Bug 7807 has been marked as a duplicate of this bug. ***
Comment 11 Bogdan Alexandru Voiculescu 2015-09-15 13:48:35 UTC
verified at the time: no status changed