Repository navigation
lib.licenses: add compound licenses - #468378
Conversation
|
Might evaluate performance impact, for example intepreting all lists as AND/OR, and see how much more time we will spend on eval? |
|
#348238 should be quite similar to this in terms of perf impact and I couldn't find any. |
Atemu
left a comment
There was a problem hiding this comment.
This is great work, thank you for doing this! :)
Some details I have opinions on but I'm in full support of the core idea.
| # Arguments | ||
|
|
||
| - [base] Possible license to chose from | ||
| - [mod] Other possible license to chose from |
There was a problem hiding this comment.
Nit: I'd prefer a more descriptive name be used for this parameter and attribute name
There was a problem hiding this comment.
These should now be way better now that it switched. To using lists
| asl20 | ||
| llvm-exception | ||
| ]; | ||
| # Contributions after June 1st, 2024 are only licensed under asl20 and |
There was a problem hiding this comment.
Tangential but this comment was and is very misleading. The relevant info is that, since 19, there is asl20-only code, requiring acceptance of both licenses. Which one of those applies for new contributions is irrelevant.
| # Example | ||
|
|
||
| ```nix | ||
| isRedistributable lib.licenses.mit |
There was a problem hiding this comment.
Given that these functions are capable of dealing with composite license expressions, it'd make sense to have examples for those too. (Applies to all of these helpers.)
Pandapip1
left a comment
There was a problem hiding this comment.
Is there any way to make all the licenses functors so that you could use infix operators (e.g. with lib.licenses; mit OR asl20 would be valid)
e28beab to
37236b7
Compare
|
@Atemu applied some of your review comments. Some more I still need to work my way through. |
37236b7 to
3740f0d
Compare
|
Does this include any breaking changes? The pure additions should be backported to 25.11 so expressions can be portable across Nixpkgs versions. |
It should not, but it would probably be good if someone did a double-check on this to make sure I did not miss anything regarding that. Edit: Maybe if some did some weird mapping on |
With compound licenses[1] recently merged, we can now properly represent dual licensed packages without affecting its non-free status. See NixOS#392710 (comment) [1]: NixOS#468378
With compound licenses[1] recently merged, we can now properly represent dual licensed packages without affecting its non-free status. See NixOS#392710 (comment) [1]: NixOS#468378
|
This is definitely breaking for anyone who uses |
Nixpkgs is introducing compound license expressions (AND, OR, WITH, PLUS) via NixOS/nixpkgs#468378. This extends the `License` enum to deserialize the new `licenseType`-tagged structures, recursively flattens them into leaf licenses for the search index, and exposes a `package_license_expression` field carrying the SPDX-style expression string when compound licenses are present. Bump import index version to 47 for the new field.
Nixpkgs is introducing compound license expressions (AND, OR, WITH, PLUS) via NixOS/nixpkgs#468378. This extends the `License` enum to deserialize the new `licenseType`-tagged structures, recursively flattens them into leaf licenses for the search index, and exposes a `package_license_expression` field carrying the SPDX-style expression string when compound licenses are present. Bump import index version to 47 for the new field.
Nixpkgs is introducing compound license expressions (AND, OR, WITH, PLUS) via NixOS/nixpkgs#468378. This extends the `License` enum to deserialize the new `licenseType`-tagged structures, recursively flattens them into leaf licenses for the search index, and exposes a `package_license_expression` field carrying the SPDX-style expression string when compound licenses are present. Bump import index version to 47 for the new field.
Nixpkgs is introducing compound license expressions (AND, OR, WITH, PLUS) via NixOS/nixpkgs#468378. This extends the `License` enum to deserialize the new `licenseType`-tagged structures, recursively flattens them into leaf licenses for the search index, and exposes a `package_license_expression` field carrying the SPDX-style expression string when compound licenses are present. Bump import index version to 47 for the new field.
Nixpkgs is introducing compound license expressions (AND, OR, WITH, PLUS) via NixOS/nixpkgs#468378. This extends the `License` enum to deserialize the new `licenseType`-tagged structures, recursively flattens them into leaf licenses for the search index, and exposes a `package_license_expression` field carrying the SPDX-style expression string when compound licenses are present. Bump import index version to 47 for the new field.
Nixpkgs is introducing compound license expressions (AND, OR, WITH, PLUS) via NixOS/nixpkgs#468378. This extends the `License` enum to deserialize the new `licenseType`-tagged structures, recursively flattens them into leaf licenses for the search index, and exposes a `package_license_expression` field carrying the SPDX-style expression string when compound licenses are present. Bump import index version to 47 for the new field.
Nixpkgs is introducing compound license expressions (AND, OR, WITH, PLUS) via NixOS/nixpkgs#468378. This extends the `License` enum to deserialize the new `licenseType`-tagged structures, recursively flattens them into leaf licenses for the search index, and exposes a `package_license_expression` field carrying the SPDX-style expression string when compound licenses are present. Bump import index version to 47 for the new field.
Nixpkgs is introducing compound license expressions (AND, OR, WITH, PLUS) via NixOS/nixpkgs#468378. This extends the `License` enum to deserialize the new `licenseType`-tagged structures, recursively flattens them into leaf licenses for the search index, and exposes a `package_license_expression` field carrying the SPDX-style expression string when compound licenses are present. Bump import index version to 47 for the new field.
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
|
Hi! Moving the I believe there's a case to be made that:
Questions:
PS Can't resist pointing out the obvious irony of shipping a more elaborate copyright management logic at the same time as legalizing LLM outputs in the core project 🙃 |
That was mostly the case but not always as I started working on this and #451424 (which introduced the enforcement of valid check-meta), but even that only check if it's an
They don't, if they accepted one of the license in it that gets used.
I'm not planing to ship anything more complicated than what was included in this pr.
Was working on this longer that that was such a prevalent topic in nixpkgs and TBH all these AI-contributes kinda take a way my fun on reviewing and writing prs. (NixOS is a hobby for me) |
|
"They don't" and "if they accepted one [...], that gets used" are mutually exclusive as I understand them? In particular, I think (finding and) using the "one that they accepted" is a form of SAT, albeit with a greedy solution...
I don't think we have a machinery for that ready, do we?
I can relate... |
This adds support for expressing more complex licenses in nixpkgs by adding functions for the SPDX operators so that we can express AND, OR and WITH in our licenses.
This also adds some helper functions to work with these in check-check meta.
cc: @emilazy @alyssais (for being codeowners of lib.licenses)
cc: @Atemu (for having some discussion over this with me and #283706)
Note that this probably still needs some work, as I did not really get much feedback on this yet.
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.