spdx: add support for WITH operator
Hi,
Quoted 6 lines
-----Original Message-----
From: Peter Kjellerstedt <[email protected]>
Sent: Tuesday, November 26, 2024 6:40 PM
To: Denis OSTERLAND-HEIM <[email protected]>; [email protected]
Subject: RE: [OE-core] [PATCH 2/3] spdx: add support for WITH operator
Quoted 6 lines
I have some concerns about this change:
* The above change does not really implement support for WITH. It only supports converting a LICENSE expression containing a WITH clause (expressed using the "+" operator) from bitbake format into SPDX format. All the actual handling of WITH clauses is missing.
Right, it is just a first step.
Quoted 5 lines
* There are a lot of complexities related to the incompatible license handling (which is the main reason for the license handling in
meta/lib/oe/license.py). There will be problems if someone specifies a LICENSE as "Foo + Exception | Bar". E.g., consider what should happen if "Foo" is inINCOMPATIBLE_LICENSE.
Good point. Would definetly require more logic.
Quoted 3 lines
* We also used to use "+" to indicate "or later". This can be seen in
obsolete_license_list(). Weird things will probably happen if an old LICENSE like "GPL2+ & LGPLv2+" is encountered.
Right, as specified by SPDX. [^1]
This is really a blocking point for '+'.
Quoted 4 lines
It would probably be easier to just add a GPL-2.0-with-syscall-exception (as was initially suggested), but containing the full GPL-2.0 license as well as the exception (compare to, e.g., Apache-2.0-with-LLVM-exception.
I agree.
Quoted 11 lines
I also note that out of the six licenses used in OE-Core/OpenEmbedded that use exceptions:
Apache-2.0-with-LLVM-exception
GPL-2.0-with-GCC-exception [^2]
GPL-2.0-with-OpenSSL-exception
GPL-3-with-bison-exception [^3]
GPL-3.0-with-GCC-exception [^4]
GPL-3.0-with-autoconf-exception [^5]
Quoted 4 lines
only Apache-2.0-with-LLVM-exception and GPL-2.0-with-OpenSSL-exception contain the actual license text. The other use an "insert <license> here" reference. gcc has covered it by using "GPL-3.0-with-GCC-exception & GPL-3.0-only", but that is not the case for most other recipes.
Right.
Apache-2.0-with-LLVM-exception and GPL-2.0-with-OpenSSL-exception are not listed on spdx.org/licenses and the others are listed with the "insert <license> here".
The clean way would be to implement the WITH operator.
To avoid the effort and improve the situation, maybe it would be an idea to copy GPL-2.0-only together with GPL-2.0-with-GCC-exception into GPL-2.0-only-with-GCC-exception.
Regards, Denis
Quoted 2 lines
//Peter
[^1]: https://spdx.github.io/spdx-spec/v2.3/SPDX-license-expressions/
[^2]: https://spdx.org/licenses/GPL-2.0-with-GCC-exception.html
[^3]: https://spdx.org/licenses/GPL-2.0-with-bison-exception.html
[^4]: https://spdx.org/licenses/GPL-3.0-with-GCC-exception.html
[^5]: https://spdx.org/licenses/GPL-3.0-with-autoconf-exception.html
Quoted 6 lines · Denis OSTERLAND-HEIM via lists.openembedded.org
Right.
Apache-2.0-with-LLVM-exception and GPL-2.0-with-OpenSSL-exception are not listed on spdx.org/licenses and the others are listed with the "insert <license> here".
The clean way would be to implement the WITH operator.
To avoid the effort and improve the situation, maybe it would be an idea to copy GPL-2.0-only together with GPL-2.0-with-GCC-exception into GPL-2.0-only-with-GCC-exception.
I agree with Peter - in the short term add a GPL-with-syscall-exception license because the fallout for just adding + to the LICENSE parser is greater than just mapping it to WITH in the SPDX code, there’s all the license handling logic and missing test cases that need to extended too. We don’t want to merge just the remapping without test cases to verify that nothing else breaks, at least.
Of course if we extend the license logic further to support + properly, at that point we’re basically reimplementing SPDX license semantics but with a new syntax so I’d personally be in favour of moving our LICENSE field to just being a SPDX license string (potentially with backward compatible parsing for a cycle or so). This means we can reuse existing code, and the semantics of the field is well defined.
Ross