Skip to contentSkip to conversation

drop obsolete HOSTTOOLS_WHITELIST_GPL-3.0 etc

PATCH In review Andre McCurdy 2 participants 7 messages Mar 31, 2016 – Apr 15, 2016

lore
Share & tools
lore
#0 lore raw

cover drop obsolete HOSTTOOLS_WHITELIST_GPL-3.0 etc

Andre McCurdy (4):
base.bbclass: drop obsolete HOSTTOOLS_WHITELIST_GPL-3.0 base.bbclass: avoid duplicate call to d.getVar('LICENSE', True) base.bbclass: include PV in 'incompatible license but whitelisted' debug base.bbclass: minor logic simplification

 meta/classes/base.bbclass                       | 41 ++++++++++---------------
 meta/classes/multilib.bbclass                   |  2 +-
 meta/conf/distro/include/default-distrovars.inc |  3 --
 3 files changed, 17 insertions(+), 29 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/4 base.bbclass: drop obsolete HOSTTOOLS_WHITELIST_GPL-3.0

base.bbclass sets 'check_license' to False (and therefore skips license checking completely) for native, nativesdk, etc recipes (ie anything which could potentially be classed as "host tools"), so supporting a dedicated whitelist of GPLv3 host tools is not necessary.

---
 meta/classes/base.bbclass                       | 25 ++++++++-----------------
 meta/classes/multilib.bbclass                   |  2 +-
 meta/conf/distro/include/default-distrovars.inc |  3 ---
 3 files changed, 9 insertions(+), 21 deletions(-)
meta/classes/base.bbclass +8 -17
index e066dc9..ab8715e 100644
@@ -499,28 +499,21 @@ python () {
 
             whitelist = []
             incompatwl = []
-            htincompatwl = []
             for lic in bad_licenses:
                 spdx_license = return_spdx(d, lic)
-                for w in ["HOSTTOOLS_WHITELIST_", "LGPLv2_WHITELIST_", "WHITELIST_"]:
+                for w in ["LGPLv2_WHITELIST_", "WHITELIST_"]:
                     whitelist.extend((d.getVar(w + lic, True) or "").split())
                     if spdx_license:
                         whitelist.extend((d.getVar(w + spdx_license, True) or "").split())
                     '''
-                    We need to track what we are whitelisting and why. If pn is 
-                    incompatible and is not HOSTTOOLS_WHITELIST_ we need to be 
-                    able to note that the image that is created may infact 
-                    contain incompatible licenses despite INCOMPATIBLE_LICENSE 
-                    being set.
+                    We need to track what we are whitelisting and why. If pn is
+                    incompatible we need to be able to note that the image that
+                    is created may infact contain incompatible licenses despite
+                    INCOMPATIBLE_LICENSE being set.
                     '''
-                    if "HOSTTOOLS" in w:
-                        htincompatwl.extend((d.getVar(w + lic, True) or "").split())
-                        if spdx_license:
-                            htincompatwl.extend((d.getVar(w + spdx_license, True) or "").split())
-                    else:
-                        incompatwl.extend((d.getVar(w + lic, True) or "").split())
-                        if spdx_license:
-                            incompatwl.extend((d.getVar(w + spdx_license, True) or "").split())
+                    incompatwl.extend((d.getVar(w + lic, True) or "").split())
+                    if spdx_license:
+                        incompatwl.extend((d.getVar(w + spdx_license, True) or "").split())
 
             if not pn in whitelist:
                 recipe_license = d.getVar('LICENSE', True)
@@ -546,8 +539,6 @@ python () {
             elif pn in whitelist:
                 if pn in incompatwl:
                     bb.note("INCLUDING " + pn + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted")
-                elif pn in htincompatwl:
-                    bb.note("INCLUDING " + pn + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted for HOSTTOOLS")
 
     needsrcrev = False
     srcuri = d.getVar('SRC_URI', True)
meta/classes/multilib.bbclass +1 -1
index 052f911..d5a3128 100644
@@ -59,7 +59,7 @@ python multilib_virtclass_handler () {
     e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + override)
 
     # Expand the WHITELISTs with multilib prefix
-    for whitelist in ["HOSTTOOLS_WHITELIST_GPL-3.0", "WHITELIST_GPL-3.0", "LGPLv2_WHITELIST_GPL-3.0"]:
+    for whitelist in ["WHITELIST_GPL-3.0", "LGPLv2_WHITELIST_GPL-3.0"]:
         pkgs = e.data.getVar(whitelist, True)
         for pkg in pkgs.split():
             pkgs += " " + variant + "-" + pkg
meta/conf/distro/include/default-distrovars.inc +0 -3
index 9779bfb..84cdaca 100644
@@ -22,9 +22,6 @@ DISTRO_FEATURES ?= "${DISTRO_FEATURES_DEFAULT} ${DISTRO_FEATURES_LIBC}"
 
 IMAGE_FEATURES ?= ""
 
-# This is a list of packages that are used by the build system to build the distribution, they are not
-# directly part of the distribution. 
-HOSTTOOLS_WHITELIST_GPL-3.0 ?= ""
 WHITELIST_GPL-3.0 ?= ""
 LGPLv2_WHITELIST_GPL-3.0 ?= "libassuan libidn"
 
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/4 base.bbclass: avoid duplicate call to d.getVar('LICENSE', True)

In reply to Andre McCurdy

Reuse the 'license' variable, instead of calling
d.getVar('LICENSE', True) again.

---
 meta/classes/base.bbclass | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
meta/classes/base.bbclass +3 -4
index ab8715e..67b3370 100644
@@ -516,7 +516,6 @@ python () {
                         incompatwl.extend((d.getVar(w + spdx_license, True) or "").split())
 
             if not pn in whitelist:
-                recipe_license = d.getVar('LICENSE', True)
                 pkgs = d.getVar('PACKAGES', True).split()
                 skipped_pkgs = []
                 unskipped_pkgs = []
@@ -528,14 +527,14 @@ python () {
                 all_skipped = skipped_pkgs and not unskipped_pkgs
                 if unskipped_pkgs:
                     for pkg in skipped_pkgs:
-                        bb.debug(1, "SKIPPING the package " + pkg + " at do_rootfs because it's " + recipe_license)
+                        bb.debug(1, "SKIPPING the package " + pkg + " at do_rootfs because it's " + license)
                         mlprefix = d.getVar('MLPREFIX', True)
                         d.setVar('LICENSE_EXCLUSION-' + mlprefix + pkg, 1)
                     for pkg in unskipped_pkgs:
                         bb.debug(1, "INCLUDING the package " + pkg)
                 elif all_skipped or incompatible_license(d, bad_licenses):
-                    bb.debug(1, "SKIPPING recipe %s because it's %s" % (pn, recipe_license))
-                    raise bb.parse.SkipPackage("incompatible with license %s" % recipe_license)
+                    bb.debug(1, "SKIPPING recipe %s because it's %s" % (pn, license))
+                    raise bb.parse.SkipPackage("incompatible with license %s" % license)
             elif pn in whitelist:
                 if pn in incompatwl:
                     bb.note("INCLUDING " + pn + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted")
Signature · 1 line
1.9.1
#3 lore raw

PATCH 3/4 base.bbclass: include PV in 'incompatible license but whitelisted' debug

In reply to Andre McCurdy

Referencing PN only is ambiguous if multiple versions of a recipe are present.

---
 meta/classes/base.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/base.bbclass +2 -1
index 67b3370..d91e059 100644
@@ -537,7 +537,8 @@ python () {
                     raise bb.parse.SkipPackage("incompatible with license %s" % license)
             elif pn in whitelist:
                 if pn in incompatwl:
-                    bb.note("INCLUDING " + pn + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted")
+                    p = d.getVar('P', True)
+                    bb.note("INCLUDING " + p + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted")
 
     needsrcrev = False
     srcuri = d.getVar('SRC_URI', True)
Signature · 1 line
1.9.1
#4 lore raw

Re: [PATCH 3/4] base.bbclass: include PV in 'incompatible license but whitelisted' debug

Quoted 23 lines · Andre McCurdy

Referencing PN only is ambiguous if multiple versions of a recipe are present.

---
 meta/classes/base.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/base.bbclass +2 -1
index 67b3370..d91e059 100644
@@ -537,7 +537,8 @@ python () {
                     raise bb.parse.SkipPackage("incompatible with
 license %s" % license)
             elif pn in whitelist:
                 if pn in incompatwl:
-                    bb.note("INCLUDING " + pn + " as buildable
 despite INCOMPATIBLE_LICENSE because it has been whitelisted")
+                    p = d.getVar('P', True)
+                    bb.note("INCLUDING " + p + " as buildable
 despite INCOMPATIBLE_LICENSE because it has been whitelisted")
Quoted 2 lines

needsrcrev = False
srcuri = d.getVar('SRC_URI', True)

FWIW, looking into this has been on my todo list. I've now merged a patch and events generated from recipes during parsing are now automatically prefixed with the recipe filename (we might not know PN/PV at that point).

Hopefully that means we can simplify some of these messages rather than meaning we have to ensure every one contains PN/PV.

Cheers,

Richard

#5 lore raw

Re: [PATCH 3/4] base.bbclass: include PV in 'incompatible license but whitelisted' debug

Quoted 32 lines · Richard Purdie
Quoted 23 lines · Andre McCurdy

Referencing PN only is ambiguous if multiple versions of a recipe are present.

---
 meta/classes/base.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/base.bbclass +2 -1
index 67b3370..d91e059 100644
@@ -537,7 +537,8 @@ python () {
                     raise bb.parse.SkipPackage("incompatible with
 license %s" % license)
             elif pn in whitelist:
                 if pn in incompatwl:
-                    bb.note("INCLUDING " + pn + " as buildable
 despite INCOMPATIBLE_LICENSE because it has been whitelisted")
+                    p = d.getVar('P', True)
+                    bb.note("INCLUDING " + p + " as buildable
 despite INCOMPATIBLE_LICENSE because it has been whitelisted")
Quoted 2 lines

needsrcrev = False
srcuri = d.getVar('SRC_URI', True)

FWIW, looking into this has been on my todo list. I've now merged a patch and events generated from recipes during parsing are now automatically prefixed with the recipe filename (we might not know PN/PV at that point).

Quoted 2 lines

Hopefully that means we can simplify some of these messages rather than meaning we have to ensure every one contains PN/PV.

Thanks. The bitbake change seems to work fine. It creates some very long lines though, as expected.

I'll be away next week, but I'll look into simplifying some of the messages when I get back (if no one beats me to it).

Quoted 3 lines

Cheers,

Richard

#6 lore raw

PATCH 4/4 base.bbclass: minor logic simplification

In reply to Andre McCurdy
---
 meta/classes/base.bbclass | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
meta/classes/base.bbclass +5 -5
index d91e059..a1e1044 100644
@@ -515,7 +515,11 @@ python () {
                     if spdx_license:
                         incompatwl.extend((d.getVar(w + spdx_license, True) or "").split())
 
-            if not pn in whitelist:
+            if pn in whitelist:
+                if pn in incompatwl:
+                    p = d.getVar('P', True)
+                    bb.note("INCLUDING " + p + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted")
+            else:
                 pkgs = d.getVar('PACKAGES', True).split()
                 skipped_pkgs = []
                 unskipped_pkgs = []
@@ -535,10 +539,6 @@ python () {
                 elif all_skipped or incompatible_license(d, bad_licenses):
                     bb.debug(1, "SKIPPING recipe %s because it's %s" % (pn, license))
                     raise bb.parse.SkipPackage("incompatible with license %s" % license)
-            elif pn in whitelist:
-                if pn in incompatwl:
-                    p = d.getVar('P', True)
-                    bb.note("INCLUDING " + p + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted")
 
     needsrcrev = False
     srcuri = d.getVar('SRC_URI', True)
Signature · 1 line
1.9.1