Skip to content

cabal2nix: Assume "unknown" hackage license to be free #520

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

Merged
merged 1 commit into from
Sep 23, 2021

Conversation

maralorn
Copy link
Member

@maralorn maralorn commented Sep 22, 2021

We are currently very inconsequent in regard to "unknown" licenses. In
general they stem from packages having their license field set to
"LicenseRef-OtherLicense" accompanied by a LICENSE file which specifies
the real license.

Currently in nixpkgs "unknown" licenses result in hydra builds being
disabled for that package, but the package is not treated as "unfree" by
anything else in nixpkgs. Users don‘t get warnings when they use them
and we actually very often build those packages on hydra because they
are dependencies on other packages with free licenses.

This change simply acknowledges the fact that we are already building
and distributing most of these packages by giving them their own hydra
job.

Here are the arguments in favor of this:

  • We have been distributing those packages all along and no one complained.
  • hackage rules require all packages to be "open source in spirit".
  • There are no known unfree packages on hackage.
  • If we notice an unfree package we can always declare the package unfree in the
    hackage2nix config.

This is the easiest solution to deal with the existing inconsistencies.
All other approaches would be more invasive and would mean more
maintainer overhead.

While this might not be the best overall solution for dealing with
licenses, e.g. we could try to get rid of all stringly licenses, we can
always do that improvements later.

@sternenseemann
Copy link
Member

Crucially, hackage doesn't require uploaders to grant anyone permission to distribute binary forms of their packages. However in practice this is probably not an issue. The restrictions on binary redistributions are usually accompanied with a requirement to distribute the source code with it (arguably we comply to this since you can trivially obtain the src attributes uses) and/or the ability to relink the product with different libraries which we allow for via overriding etc.

Also as you've argued in effect this doesn't really change anything.

@sternenseemann
Copy link
Member

As a side note, we should probably add a way to blacklist a package (which, I guess replaces the package with a throw), that'd also be useful for the spam category on hackage.

@@ -165,5 +165,5 @@ fromSPDXLicense (SPDX.License expr) =

isFreeLicense :: Distribution.Nixpkgs.License.License -> Bool
isFreeLicense (Known "lib.licenses.unfree") = False
isFreeLicense (Unknown Nothing) = False
isFreeLicense (Unknown Nothing) = True
Copy link
Member

Choose a reason for hiding this comment

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

Could you leave a comment on this line explaining the reasoning for this?

Probably just copying some of the PR comment body here would be fine.

If someone is looking through this code, I imagine they might be surprised that unknown licenses are marked as free.

Other than that, this LGTM!

We are currently very inconsequent in regard to "unknown" licenses. In
general they stem from packages having their license field set to
"LicenseRef-OtherLicense" accompanied by a LICENSE file which specifies
the real license.

Currently in nixpkgs "unknown" licenses result in hydra builds being
disabled for that package, but the package is not treated as "unfree" by
anything else in nixpkgs. Users don‘t get warnings when they use them
and we actually very often build those packages on hydra because they
are dependencies on other packages with free licenses.

This change simply acknowledges the fact that we are already building
and distributing most of these packages by giving them their own hydra
job.
@maralorn maralorn merged commit 749491a into NixOS:master Sep 23, 2021
@maralorn maralorn deleted the unknown-free branch September 23, 2021 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants