Bug 8055

Summary: Failures in INCOMPATIBLE_LICENSE
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Beth Flanagan <elizabeth.flanagan>
Component: coreAssignee: Beth Flanagan <elizabeth.flanagan>
Status: VERIFIED FIXED QA Contact: Daniel Istrate <daniel.alexandrux.istrate>
Severity: normal    
Priority: High CC: alexandru.c.georgescu, bluelightning, elizabeth.flanagan, meta.mr.watcher, meta.watcher
Version: 1.7.3   
Target Milestone: 1.9 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Bug Depends on: 8080    
Bug Blocks:    

Description Beth Flanagan 2015-07-27 15:17:08 UTC
Example: core-image-full-cmdline with INCOMPATIBLE_LICENSE = "GPLv3"

gnutls-bin which is GPLv3 is added to the image. This shouldn't happen and doesn't in master. My guess is that there is a patch to the package.bbclass logic that should be backported to fix this.
Comment 1 Paul Eggleton 2015-07-30 14:44:25 UTC
Beth, could you also please add an oe-selftest test as part of this?
Comment 2 Beth Flanagan 2015-07-30 15:38:23 UTC
So, a few things on this.

1. base.py:

We check to see if pn is in the WHITELISTs. Why we're seeing these is because in default-distrovars.inc we have:

WHITELIST_GPL-3.0 ?= "less"
LGPLv2_WHITELIST_GPL-3.0 ?= "libassuan gnutls libtasn1 libidn"

We should probably override these on a non-GPLv3 autobuilder build.

So those packages are getting added to the system and we should test that they shouldn't be.

2. incompatible_license in license.bbclass is parsing bitor licenses wrong.


Example. We shouldn't need to whitelist 'less':

LICENSE = "GPLv3+ | BSD-2-Clause"

However incompatible_license should give us BSD, but it doesn't seem to be.

So, the original bug here is somewhat a false positive, BUT, we still have some somewhat minor issue in license we should be looking at.
Comment 3 Beth Flanagan 2015-07-30 17:22:08 UTC
Actually, correction. 

We check to see if pn is in the WHITELISTs. Why we're seeing these is because in default-distrovars.inc we have:

WHITELIST_GPL-3.0 ?= "less"
LGPLv2_WHITELIST_GPL-3.0 ?= "libassuan gnutls libtasn1 libidn"

This is perfectly correct behaviour. HOWEVER, we need to warn people about this in the logs and make it clear what is happening.
Comment 4 Beth Flanagan 2015-07-30 17:27:32 UTC
Actually, correction. 

We check to see if pn is in the WHITELISTs. Why we're seeing these is because in default-distrovars.inc we have:

WHITELIST_GPL-3.0 ?= "less"
LGPLv2_WHITELIST_GPL-3.0 ?= "libassuan gnutls libtasn1 libidn"

This is perfectly correct behaviour. HOWEVER, we need to warn people about this in the logs and make it clear what is happening.

I'm splitting out the issue with incompatible_license returning the wrong license and making this bug depend on it since this is actually two issues.
Comment 7 Daniel Istrate 2015-10-01 13:57:09 UTC
Verified on master: 979de7703cf3e468aa2923da1445138e1c93d234

Steps to verify:
1. Add to local.conf --> INCOMPATIBLE_LICENSE = "GPLv3"
2. bitbake -e core-image-full-cmdline | grep LGPLv2_WHITELIST_GPL-3.0= --> LGPLv2_WHITELIST_GPL-3.0="libassuan gnutls libtasn1 libidn"
   bitbake -e core-image-full-cmdline | egrep ^WHITELIST_GPL-3.0 --> WHITELIST_GPL-3.0="less"

3. bitbake core-image-full-cmdline

[daniel@fedora-ws poky-build-M3]$ bitbake core-image-full-cmdline
NOTE: INCLUDING libidn as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted      | ETA:  00:00:11
NOTE: INCLUDING libidn as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted
NOTE: INCLUDING less as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted        | ETA:  00:00:10
NOTE: INCLUDING libassuan as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted   | ETA:  00:00:01
NOTE: INCLUDING gnutls as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted      | ETA:  00:00:01
NOTE: INCLUDING libtasn1 as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted
Parsing recipes: 100% |###############################################################################| Time: 00:00:14
Parsing of 898 .bb files complete (0 cached, 898 parsed). 1328 targets, 90 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = "1.27.1"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Fedora-21"
TARGET_SYS        = "i586-poky-linux"
MACHINE           = "qemux86"
DISTRO            = "poky"
DISTRO_VERSION    = "1.8+snapshot-20151001"
TUNE_FEATURES     = "m32 i586"
TARGET_FPU        = ""
meta              
meta-yocto        
meta-yocto-bsp    = "master:979de7703cf3e468aa2923da1445138e1c93d234"

NOTE: Preparing RunQueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
WARNING: QA Issue: gcc-runtime-dbg has an incompatible license. Excluding from packaging. [incompatible-license]
WARNING: QA Issue: libgomp has an incompatible license. Excluding from packaging. [incompatible-license]
WARNING: QA Issue: libgomp-dev has an incompatible license. Excluding from packaging. [incompatible-license]
WARNING: QA Issue: libgomp-staticdev has an incompatible license. Excluding from packaging. [incompatible-license]
NOTE: Tasks Summary: Attempted 2791 tasks of which 1207 didn't need to be rerun and all succeeded.

Summary: There were 4 WARNING messages shown.
[daniel@fedora-ws poky-build-M3]

It builds successfully and whitelists only the mentioned packages in step 2.