-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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
licenses.sspl cannot be used in allowlistedLicenses/blocklistedLicenses or shortName should link to lib.licenses atrrset #154031
Comments
Why do we even have this restriction in a first place? nixpkgs/pkgs/stdenv/generic/check-meta.nix Lines 22 to 27 in c4bb908
I'm not sure what it solves. And documentation is silent about side-effect of using in-place license which is that it is not usable in Tracing back to when it was introduced led me to commit from 2015 with sole description "stdenv: take license parameter checks out of mkDerivation path". But original code had no such restrictions: nixpkgs/pkgs/stdenv/generic/default.nix Lines 91 to 113 in aca361f
(this is roughly what I expected when I tried to use Can we remove this restriction? |
Oops I missed this question, sorry. I don't remember, but I expect that I added the check to make sure that all licenses are maintained in the central registry. |
Describe the bug
Looks like
blocklistedLicenses
/allowlistedLicenses
require referenced licensesshortName
to match attribute name oflib.licenses
.This is broken for SSPL license and for some packages that have inline license attrset.
Steps To Reproduce
Steps to reproduce the behavior:
nixpkgs.config.blocklistedLicenses = [ pkgs.lib.licenses.sspl ];
(can use alsoallowlistedLicenses
) in NixOS global configuration.Expected behavior
Can build your system unless it references package with license
sspl
(I guess Mongodb related stuff) and which is referenced inblocklistedLicenses
.Can reference licenses in-lined in packages . E.g.
pkgs.ntp.meta.license
(or its direct value)nixpkgs/pkgs/tools/networking/ntp/default.nix
Lines 33 to 36 in 048fd95
Screenshots
Additional context
This was found out in attempt to use pre-approved list of "safe" open source licenses by adding in
blocklistedLicenses
all that are not on the list but present inlib.licenses
. Butsspl
have next definition (notice upper case inshortName
):nixpkgs/lib/licenses.nix
Lines 757 to 759 in 048fd95
In order to fully implement pre-approved "allow list" (different from
allowlistedLicenses
) it is required to be able to reference licenses that are in package meta but not inlib.licenses
.Notify maintainers
MongoDB maintainers: @bluescreen303 @offline @cstrahan
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.zsh% nix run nixpkgs\#nix-info -- -m
"x86_64-linux"
Linux 5.10.81, NixOS, 21.11 (Porcupine)
yes
yes
nix-env (Nix) 2.4
"nixos-21.11.334684.1158f346391"
"nixpkgs-unstable-21.11pre310022.14b0f20fa1f"
/nix/var/nix/profiles/per-user/root/channels/nixos
The text was updated successfully, but these errors were encountered: