Bug 929

Summary: package information messed after building GPLv3/non-GPLv3 for several times
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Jiajun Xu <jiajun.xu>
Component: meta-yoctoAssignee: Jiajun Xu <jiajun.xu>
Status: RESOLVED NOTABUG QA Contact:
Severity: normal    
Priority: Medium CC: dongxiao.xu, jessica.zhang, lianhao.lu, poky.bs.watcher, poky.watcher, richard.purdie, sgw, xudong.hao
Version: 1.0   
Target Milestone: 1.0 M4   
Hardware: x86   
OS: Multiple   
Whiteboard: 04-jan-2012: Re-assigning
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Jiajun Xu 2011-03-24 05:54:27 UTC
branch: bernard/poky master tree
meta-intel commit: 83384c3e83d69245dfe19e36b2a64c8973ad8462
poky commit: 82af8b9fb6d6d1439943fd15b8a75c0e663e4a45 

When I was testing non-GPLv3 build, I found package information will be messed after several times GPLv3/non-GPLv3. It shows that readline and other package like gmp version are not correct.

To reproduce the issue, I do like following:
1. Build non-GPLv3 poky-image-minimal
2. Build non-GPLv3 poky-image-basic
3. Build GPLv3 poky-image-basic, if no error met, you could try poky-image-minimal then

On my machine, I cloned two separate trees and by following above steps, I met two errors, which all seems related to package version inconsistent.
Comment 1 Jiajun Xu 2011-03-24 06:00:51 UTC
I dumped the screen outputs when building in different two trees with poky-image-minimal and poky-image-basic with GPLv3. Since the log files exceed the maximum upload file of bugzilla, I put it on a local samba server, \\vt-nfs.sh.intel.com\incoming\gplv3.
Comment 2 Jessica 2011-03-24 10:31:44 UTC
Scott, please update the GPL documentation that states when user doing certain GPL build, they should stay with the original setting instead of switch back and form
Comment 3 Dongxiao Xu 2011-03-28 19:48:00 UTC
There are two bugs inside.

1) gmp has two versions: 5.0.1 (libgmp10, GPLv3) and 4.2.1 (libgmp3, GPLv2). When building the GPLv2 basic image, task-poky-basic will requires libgmp3 as its runtime dependency. However when later changes to GPLv3 build, gmp is rebuild to libgmp10, however task-poky-basic is not rebuild, which still requires libgmp3, resulting the missing depenency error. The error log can be found at \\vt-nfs.sh.intel.com\incoming\gplv3\basic

This reminds me a previous feature request of depenency build. It is a mechanism to rebulid or clean a package and all other packages which have build/runtime dependency on it. Take gmp as an example, if we change GPLv2 and GPLv3 build, gmp will be rebuild. Besides, task-poky-basic will also be rebuild since it has runtime dependency on gmp.

2) Jiajun also found another error when he firstly tries to reproduce the bug. The error log can be found at \\vt-nfs.sh.intel.com\incoming\gplv3\minimal
Thinking of the following senario:

a) Build GPLv3 version of gmp (5.0.1). do_package is succeed while do_package_write_rpm is not successfully run maybe due to other tasks blocks.
b) Build GPLv2 version of gmp (4.2.1), and the entire build is succeed.
c) Build GPLv3 version of gmp (5.0.1). It will continue to execute do_package_write_rpm. There is a sub function "read_subpackage_metadata" which will read the pkgdata file "tmp/pkgdata/i586-poky-linux/runtime/gmp" to get the sub package information data, like PV, PR, etc. Also it will write it back to local cache. The pkgdata file "tmp/pkgdata/i586-poky-linux/runtime/gmp" is generated while do_package. Due to the step b, the file is filled with GPLv2 gmp information (PV=4.2.1, PR=r0, etc). Therefore when executing gmp-5.0.1 do_package_write_rpm, it still uses 4.2.1 version, which makes do_package_write_rpm failure.

From the above error we can see that do_package_write_* and do_package are highly depended. If rebuild do_package_write_*, do_package also needs to be re-run to ensure correctness.

Any comment or suggestion on it?
Comment 4 Dongxiao Xu 2011-03-28 19:50:53 UTC
CC lianhao.
Comment 5 Richard Purdie 2011-03-29 06:38:50 UTC
I'm going to guess that if we enable BB_SIGNATURE_HANDLER = "basichash", these bugs won't occur as that implements the dependency handling Dongxaio talks about through the checksums. Until we enable that, I think its fair to say that mixiing gplv2 and v3 builds isn't supported.
Comment 6 Scott Rifenbark 2011-03-30 07:22:21 UTC
I added a note in section 2.2 (Running a Build) as follows:

NOTE
When building an image using GPL components you need to maintain your original settings and not switch back and forth applying different versions of the GNU Public License.  If you rebuild using different versions of GPL you can get dependency errors due to some components not being rebuilt.
Comment 8 Jiajun Xu 2011-04-05 20:20:17 UTC
I think the commit is to add note for not using such configuration when building GPLv3/non-GPLv3 image. But the issue should still exist.

Re-open the bug.
Comment 9 Scott Rifenbark 2011-04-05 20:40:49 UTC
If this bug is being re-opened because the issue still exists it needs to be assigned to someone else.
Comment 10 Scott Rifenbark 2012-01-04 08:44:47 UTC
I am re-assigning this bug to the original person (jiajun).  It appears we do not support switching around between GPLv2 and GPLv3.  The note I added states that.  If the issue still exists and the bug is being re-opened for the issue it needs to be re-assigned to an engineer to fix the issue.
Comment 11 Richard Purdie 2012-02-27 19:27:14 UTC
It is not supported to switch between GPLv2 only and GPLv3 in a given build directory. It is likely with OEBasicHash this will probably work but I'd still not recommend it.

Since we don't support this and its documented that we don't support this, I'm marking this as NOTABUG.