[OE-core] [PATCH 5/7] base.bbclass: Report only the licenses that are incompatible for a package

Quentin Schulz quentin.schulz at streamunlimited.com
Mon Dec 9 10:20:19 UTC 2019


Hi Peter,

On Sat, Dec 07, 2019 at 06:38:13AM +0100, Peter Kjellerstedt wrote:
> Instead of reporting ${LICENSE} when a package is identified as using
> an incompatible license, report the license(s) that are actually
> incompatible.
> 
> Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt at axis.com>
> ---
[...]
> diff --git a/meta/lib/oeqa/selftest/cases/incompatible_lic.py b/meta/lib/oeqa/selftest/cases/incompatible_lic.py
> index ad878571b5..9d1e801117 100644
> --- a/meta/lib/oeqa/selftest/cases/incompatible_lic.py
> +++ b/meta/lib/oeqa/selftest/cases/incompatible_lic.py
> @@ -4,7 +4,7 @@ from oeqa.utils.commands import bitbake
>  class IncompatibleLicenseTests(OESelftestTestCase):
>  
>      def lic_test(self, pn, pn_lic, lic):
> -        error_msg = 'ERROR: Nothing PROVIDES \'%s\'\n%s was skipped: it has an incompatible license: %s' % (pn, pn, pn_lic)
> +        error_msg = 'ERROR: Nothing PROVIDES \'%s\'\n%s was skipped: it has incompatible license(s): %s' % (pn, pn, pn_lic)
>  
>          self.write_config("INCOMPATIBLE_LICENSE += \"%s\"" % (lic))
>  
> @@ -27,12 +27,12 @@ class IncompatibleLicenseTests(OESelftestTestCase):
>      # license cannot be built when INCOMPATIBLE_LICENSE contains this SPDX
>      # license
>      def test_incompatible_spdx_license_alias(self):
> -        self.lic_test('incompatible-license-alias', 'GPLv3', 'GPL-3.0')
> +        self.lic_test('incompatible-license-alias', 'GPL-3.0', 'GPL-3.0')
>  
>      # Verify that a package with an alias (from SPDXLICENSEMAP) to an SPDX
>      # license cannot be built when INCOMPATIBLE_LICENSE contains this alias
>      def test_incompatible_alias_spdx_license_alias(self):
> -        self.lic_test('incompatible-license-alias', 'GPLv3', 'GPLv3')
> +        self.lic_test('incompatible-license-alias', 'GPL-3.0', 'GPLv3')
>  

We currently have 4 tests:
 - GPL-3.0 in LICENSE field in recipe and GPL-3.0 in INCOMPATIBLE_LICENSE
 - GPL-3.0 in LICENSE field in recipe and GPLv3 in INCOMPATIBLE_LICENSE
 - GPLv3 in LICENSE field in recipe and GPL-3.0 in INCOMPATIBLE_LICENSE
 - GPLv3 in LICENSE field in recipe and GPLv3 in INCOMPATIBLE_LICENSE

They test that the alias system (SPXLICENSEMAP) still works, which is
rather important since we never enforced the use of licenses from
SRC_DISTRIBUTE_LICENSES in LICENSE in recipes and allowed the use of
aliases (hence SPXLICENSEMAP).

If I'm not mistaken this change induces the following 4 tests:
 - GPL-3.0 in LICENSE field in recipe and GPL-3.0 in INCOMPATIBLE_LICENSE
 - GPL-3.0 in LICENSE field in recipe and GPLv3 in INCOMPATIBLE_LICENSE
 - GPL-3.0 in LICENSE field in recipe and GPL-3.0 in INCOMPATIBLE_LICENSE
 - GPL-3.0 in LICENSE field in recipe and GPLv3 in INCOMPATIBLE_LICENSE

which duplicates two tests.

The questions are: which error warranted this code change?

Are SPDXLICENSEMAP aliases still working? Can it still be checked?

If the original tests are indeed not needed anymore, we need to explicit
why (and we can actually just remove them).

I'm still advocating for new tests with wildcards :)

Thanks,
Quentin


More information about the Openembedded-core mailing list