Skip to content
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

WIP: Factoring out unfree non-redistributable vs. unfree redistributale licenses #47237

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions lib/licenses.nix
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,14 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec {
fullName = "ISC License";
};

# Proprietary binaries; free to redistribute without modification.
issl = {
fullName = "Intel Simplified Software License";
url = https://software.intel.com/en-us/license/intel-simplified-software-license;
free = false;
redistributable = true;
};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An example of attaching the correct metadata to the actual license.


lgpl2 = spdx {
spdxId = "LGPL-2.0";
fullName = "GNU Library General Public License v2 only";
Expand Down Expand Up @@ -605,12 +613,19 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec {
unfreeRedistributable = {
fullName = "Unfree redistributable";
free = false;
# TODO: Go through the NixPkgs tree, replacing unfreeRedistributable
# licenses with the correct license that has
# { free = false; redistributable = true; }
redistributable = true;
};

unfreeRedistributableFirmware = {
fullName = "Unfree redistributable firmware";
# Note: we currently consider these "free" for inclusion in the
# channel and NixOS images.
# TODO: Set to false now that we have redistributable?
free = true;
redistributable = true;
};

unlicense = spdx {
Expand Down
10 changes: 8 additions & 2 deletions pkgs/top-level/release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@
, limitedSupportedSystems ? [ "i686-linux" ]
# Strip most of attributes when evaluating to spare memory usage
, scrubJobs ? true
# Attributes passed to nixpkgs. Don't build packages marked as unfree.
, nixpkgsArgs ? { config = { allowUnfree = false; inHydra = true; }; }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in the commit, I'm pretty sure Hydra is not currently working as intended, since it just says allowUnfree = false and the unfree detection does not distinguish between unfreeRedistributable and a generic unfree license.

# Attributes passed to nixpkgs. Don't build packages marked as unfree, unless
# they are also marked as redistributable.
# TODO: Consider adding this predicate to stdenv's check-meta for generic re-use?
, nixpkgsArgs ? { config = {
allowUnfree = false;
allowUnfreePredicate = (p: p.meta.license.redistributable or false);
inHydra = true;
}; }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add an attribute that can go into the config called allowUnfreeRedistributable, that gets checked before the more generic allowUnfree in the evaluator:
https://github.com/NixOS/nixpkgs/blob/18.03/pkgs/stdenv/generic/check-meta.nix#L184-L185

and has a nice warning message letting you know that you could get the pkg either by setting allowUnfree = true or allowUnfreeRedistributable = true in your config. I'm not entirely sure if this is the way we want to go, since at an end-user level there's not a huge difference (it's more of a Hydra/distribution distinction), and the meta evaluator is already quite complex and heavy -- so I figured I'd open a WIP PR to see if anyone else has thoughts.

}:

with import ./release-lib.nix { inherit supportedSystems scrubJobs nixpkgsArgs; };
Expand Down