Bug 11161

Summary: yocto-compat-layer: show signature differences
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Patrick Ohly <patrick.ohly>
Component: meta-yoctoAssignee: Patrick Ohly <patrick.ohly>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: bluelightning, poky.bs.watcher, poky.watcher
Version: unspecified   
Target Milestone: 2.3 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Patrick Ohly 2017-03-15 10:07:52 UTC
When test_signatures fails, layer maintainers need to investigate. This is currently manual work and relies on a good understanding of bitbake signature handling, which layer developers might not have.

The yocto-compat-layer should automate that work and provide some instructions (if possible).

Example:
$ yocto-compat-layer.py -d /fast/work/meta-intel 
INFO: Detected layers:
INFO: meta-intel: LayerType.BSP, /fast/work/meta-intel
INFO: meta-tlk: LayerType.SOFTWARE, /fast/work/meta-intel/meta-tlk
INFO: 
INFO: Getting initial bitbake variables ...
INFO: Getting initial signatures ...
INFO: 
INFO: Starting to analyze: meta-intel
INFO: ----------------------------------------------------------------------
INFO: test_bsp_defines_machines (bsp.BSPCompatLayer) ... ok
INFO: test_bsp_no_set_machine (bsp.BSPCompatLayer) ... ok
INFO: test_parse (common.CommonCompatLayer) ... ok
INFO: test_readme (common.CommonCompatLayer) ... ok
INFO: test_show_environment (common.CommonCompatLayer) ... ok
INFO: test_signatures (common.CommonCompatLayer) ... FAIL
INFO: skipped "DistroCompatLayer: Layer meta-intel isn't Distro one."
INFO: 
INFO: ======================================================================
INFO: FAIL: test_signatures (common.CommonCompatLayer)
INFO: ----------------------------------------------------------------------
INFO: Traceback (most recent call last):
  File "/fast/work/poky/scripts/lib/compatlayer/cases/common.py", line 65, in test_signatures
    (self.tc.layer['name'], detail))
AssertionError: True is not false : Layer meta-intel changed signatures.
packagegroup-core-lsb:do_build changed c933b18e073bcc97dae110b856354424 -> 11deb486eea0428dd9b96640990e6606
packagegroup-core-lsb:do_package_write_rpm changed 1bc1a06f6d054e6b915f3a55b419c074 -> 927a946c9df49cd741194b4b5910ff99
packagegroup-core-lsb:do_packagedata changed 8f948711b648a53f2715542d45ed21be -> 7940f9361b3e46e2014738703bd88d08
packagegroup-core-lsb:do_package_qa changed 74390696ad32aec1c4a699aac0790874 -> 14e027d9d76866f5b628bbb37734321d
meta-world-pkgdata:do_build changed aeab5df30d098cbddf2b1599f463f005 -> 13f8803667d8e2e7d3779028521446fd
packagegroup-core-lsb:do_package changed a8a3700c3fb7d31e2a3db467c3fd598b -> d2b15a26df2358fef1c609cf172387c4
...

In this example, the output of bitbake-diffsigs would be more useful than dumping the signature hashes.
Comment 1 Paul Eggleton 2017-03-16 03:48:53 UTC
I'd recommend using tinfoil to call into the python code to compare the signatures as bitbake-diffsigs does, rather than running bitbake-diffsigs itself. (coincidentally I'm working on improving that code at the moment.)
Comment 2 Paul Eggleton 2017-03-20 20:54:02 UTC
FYI my WIP improvements for the signature comparison code are in paule/sigstuff on poky-contrib.
Comment 3 Aníbal Limón 2017-03-20 20:56:36 UTC
(In reply to comment #2)
> FYI my WIP improvements for the signature comparison code are in
> paule/sigstuff on poky-contrib.

Good to know, are you planning to integrate into 2.3?
Comment 4 Aníbal Limón 2017-03-21 18:29:58 UTC
I implemented a solution using bitbake-diffsigs [1], it requires some patches made by Paul because is using new parameter -s to explicit set what signatures needs to be compared.

Also i did a small fix in bb/siggen.py [2] but i don't know if is the right fix, Paul?

[1] http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=alimon/yp_compatible&id=851bb4dcd6804c16528b8216ca0c0a9e51ff05c8
[2] http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=alimon/yp_compatible&id=10792b985336d7bd5211672d2b5bedf24854c936
Comment 5 Aníbal Limón 2017-04-06 19:04:09 UTC
Patrick send a patch to the ML for review,

http://lists.openembedded.org/pipermail/openembedded-core/2017-April/135205.html

So assign the bug to him.