LLGPL appears to be treated as a plain license, not as a license exception
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Mit dem Python-Snippet unter Verwendung von license_expression.get_spdx_licensing() und dem strikten Parsen von "LGPL-2.1-or-later WITH LLGPL" reproduzieren. Beginne bei license_expression/init.py an den Traceback-Pfaden rund um parse, tokenize und replace_with_subexpression_by_license_symbol. Erledigt bedeutet, dass LLGPL entweder als Exception in strikten WITH-Ausdrücken akzeptiert wird oder das Projekt dokumentiert, warum es eine einfache Lizenz bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Hi! 👋
As background: I have added this project as backend for namcap, a validation tool for packages and build scripts, that is used on Arch Linux. From what I can tell after integrating is, that it works pretty well for our use-case and helps us a great deal in being more compliant with SPDX license identifiers (see https://rfc.archlinux.page/0016-spdx-license-identifiers/). Thanks for that! 🎉
However, there appear to be edge cases and maybe you are able to help me in figuring this particular one out.
When trying to package an upstream that uses the LLGPL preamble my assumption would be, after reading
Exceptions are added to a license using the License Expression operator, "WITH".
on https://spdx.org/licenses/exceptions-index.html that an expression such as LGPL-2.1-only WITH LLGPL would be valid. This does not seem to be the case though:
Python 3.11.6 (main, Nov 14 2023, 09:36:21) [GCC 13.2.1 20230801] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from license_expression import get_spdx_licensing
>>> licensing = get_spdx_licensing()
>>> licensing.parse("LGPL-2.1-or-later WITH LLGPL", strict=True)
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/license_expression/__init__.py", line 540, in parse
tokens = list(self.tokenize(
^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/license_expression/__init__.py", line 604, in tokenize
for token in tokens:
File "/usr/lib/python3.11/site-packages/license_expression/__init__.py", line 1090, in replace_with_subexpression_by_license_symbol
raise ParseError(
boolean.boolean.ParseError: A plain license symbol cannot be used as an exception in a "WITH symbol" statement. for token: "LLGPL" at position: 23
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.11/site-packages/license_expression/__init__.py", line 548, in parse
raise ExpressionParseError(
license_expression.ExpressionParseError: A plain license symbol cannot be used as an exception in a "WITH symbol" statement. for token: "LLGPL" at position: 23
>>> licensing.parse("LGPL-2.1-or-later WITH LLGPL")
LicenseWithExceptionSymbol(license_symbol=LicenseSymbol('LGPL-2.1-or-later', aliases=('LGPL-2.1+',), is_exception=False), exception_symbol=LicenseSymbol('LLGPL', aliases=('LicenseRef-scancode-llgpl',), is_exception=False))
>>>
When looking at above output, it becomes clear, that the expression fails parsing when applying strict rules, because LLGPL is treated as a "plain license". This is evidenced by it being represented by a LicenseSymbol where is_exception=False when not applying strict rules during parsing.
Relatedly, we apply strict parsing by default, because we want to have SPDX compliant expressions and we want to have them to be correctly distinguished between plain licenses and exceptions for packaging reasons. In the case of LLGPL this does not seem to work correctly and namcap fails parsing the license expression.
Furthermore (and to make things somewhat more complicated, but also more specific and useful for us as a distribution), when it comes to packaging, on Arch Linux we rely on a system-wide package (see https://gitlab.archlinux.org/archlinux/packaging/packages/licenses) to provide "common" license and exception files in well-known locations. Those "common" license files are of licenses and exceptions that are frequently used verbatim and do not contain or require individually identifying information (e.g. specific list of authors) or an ever-changing date identifier. We also provide full lists of all known license and exception identifiers separately. The package allows us to centrally share common license files and not repackage them in every package.
Namcap in turn relies on this information to identify and correlate known identifiers and the ones that are common (and thus do not need to be packaged).
This unfortunately does not work with LLGPL though, since license-expression treats it as a plain license, not an exception identifier. As such namcap fails when adding it in a WITH expression (e.g. LGPL-2.1-or-later WITH LLGPL) and would if provided plainly (e.g. LLGPL) require the user to prefix it with LicenseRef-, because LLGPL is not found in the list of "known" licenses (as it is in the list of "known" license exceptions).
From my understanding, the expression LGPL-2.1-or-later WITH LLGPL should be valid though and LLGPL should be treated as a license exception, not a plain license.
This leads me to the question: Is there a specific reason why LLGPL is treated as a plain license and not as a license exception?
- Vorherrschende Sprache
- Python
- Sterne
- 74
- Forks
- 38
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus aboutcode-org/license-expression
-
Bump setuptools dependency and remove wheel dependencyEvtl. vergeben @devnishantt hat das vor 51 Tagen übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 83/100
aboutcode-org/license-expression#132 · 1 Kommentar ·
-
Schwierigkeit 3/5 Ein halber Tag Anfängerfreundlichkeit 55/100
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 52/100
aboutcode-org/license-expression#124 · 3 Kommentare ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 30/100
aboutcode-org/license-expression#121 · 5 Kommentare ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 48/100
aboutcode-org/license-expression#120 · 2 Kommentare · 1 Reaktion ·
Alle Issues in aboutcode-org/license-expression
Ähnliche Issues
-
Internal ErrorOffenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
frappe/frappe_docker#2071 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug python
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
traceloop/openllmetry#4717 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
The-Pocket/PocketFlow#161 ·
-
[Bug]: Webapp workspace fails to render in Safari — "Can't find variable: requestIdleCallback"Offencomp/desktop P2 type/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
NousResearch/hermes-agent#157702 ·
Maintainer antworten meist innerhalb von 1 Tag
-
scibench_physics / scibench_chemistry: a correct answer scores 0 when the unit has a power of tenEvtl. vergeben @BahaaMattar hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
EvolvingLMMs-Lab/lmms-eval#1699 ·
Maintainer antworten meist innerhalb von 1 Tag