how can we fix our license?

After uploading a new release i found that this and all our earlier release show on hackage as "GPL-2.0-only". What we have in our darcs.cabal is "GPL-2". This was always intended to mean "or later". I wanted to fix this and upload a new release that uses the new variant "GPL-2.0-or-later" that I read about in the docs. But this isn't accepted by hackage. The upload candidate page responds with darcs-2.14.4/darcs.cabal:0:0: version with tags and cabal check says Warning: These warnings may cause trouble when distributing the package: Warning: 'license: GPL-2.0' is not a known version of that license. The known versions are 2, 3. If this is not a mistake and you think it should be a known version then please file a ticket. Warning: darcs.cabal:4:33: version with tags Note we have cabal-version: 1.24 in the cabal file, otherwise we could not support older ghc versions (we currently support ghc-8.0 and later). How can I fix this?

Hi, On Mon, Apr 27, 2020 at 11:15:46AM +0200, Ben Franksen wrote:
After uploading a new release i found that this and all our earlier release show on hackage as "GPL-2.0-only". What we have in our darcs.cabal is "GPL-2". This was always intended to mean "or later".
This is an unfortunate artifact of Cabal's overly careful translation of old-style licenses to SPDX ones on Hackage server. I've also been annoyed by this in the past and did some investigating but IIRC there just isn't any way to fix it on the server side at this point.
I wanted to fix this and upload a new release that uses the new variant "GPL-2.0-or-later" that I read about in the docs. But this isn't accepted by hackage. [...]
Note we have
cabal-version: 1.24
in the cabal file, otherwise we could not support older ghc versions (we currently support ghc-8.0 and later).
Yup and that's your problem, there just is no way to specify the new SPDX license id without upping your cabal-version, I don't remember what version that was introduced in though. Note that while a higher cabal-version does mean the user has to build with a more recent Cabal that's usually fine since even recent Cabal release' support for older GHC versions goes quite a ways back. It does mean they have to upgrade their cabal-install though. --Daniel

Hi Daniel thanks for your reply. Am 27.04.20 um 11:28 schrieb Daniel Gröber:
Note that while a higher cabal-version does mean the user has to build with a more recent Cabal that's usually fine since even recent Cabal release' support for older GHC versions goes quite a ways back. It does mean they have to upgrade their cabal-install though.
I have been working a few days on getting the package to build cleanly with all ghc versions from 8.0 up to 8.10. During that time I have played with cabal-version settings a lot and I found that 1.24 is be the only one that allows clean (warning-free) builds for all supported ghc versions. This is despite the fact that I am using cabal-install-3.2; there is some magic going on that switches the cabal file parser back to 1.24 for ghc-8.0, no matter whether cabal-version specifies newer. The following approach might work: It seems hackage allows me to change the package description in a revision. So I could make a revision that adds a line or two to the package description to point out the difference between the license displayed by hackage and the one intended.

Hi Ben, On Mon, Apr 27, 2020 at 11:48:29AM +0200, Ben Franksen wrote:
[..] I found that 1.24 is be the only one that allows clean (warning-free) builds for all supported ghc versions. [...] there is some magic going on that switches the cabal file parser back to 1.24 for ghc-8.0, no matter whether cabal-version specifies newer.
Are we talking about GHC or Cabal warnings? If Cabal that sounds really weird. Technically speaking it isn't possible for Cabal to switch to a different parser based on the ghc version as the cabal-version specifies the grammer of the cabal file and GHC version detection happens after the cabal file has long been parsed. Can you elaborate on the type of warnings you're getting?
This is despite the fact that I am using cabal-install-3.2;
Personally I find 2.4 much more stable than 3.2, maybe this is just a cabal-install bug or something. I just checked and SPDX was introduced in [cabal-version: 2.2] so maybe you can try with that and see if you get the weird behaviour on ghc-8.0? I'd really like to get to the root of the problem here because the way Cabal format evolution works we really want people being able to use newer versions with older GHCs. [cabal-version: 2.2]: https://www.haskell.org/cabal/users-guide/file-format-changelog.html#cabal-v...
The following approach might work:
It seems hackage allows me to change the package description in a revision. So I could make a revision that adds a line or two to the package description to point out the difference between the license displayed by hackage and the one intended.
Honestly if you have appropriate GPL headers in your source files anyone who cares about the distinction between v2-only and v2-or-later will be able to tell what's going on. A comment sure couldn't hurt though. --Daniel

Am 27.04.20 um 12:04 schrieb Daniel Gröber: > I'd really like to get to the root of the problem here because the way > Cabal format evolution works we really want people being able to use newer > versions with older GHCs. If I specify "cabal-version: 2.2" I get: >cabal build --enable-tests --disable-optimization --with-compiler=/opt/ghc/8.0.2/bin/ghc Resolving dependencies... Build profile: -w ghc-8.0.2 -O0 In order, the following will be built (use -v for more details): - darcs-2.14.3 (lib:darcs, exe:darcs, test:darcs-test) (first run) Warning: darcs.cabal: Unknown fields: autogen-modules (line 363) Fields allowed in this section: exposed-modules, reexported-modules, required-signatures, exposed-signatures, exposed, buildable, build-tools, build-depends, cpp-options, cc-options, ld-options, pkgconfig-depends, frameworks, extra-framework-dirs, c-sources, js-sources, default-language, other-languages, default-extensions, other-extensions, extensions, extra-libraries, extra-ghci-libraries, extra-lib-dirs, includes, install-includes, include-dirs, hs-source-dirs, other-modules, ghc-prof-options, ghcjs-prof-options, ghc-shared-options, ghcjs-shared-options, ghc-options, ghcjs-options, jhc-options, hugs-options, nhc98-options Configuring darcs-2.14.3... setup: This package description follows version 2.2 of the Cabal specification. This tool only supports up to version 1.24.2.0. The warning is okay, I get that in any case, but the last line is an error. The problem here seems to be that we have a custom Setup.hs. BTW, the "cabal-version:" has been added precisely to allow forward compatibility, so that a newer cabal version can still handle the old syntax. See https://www.haskell.org/cabal/users-guide/developing-packages.html#pkg-field-cabal-version >> It seems hackage allows me to change the package description in a >> revision. So I could make a revision that adds a line or two to the >> package description to point out the difference between the license >> displayed by hackage and the one intended. > > Honestly if you have appropriate GPL headers in your source files anyone > who cares about the distinction between v2-only and v2-or-later will be > able to tell what's going on. A comment sure couldn't hurt though. Agreed, so I guess this is what I'll do then. Cheers Ben

Hi Ben, On Mon, Apr 27, 2020 at 12:32:19PM +0200, Ben Franksen wrote:
If I specify "cabal-version: 2.2" I get:
cabal build --enable-tests --disable-optimization --with-compiler=/opt/ghc/8.0.2/bin/ghc [...] setup: This package description follows version 2.2 of the Cabal specification. This tool only supports up to version 1.24.2.0.
Ah yeah, but see that's because you're running cabal-install 1.24. Like I said you need a more recent cabal-install but cabal-install-2.2 or 2.4 should build just fine even with ghc-8.0 so that's not really a problem for users usually.
The warning is okay, I get that in any case, but the last line is an error.
So this is in fact an error then, right? Cabal doesn't just try to carry on with a .cabal file it can't parse properly, since that would be very surprising.
The problem here seems to be that we have a custom Setup.hs.
I don't think that's related. The problem is that the cabal-install version is the upper bound for the `cabal-version:` you can build with it. If you want to build a package with cabal-version:2.2 you need at least cabal-install-2.2.*. --Daniel

Am 27.04.20 um 13:30 schrieb Daniel Gröber:
On Mon, Apr 27, 2020 at 12:32:19PM +0200, Ben Franksen wrote:
If I specify "cabal-version: 2.2" I get:
cabal build --enable-tests --disable-optimization --with-compiler=/opt/ghc/8.0.2/bin/ghc [...] setup: This package description follows version 2.2 of the Cabal specification. This tool only supports up to version 1.24.2.0.
Ah yeah, but see that's because you're running cabal-install 1.24.
No, I don't:
cabal --version cabal-install version 3.2.0.0 compiled using version 3.2.0.0 of the Cabal library
Cheers Ben
participants (2)
-
Ben Franksen
-
Daniel Gröber