Describe the bug
Ormolu (a Haskell formatter) is broken in nixpkgs-unstable as of 5a3c1eda46ef4b0bbd782d5b6443a0dd9263d094
To Reproduce
Steps to reproduce the behavior:
nix-shell -p haskellPackages.ormoluExpected behavior
I expected to get the ormolu formatter in $PATH.
Instead, I get a broken package message. If I follow the instructions there I get this message:
Setup: Encountered missing dependencies:
ghc-lib-parser ==8.8.1
I imagine it just needs to be jailbroken but I'm not sure how to do that.
Metadata
- system: `"x86_64-darwin"`
- host os: `Darwin 19.2.0, macOS 10.15.2`
- multi-user?: `no`
- sandbox: `no`
- version: `nix-env (Nix) 2.3.1`
- channels(brianhicks): `"darwin, nixpkgs-20.03pre206486.a8fc904c7c0"`
- nixpkgs: `/Users/brianhicks/.nix-defexpr/channels/nixpkgs`
but I am using nix inside a project with versions managed by niv so the channel version there is not necessarily correct for this issue.
@BrianHicks Thanks for reporting this. We'd definitely welcome a PR fixing this.
Here is a video explaining how to mark Haskell packages as unbroken:
https://discourse.nixos.org/t/video-tutorial-how-to-fix-broken-haskell-packages-in-nix/3968
As for jailbreaking it, if you grep through pkgs/development/haskell-modules/configuration-common.nix, you will find some examples of jailbreaking packages with the doJailbreak function.
thanks! I tried it, and it appears that Ormolu does indeed need the mentioned version of ghc-lib-parser (need 8.8.1, have 8.8.0.) I see you asked in that thread for how to update versions鈥攄id you ever get an answer? I can try that next.
@BrianHicks By default, for Haskell packages that are in the latest LTS, the hackage2nix stuff generates the latest version of each package (in addition to the version in LTS).
So right now we have both haskellPackages.ghc-lib-parser and haskellPackages.ghc-lib-parser_8_8_1_20191204.
If you want to get ormolu working, I recommend sending a PR to explicitly override it to use haskellPackages.ghc-lib-parser_8_8_1_20191204.
There are a lot of examples of doing this in pkgs/development/haskell-modules/configuration-common.nix. (If you search through this file for _, you should find a few examples of these types of "newer" packages being used in overrides.)
Another good idea would be to try to persuade the Ormolu developers to get Ormolu into Stackage.
Ran into this as well and created a PR for it. Thanks for detailing the steps that were necessary for fixing it! #77439
Since it has been some time since I last contributed to NixOS, I would appreciate a review. I am not sure about removing ormolu from configuration-hackage2nix.yaml to mark it unbroken. @cdepillabout would you be so kind to take a look at it?
I guess I should have opened the PR against the haskell-updates branch. But seeing that peti merged the PR already, this should be fixed in master.
It is my understanding that the package will be marked unbroken automatically once hackage-package.nix is re-generated, so I am closing this. Feel free to reopen if there is something to be done still! :)