Closed srghma closed 1 year ago
hfmt still does not build on ghc843 or ghc861.
@srghma Is nixfmt related to hfmt?
I just wanted to give hfmt a try and then ended up here. On master it currently fails because of conflicting dependencies of haskell-src-exts
:
This package indirectly depends on multiple versions of the same package. This is very likely to cause a compile failure.
package stylish-haskell (stylish-haskell-0.9.2.1-9XVxKbqExzZIs60m7h6SJq) requires haskell-src-exts-1.20.3-2fryh11Yuz7lCtLeeIQn8
package hindent (hindent-5.2.7-T34fxFcJkHDcL33Jd8JpN) requires haskell-src-exts-1.20.3-2fryh11Yuz7lCtLeeIQn8
package hlint (hlint-2.1.12-7gLWLmnjZwq2QaEd4NwRlO) requires haskell-src-exts-1.21.0-1MqMUIJU7y29AVS9NHxlR4
package hfmt (hfmt-0.2.3.1) requires haskell-src-exts-1.21.0-1MqMUIJU7y29AVS9NHxlR4
package haskell-src-exts-util (haskell-src-exts-util-0.2.4-JnBKmaPXKhRJ6qhckXKvij) requires haskell-src-exts-1.21.0-1MqMUIJU7y29AVS9N
I did try to ignore the error using allowInconsistentDependencies
but it does indeed yield a compile error.
This overlay fixes it for now (tested on 19.03), put this in ~/.config/nixpkgs/overlays/hfmt-fix.nix
:
self: super: let
hlib = super.haskell.lib;
in {
haskellPackages = super.haskellPackages.override (old: {
overrides = super.lib.composeExtensions (old.overrides or (self: super: {}))
(hself: hsuper: {
hfmt = hlib.dontCheck (hlib.overrideCabal (hsuper.hfmt.override {
stylish-haskell = hlib.doJailbreak (hself.stylish-haskell.override {
haskell-src-exts = hself.haskell-src-exts_1_21_0;
});
hindent = hlib.appendPatch (hself.hindent.override {
haskell-src-exts = hself.haskell-src-exts_1_21_0;
}) (super.fetchpatch {
# From https://github.com/chrisdone/hindent/pull/537
# to fix with haskell-src-exts >=1.21
url = "https://github.com/felixonmars/hindent/commit/ce033ca1087b6155315eefe5a3e8ba6f29d1b76c.patch";
sha256 = "0rpdhf2qmi6i37s88qb4z2lj2zidq2k5q38xgagffx2y6kcyphkz";
});
}) (drv: {
broken = false;
}));
});
});
}
Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:
As far as I know, people are generally not using hfmt anymore, so I'll go ahead and close. If you're still stuck on this, feel free to post a comment and we can re-open.
Issue description & Steps to reproduce
What I have to change here?
nixos-version
) 17.09.1880.ac2bb5684c (Hummingbird)nix-env --version
) nix-env (Nix) 1.11.15nix-instantiate --eval '<nixpkgs>' -A lib.nixpkgsVersion
) "17.09.1880.ac2bb5684c"grep build-use-sandbox /etc/nix/nix.conf
) build-use-sandbox = false