-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
cabal2nix fails on cabal://postgresql-simple #501
Comments
The error only happens when I get cabal2nix from the unstable nixos channel. It works in nixos-21.05, which is still cabal2nix 2.17.0. So it must be caused by an update to some dependency? |
This comment has been minimized.
This comment has been minimized.
hackage-db 2.1.1 doesn't work properly with Cabal 3.2.*, so it seems we need to require at least Cabal 3.4: NixOS/cabal2nix#501 Uploading a revised cabal file to hackage would be nice, so stackage hopefully reverts to hackage-db 2.1.0 (if that even works). Not sure if hackage-db 2.1.0 needs an upper bound on Cabal (< 3.4).
Okay, I've confirmed that the culprit is I'll downgrade |
Stackage Nighly recently upgraded their version of hackage-db from 2.1.0 to 2.1.1. 2.1.1 had a compatibility fix for Cabal 3.4 [1]. However it did not increase the version bound on Cabal nor fails to compile with Cabal 3.2, so Stackage was able to update it. Unfortunately hackage-db with Cabal 3.2 causes observable issues [2] in cabal2nix, so we need to downgrade it for all compilers that still ship a Cabal version < 3.4. Also ideally we should update the constraints for hackage-db 2.1.0 and hackage-db 2.1.1 on hackage. See also [3]. [1]: NixOS/hackage-db#12 [2]: NixOS/cabal2nix#501 [3]: NixOS/hackage-db#14
Nevermind, |
The issue persists with Cabal 3.4.0.0 and hackage-db 2.1.1 (tested with #503). |
…int` Previously we used `Dependency` for this which became impossible with Cabal 3.4.0.0 since the third field became a `NonEmptySet` in that version whereas in our use case it would always be empty. We can't however parse the version range in an isolated fashion, since that leads to problems like NixOS/cabal2nix#501 The solution is to use `PackageVersionConstraint` which seems to be the intended type to use instead of `Dependency` for these kinds of applications.
Previously we used `Dependency` for this which became impossible with Cabal 3.4.0.0 since the third field became a `NonEmptySet` in that version whereas in our use case it would always be empty. We can't however parse the version range in an isolated fashion, since that leads to problems like NixOS/cabal2nix#501 The solution is to use `PackageVersionConstraint` which seems to be the intended type to use instead of `Dependency` for these kinds of applications.
…sion ranges Previously we used `Dependency` for this which became impossible with Cabal 3.4.0.0 since the third field became a `NonEmptySet` in that version whereas in our use case it would always be empty. We can't however parse the preferred version ranges file in an isolated fashion, since it always also contains the package name. This leads to a parse failure for all packages that have the preferred-version-ranges file, like postgresql-simple (see NixOS/cabal2nix#501). The solution is to use `PackageVersionConstraint` which seems to be the intended type to use instead of `Dependency` for these kinds of applications.
…ranges Previously we used `Dependency` for this which became impossible with Cabal 3.4.0.0 since the third field became a `NonEmptySet` in that version whereas in our use case it would always be empty. We can't however parse the preferred version ranges file in an isolated fashion, since it always also contains the package name. This leads to a parse failure for all packages that have the preferred-version-ranges file, like postgresql-simple (see NixOS/cabal2nix#501). The solution is to use `PackageVersionConstraint` which seems to be the intended type to use instead of `Dependency` for these kinds of applications.
Previously we used `Dependency` for this which became impossible with Cabal 3.4.0.0 since the third field became a `NonEmptySet` in that version whereas in our use case it would always be empty. We can't however parse the preferred version ranges file in an isolated fashion, since it always also contains the package name. This leads to a parse failure for all packages that have the preferred-version-ranges file, like postgresql-simple (see NixOS/cabal2nix#501). The solution is to use `PackageVersionConstraint` which seems to be the intended type to use instead of `Dependency` for these kinds of applications.
Building cabal2nix against the just released hackage-db 2.1.2 resolves this issue. I expect this to be fixed in nixpkgs within a week or two as well. Let me know if you have any further problems. |
* no released version of hackage2nix does support distribution-nixpkgs yet. * hackage-db 2.1.2 fixes an annoying bug introduced in 2.1.1 and also supports Cabal 3.4: NixOS/cabal2nix#501
Previously we used `Dependency` for this which became impossible with Cabal 3.4.0.0 since the third field became a `NonEmptySet` in that version whereas in our use case it would always be empty. We can't however parse the preferred version ranges file in an isolated fashion, since it always also contains the package name. This leads to a parse failure for all packages that have the preferred-version-ranges file, like postgresql-simple (see #501). The solution is to use `PackageVersionConstraint` which seems to be the intended type to use instead of `Dependency` for these kinds of applications.
The text was updated successfully, but these errors were encountered: