-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider a way to keep track of "primary" licenses #50
Comments
Primarized is not a word. Just Primary would work or perhaps PRIMARY to make it prominent. |
Let me explain further:
I would like a way to end with this combining the two expressions above with
@DennisClark came with a brilliant idea which would be to use a new keyword in the expression syntax If we go with that we would get The rule would be that there could be zero or only one With this simple enhancement the expressive power would be vastly enhanced. Note that this would be entirely optional and this would mean that whenever client code that uses the license-expression library deal with SPDX expressions, then they would request casting a possible @qduanmu @mjherzog @sschuberth @mbargull @DennisClark @tdruez @pkolbus @carmenbianca @mxmehl @MaJuRG @MaJuRG @chinyeungli @johnmhoran FYI |
Just adding further about why this is useful... it is super common to have multiple licenses for a package, but all these licenses do not have the prominences. For instance, a package may be using the GPL for its command line utilities and the LGPL for a library as core, top level licenses (common for Linux userland tools) and still harbor bits of code under BSD and MIT licenses and have its build script under yet another license and its documentation under GFDL. All these licenses need to be reported alright, but in doing so and combining them all in a single license expression we may lose sight that the key, core licenses are GPL and LGPL and that the other licenses are there but secondary. |
@pombredanne, thanks for the FYI. If a license is applicable then you have to abide by the terms to use the bit of code, so understanding the entire license expression is necessary for compliance purposes. Because of this, I'm not seeing the use case that leads to prominence being a necessary concept. (Admittedly, this could well be a lack of vision on my part.) Taking the example of a declared license vs scan results a bit further, I'm not sure it's appropriate to combine in that way, as there's a difference in the level of confidence or possibly legal interpretation applied. It's possible that:
Note also that SPDX v2.2.0 (https://spdx.github.io/spdx-spec/) is consistent with this separation as it defines multiple license-expression fields: "Concluded License" (3.13), "All Licenses From Files" (3.14), and "Declared License" (3.15). But if prominence does in fact have value: treatment of the left and right sides of the PLUS as independent leads to expressions that are unnecessarily complex. ( |
I'm sorry to spoil the party here, but if I may be frank, I believe this is not a good approach. Because:
So strictly speaking, this breaks SPDX compatibility, which IMO is an absolute no-go. Third-party application must be able to rely on being able to parse the expression if they adhere to the SPDX standard. If you have a hard requirement to track primary / declared vs. other licenses you really should use different fields like e.g. we do in ORT (and SPDX itself does like @pkolbus mentioned), and only create a combined license expression on the fly on license evaluation. Or come up with a convention that does not break the standard, like using parentheses as @pombredanne suggested before (maybe extend that idea to use "dummy" double-parentheses to avoid confusion with regular parentheses). |
See also aboutcode-org/scancode-toolkit#2065 |
@sschuberth re:
Actually it would not break compatibility: the |
Ideally, there would be no such expressions. Non-SPDX license keys should become SPDX |
@pkolbus Thank you for the detailed feedback!
It is important to note that this
|
Agreed, and we should likely move ahead in that direction since spdx/spdx-spec#113 seems to be stalled... but that would not remove the value to distinguish the "main license" vs. the rest IMHO |
Here I agree, too, but IMO the best approach to document such a main / primary license would still be a dedicated field / property. |
@sschuberth re:
but then this is not one but eventually an array of license expressions that would be needed to be correct, eventually grouping each files that share a "purpose" together (say doc, build scripts, tests, dev tools, dead code, etc.) ? |
Yes, maybe something similar to ClearlyDefined's facets: https://github.com/clearlydefined/service/blob/b339cb7e281c1e35990b685efe9bfb774d9cd22f/schemas/definition-1.0.json#L151-L161 |
@sschuberth There does not seem to be any activity with CD Facets, but the concept is similar. This has also been a long-standing topic at SPDX, but no conclusion afaik. You could argue that "Relationships between SPDX Elements" capture some of this, but that is much more complex than this use case. |
@sschuberth You wrote:
Well, the thing is that it would assume that anywhere we use a single license expression string we now would need two license expressions to convey this notion of primary and secondary. I think that this would not be practical when license expressions are used outside of SPDX documents: there we have no control on the schema and adding new fields is unlikely to happen IMHO. Working towards increased adoption of using a license expression rather than an unstructured license string in a package manager metadata field is already a significant piece of work. Asking folks to break things down in multiple fields feels like an even more difficult or impossible task to me. You also wrote:
yes, conceptually. But that's also transforming the "license-expression-as-a-single-string" into "license-expression-as-a-mapping-of-key-value-pairs" which would be impractical to be adopted by many package managers tools and other places where a license expression string may be used |
Say I start from these expressions:
I would like a way to end with this combining the two expressions above with AND
The text was updated successfully, but these errors were encountered: