remove cases where cabal2nix produces a stringy license#677
remove cases where cabal2nix produces a stringy license#677jopejoe1 wants to merge 6 commits intoNixOS:masterfrom
Conversation
sternenseemann
left a comment
There was a problem hiding this comment.
Please also add a changelog entry, ideally noting when nixpkgs added support for lib.licensesSpdx.
|
|
||
| fromCabalLicense :: Distribution.License.License -> Distribution.Nixpkgs.License.License | ||
| fromCabalLicense (GPL Nothing) = Unknown (Just "GPL") | ||
| fromCabalLicense (GPL Nothing) = Known "lib.licenses.gpl2Plus" |
There was a problem hiding this comment.
These cases are intentional as there is not enough information to conclude what variant of the license in question is used.
There was a problem hiding this comment.
I do realize they were intentional, but they can't stay in their current form. I'm currently working towards disallowing stringy licenses in nixpkgs, and those are pretty much the only ones left. Other options would be to make it even less informational with lib.licenses.free or to add a new custom license (not really a fan of this).
There was a problem hiding this comment.
I looked at a few packages in more detail and I think we can reasonably do two things:
- interpret
GPLasgpl2Plusas done here. That's because they could have usedGPL-2orGPL-3if they wanted to be more specific. - just use
freeas fallback for this.
For me, both are fine.
There was a problem hiding this comment.
free as a fallback seems reasonable for GPL without further specification, that is a good idea. (But not in general as a fallback for unknown, see #677 (comment)).
| homepage = "https://github.com/blamario/incremental-parser"; | ||
| description = "Generic parser library capable of providing partial results from partial input"; | ||
| license = "GPL"; | ||
| license = lib.licenses.gpl2Plus; |
There was a problem hiding this comment.
Upstream has changed to GPL-3 by now.
There was a problem hiding this comment.
It is probably fine to update these test expressions to newer versions of the cabal file, but some of them may test something specific that has since been removed.
| homepage = "http://github.com/jgm/highlighting-kate"; | ||
| description = "Syntax highlighting"; | ||
| license = "GPL"; | ||
| license = lib.licenses.gpl2Plus; |
There was a problem hiding this comment.
Upstream still uses GPL, and has gpl2Only, I think: https://github.com/jgm/highlighting-kate/blob/master/LICENSE
| homepage = "https://github.com/skogsbaer/HTF/"; | ||
| description = "The Haskell Test Framework"; | ||
| license = "LGPL"; | ||
| license = lib.licenses.lgpl2Plus; |
There was a problem hiding this comment.
Upstream has now LGPL-2.1, which renders as LGPL-2.1-only on hackage.
| homepage = "https://wiki.haskell.org/Lambdabot"; | ||
| description = "Social plugins for Lambdabot"; | ||
| license = "GPL"; | ||
| license = lib.licenses.gpl2Plus; |
There was a problem hiding this comment.
lambdabot-social-plugins has GPL, but.. the license looks like BSD/MIT: https://github.com/lambdabot/lambdabot/blob/master/lambdabot-social-plugins/LICENSE
| homepage = "http://github.com/jgm/texmath"; | ||
| description = "Conversion between formats used to represent mathematics"; | ||
| license = "GPL"; | ||
| license = lib.licenses.gpl2Plus; |
There was a problem hiding this comment.
texmath has updated to GPL-2, which renders as GPL-2.0-only on hackage.
|
|
||
| fromCabalLicense :: Distribution.License.License -> Distribution.Nixpkgs.License.License | ||
| fromCabalLicense (GPL Nothing) = Unknown (Just "GPL") | ||
| fromCabalLicense (GPL Nothing) = Known "lib.licenses.gpl2Plus" |
There was a problem hiding this comment.
I looked at a few packages in more detail and I think we can reasonably do two things:
- interpret
GPLasgpl2Plusas done here. That's because they could have usedGPL-2orGPL-3if they wanted to be more specific. - just use
freeas fallback for this.
For me, both are fine.
|
For context, see also #520. One thing to keep in mind is that while cabal2nix mostly deals with Hackage, it may also process arbitrary cabal files. We can make some assumptions in Nixpkgs since additions of unfree packages would always have to be manual, but it does not seem wise to have such assumptions leak into In particular,
Apologies for the inconsistent messages. Some of my earlier comments were informed by an incorrect assumption how we decide on free/nonfree. (Note that prior to #520, cabal2nix would prevent “unfree” packages from being built on Hydra, but Nixpkgs seems to consider stringy licenses as free by default (?). So from |
|
Cherry picked 7a5af01 onto master. |
|
We currently have about 250 packages with a string license we actually are building and distributing. In total, |
`stdenv.mkDerivation` does not require meta.license to be passed, so there is no reason `haskellPackages.mkDerivation` needs to enforce this. This would free up cabal2nix to not report a license if it is not sure. As I have argued in NixOS/cabal2nix#677 (comment), it is better not to report a license than reporting an inaccurate one. This would also allow to stop generating arbitrary strings as licenses in cabal2nix to remove string values to facilitate more cleanliness in the spirit of #445672, though the question is whether it is wise to remove the meta data altogether.
|
Sorry for not being really active in here was working on an improvement for licenses in nixpkgs for making this nicer to implement here. see NixOS/nixpkgs#468378 |
002da57 to
02b5459
Compare
|
Did a larger refactor based on the changes done in NixOS/nixpkgs#468378 and the feedback that was given here. |
make use of the new compaund licenses in nixpkgs to get more correct licensing information
we do our own logic in nixpkgs based on is writen in meta.licenses with more complex logic than this
if we don't know the specific version of a license fallback to a generic free license
if we don't know a license mark the package as unfree. We do not leave it empty as that should only be done with internal nixpkgs derivations, we also don't want a stringy license as they are due to be deprecated, we should also not use free in this case as we do not know in all cases that it realy is free.
I'm working on removing all stringy licenses in nixpkgs, and currently the only ones left are the ones in haskellPackages
and node2nix packages. This change fixes the ones for Haskell packages.