Open jneira opened 6 years ago
Hi. You're right, dhall-to-cabal
only takes inputs where the cabal version is exactly specified. I've done this because of this comment:
The version of the Cabal spec that this package description uses. For historical reasons this is specified with a version range but only ranges of the form >= v make sense. We are in the process of transitioning to specifying just a single version, not a range. See also specVersion.
This is on specVersionRaw
here.
Before we look at solutions, I haven't entirely understand why this constraint is causing a problem. Could you elaborate as to why you need >= 1.10
?
I think the problem is that old Cabal spec versions do strictly require the >=
(i.e., writing cabal-vesion: 1.10
won't work). But it probably makes more sense to have a check for being less than 1.10 and inserting the >=
in that case unconditionally anyway, and not otherwise, rather than leaving it up to the user.
I'm not entirely sure it's in the remit of dhall-to-cabal
to do that validation (there are various ways you can construct a Cabal file that parses, but isn't accepted by cabal
semantically). That said, adding the >=
seems reasonable.
cabal check
with cabal-version = 1.10
:
PS C:\dhall\dhall-to-cabal> cabal --version
cabal-install version 2.2.0.0
compiled using version 2.2.0.1 of the Cabal library
PS C:\dhall\dhall-to-cabal> type .\dhall-to-cabal.cabal | sls "cab
al-version"
cabal-version: 1.10
PS C:\dhall\dhall-to-cabal> cabal check
The following warnings are likely to affect your build negatively:
Hackage would reject this package.
Although it is a warning the last sentence sounds really bad 😉
Moreover, `cabal-to-dhall` does not support cabal files with `cabal-version: >= 1.10`
Hi, it seems dhall-to-cabal dont support the
>= 1.10
value in the field, only a simple version like2.0
. However cabal files referencing cabal specs below 1.12 must use the form>= 1.10
. Although packages should update those versions i guess there are many of them using it yet. Not sure about how to implement it indhall-to-cabal
andcabal-to-dhall
:cabal-version
to< Left : ./Version.dhall | Right : ./VersionRange.dhall >
specVersionRaw :: Either Version VersionRange
>= 1.10
Thanks!