Package dates-0.2.3.0 is marked as broken

I’ve been working on a Haskell project that gets the packages from nixos-20.03. However, I need a newer version of package “password” that’s available there, so I tried migrating my project to “unstable” and “20.09”, as they both contain the version of package I need.

The problem is: after pointing to any of those two branches, my app stops compiling with an error:

Package 'dates-0.2.3.0' in <long path here>/haskell-modules/hackage-packages.nix:69557 is marked as broken, refusing to evaluate.

Can someone help me with fixing this issue ? I’m happy to fix the broken package if needed, but the problem is that I’m quite new to NixOS, so I don’t know where to start.

1 Like

Running git blame on pkgs/development/haskell-modules/hackage-packages.nix shows us that it was marked broken by an automated haskell package update: hackage-packages.nix: automatic Haskell package set update · NixOS/nixpkgs@e81ec2f · GitHub. This suggests that it was probably marked broken because it failed to build with the current set of haskell modules in nixpkgs.

I would suggest:

  1. Manually remove the broken = true;. Try to build it and see what fails.
  2. If it fails because of incompatible package versions, try adding an override using doJailBreak to the configuration file which corresponds to the ghc version which you are using. For example, this is already present for ghc-head:

doJailbreak helps when the upper bounds on a package are too restrictive, but the newer version of the dependency is actually still compatible. Try to build it again: if it works, great! Consider submitting a PR with your changes.
3. If it still doesn’t work (because of e.g. an API incompatibility), then depending how complicated the issues it, you can try to fix the package sources and upstream the change, or possibly report the issue upstream so the author can fix it.

1 Like

Hi,

Thanks for the hints. I’ve done some progress:
1.) I temporarily set { allowBroken = true; } in my system config file and got a few steps further with building my project. Eventually it failed building dates package, but I got at least the following error message:

Setup: Encountered missing or private dependencies:
base >=4.9 && <4.13

I spent a bit of time in the project’s website (GitHub - portnov/dates: Small library for parsing different dates formats.) and it looks to me that this package hasn’t been updated for a while. I decided to remove it from dependencies of my project, which turned out to be quite easy.

This solves my problem. Now - for my education and to make sure I understand the problem - the package is marked as broken because it hasn’t been updated by its author and got out-of-date with its dependencies, is that right ? In this situation the only way to fix it would be to contact author suggesting a PR with a fix ?

It is also possible to fix things locally in nixpkgs. Check out the pkgs/development/haskell-modules/configuration-common.nix file for a list of Haskell-related fixes specific to nixpkgs.

However, we do prefer that packages are fixed upstream whenever possible.

When things are fixed upstream, you’ll often have to send a PR to the haskell stuff in nixpkgs marking the package as non broken.

1 Like