Closed teto closed 5 years ago
commit 2e08ac7 changed ghc 8.6.5 to use cabal 3
That is not quite correct. The commit builds cabal-install with Cabal 3.x -- not ghc. The Cabal version shipped by ghc
it completely unaffected by this change.
ok sry, clearly I don't get everything that's going on but is there a way to get cabal 2.4 when running a nix-shell with ghc 8.6.5 ? what should I modify
I am sorry, but the description of the problem you are trying to solve makes not much sense. I don't see how cabal-install
could possible affect haskell-ide-engine
. I am not even aware of such a package in Nixpkgs.
https://github.com/haskell/haskell-ide-engine (HIE) is an LSP server for haskell (which provides IDE features for text editors such as vim: it helps finding haskell code definition, formatting code, displaying doc etc)
HIE works great except it doesn't support cabal new-build. With cabal 3, one of the component (ghc-mod and cabal-helper, not sure) calls cabal configure
instead of cabal v1-configure
which messes up with the software.
I used to have ghc8.6.5 with cabal 2, now it's ghc8.6.5 with cabal 3. How can I revert to the previous situation ?
NB: It's not in nixpkgs yet due to issues with ghc-mod etc but https://github.com/Infinisil/all-hies works great
How can I revert to the previous situation ?
You can't, really. Nixpkgs makes no effort to support cabal-install
2.x now that 3.x is out.
What you can do is ...
release-19.03
which doesn't update to the latest version ASAP.cabal-install
commands with v1-
to make sure they work properly with recent version of the tool.cabal-install
2.4.x to your local copy of Nixpkgs through an override.
https://nixos.org/nixpkgs/manual/#how-to-create-nix-builds-for-your-own-private-haskell-packages has plenty of relevant documentation.I hope this helps!
ok thanks
@peti I wouldn't mind maintaining a cabal-install < 3
in nixpkgs for now. I think it's reasonable to have such a version for a while since v3 has a bunch of backwards-incompatible changes and this is a very integral part of the Haskell ecosystem. If that's alright with you I'll push a commit for adding a cabal-install < 3
to extra-packages
and will then check the build status later.
I wouldn't mind maintaining a
cabal-install < 3
in nixpkgs for now.
I don't see much of a need for having cabal 2.4.x
in Nixpkgs, to be honest. Instead of investing time into maintaining that obsolete tool, I'd much rather invest that time into fixing those programs that can't cope with the 3.x version.
Unfortunately, at least in case of HIE, that's a lot of work, and work I can't do fully myself. In comparison maintaining a cabal-install < 3 is something I'm very familiar with and will probably not require much more than a bunch of Nix lines.
Hi, yes, I can confirm that cabal 3 and the current HIE from @Infinisil's all-hies don't work together.
I'm trying to add cabal-install 2.4.1.0 to my overlays in configuration.nix, but I don't know how to do this for haskell packages. So far I've got this pulled out out of a previous hackage-packages.nix file:
{ mkDerivation, array, async, base, base16-bytestring, binary
, bytestring, Cabal, containers, cryptohash-sha256, deepseq
, directory, echo, edit-distance, filepath, hackage-security
, hashable, HTTP, mtl, network, network-uri, parsec, pretty
, process, random, resolv, stdenv, stm, tar, text, time, unix, zip-archive
, zlib
}:
mkDerivation {
pname = "cabal-install";
version = "2.4.1.0";
sha256 = "1b91rcs00wr5mf55c6xl8hrxmymlq72w71qm5r0q4j869asv5g39";
revision = "3";
editedCabalFile = "1mnm6mfrgavq3blvkm3wz45pqrj10apjihg1g9cds58qp19m9r1h";
isLibrary = false;
isExecutable = true;
setupHaskellDepends = [ base Cabal filepath process ];
executableHaskellDepends = [
array async base base16-bytestring binary bytestring Cabal
containers cryptohash-sha256 deepseq directory echo edit-distance
filepath hackage-security hashable HTTP mtl network network-uri
parsec pretty process random resolv stm tar text time unix
zip-archive zlib
];
doCheck = false;
postInstall = ''
mkdir $out/etc
mv bash-completion $out/etc/bash_completion.d
'';
description = "The command-line interface for Cabal and Hackage";
license = stdenv.lib.licenses.bsd3;
maintainers = with stdenv.lib.maintainers; [ peti ];
}
How would I add this to the nixpkgs.overlays
section in configuration.nix?
Unfortunately, at least in case of HIE, that's a lot of work, and work I can't do fully myself. In comparison maintaining a cabal-install < 3 is something I'm very familiar with and will probably not require much more than a bunch of Nix lines.
How about adding that old cabal-install
version into your overlay next to HIE?
as everyone I am very annoyed that hie doesn't work with cabal 3 but I don't think nixos-unstable should go out of its way to solve this. I don't think we will see HIE support new builds before a few months. If we don't modify nixpkgs, solutions are:
@peti thanks, that link led me eventually to a working cabal 2.4.1.0 overlay, especially section 9.6.3.2.
commit 2e08ac73ca0098bf6dead801631c909d3a6b8e85 changed ghc 8.6.5 to use cabal 3. I wonder if there is way to revert that to cabal 2 via an override/overlay ? haskell-ide-engine seems to have some problems with cabal 3.
I've tried changing the line in pkgs/development/haskell-modules/configuration-ghc-8.6.x.nix to
cabal-install = super.cabal-install.overrideScope (self: super: { Cabal = self.Cabal_2_4_1_0; });
but it triggers:A similar error happens if I remove the line instead of modifying it.
cc @peti