infinisil/all-hies

hie from all-hies is not using overrided cabal packages

codemonkeylabs-de opened this issue ยท 6 comments

Hi,

I have a project in which I have an overlay for overriding some Haskell packages along with the overlay provided by this library (thanks btw). If I start a nix shell, I can then run cabal build for example, inside the shell and my project is built correctly using the overriden packages, etc. However, when I fire off hie , it fails apparently cause it still tries to use the packages available from the hackage package list installed under ~/.cabal, not the packages provided by my nix derivation. Here:

My default.nix:

{dev ? true}:
let
  base          = import <nixpkgs> {};
  pinnedVersion = base.pkgs.lib.importJSON ./nixpkgs.json;

  nixpkgs = base.pkgs.fetchFromGitHub {
    owner = "NixOS";
    repo  = "nixpkgs";
    inherit (pinnedVersion) rev sha256;
  };

  all-hies = fetchTarball {
    url = "https://github.com/infinisil/all-hies/tarball/eff5d9a5e1a84150014095494331cf63e59923af";
    sha256 = "19bws9fyjhgiikig86cri05fxz1wrz60n69zrigq5wzbyn4hwv9h";
  };

  persistent-repo = builtins.fetchGit {
    url = "https://github.com/drchaos/persistent.git";
    rev = "434014afdfb0000e3d839ea4c6c120c9720db740";
    ref = "latest_persistent";
  };

  persistent-mysql-haskell-path =
    builtins.concatStringsSep "/" [persistent-repo.outPath "persistent-mysql-haskell" ];

  overlay = self: super: {
    localHaskellPackages = 
      super.haskell.packages.ghc883.override (old: {
        overrides = self.lib.composeExtensions (old.overrides or (_: _: {})) 
          (hself: hsuper: {
            mkDerivation = args : hsuper.mkDerivation (args // {
              doCheck   = false;
              doHaddock = false;
              enableLibraryProfiling = false;
            });

            ghc             = hsuper.ghc // {withPackages = hsuper.ghc.withHoogle;};
            ghcWithPackages = hself.ghc.withPackages;

            persistent-mysql-haskell = hself.callCabal2nix "persistent-mysql-haskell" persistent-mysql-haskell-path {};
            mysql-haskell = hself.callCabal2nix "mysql-haskell" (
                              builtins.fetchGit {
                                url = "https://github.com/drchaos/mysql-haskell.git";
                                rev = "4de0a7e2640d8d68f381a1471a24e906e3f09124";
                                ref = "base_413";
                              }) {};
          });
      });
  };

  devToolsOverlay = if dev then [(import all-hies {}).overlay] else [];

  pkgs = import nixpkgs {
    overlays = [overlay] ++ devToolsOverlay;
  };

  drv  = pkgs.localHaskellPackages.callCabal2nix "sase" (
           builtins.filterSource
             (path: type: type != "directory" || baseNameOf path != ".git") ./.
         ) {};
in
  drv.env.overrideAttrs (
    old: with pkgs.localHaskellPackages; {
                shellHooks = "hpack";
                nativeBuildInputs = 
                  let devTools = if dev then [hie] else [];
                      tools    = [ cabal-install ];
                  in old.nativeBuildInputs ++ tools ++ devTools;
    }
  )

then I run a nix-shell and do cabal build and things build fine.. (not posting here for brevity's sake). Now I fire off my editor (Sublime Text) and I see the following in the LSP debug output:

haskell-ide-engine: Resolving dependencies...
haskell-ide-engine: cabal: Could not resolve dependencies:
... snip for brevity...
haskell-ide-engine: [__7] rejecting: mysql-haskell-0.8.4.2/installed-1Gp1W6Sj6ueBn1jmHnKP6a
haskell-ide-engine: (conflict: tls==1.4.1, mysql-haskell =>
haskell-ide-engine: tls==1.5.4/installed-EQGz6tvU5RpKV1lFE5vTpJ)
... 
haskell-ide-engine: [__7] fail (backjumping, conflict set: mysql-haskell,
haskell-ide-engine: persistent-mysql-haskell, tls, x509)
haskell-ide-engine: After searching the rest of the dependency tree exhaustively, these were the
haskell-ide-engine: goals I've had most trouble fulfilling: tls, base, persistent-mysql-haskell,
haskell-ide-engine: x509, mysql-haskell, memory, async, persistent-mysql
haskell-ide-engine: Try running with --minimize-conflict-set to improve the error message
haskell-ide-engine: 2020-07-03 23:43:18.650028 [ThreadId 9] - Scheduler thread exited unexpectedly: callProcessStderr: cabal v2-build --with-ghc=/nix/store/45hiivv8ckry1awp3pg043d3c7f2y5wx-ghc-8.8.3-with-packages/bin/ghc --with-ghc-pkg=/nix/store/45hiivv8ckry1awp3pg043d3c7f2y5wx-ghc-8.8.3-with-packages/bin/ghc-pkg --with-haddock=/nix/store/45hiivv8ckry1awp3pg043d3c7f2y5wx-ghc-8.8.3-with-packages/bin/haddock --builddir=/Users/erick/sandbox/sase/dist-newstyle --dry-run all (exit 1): failed

These packages are currently broken, that's why I had to override them in my default.nix .. and I know that works cause I can build with cabal inside a nix shell normally etc...

Now.. here is the really weird part.. if I grab the command above and just run it by hand, i.e. cabal v2-build --with-ghc... , it actually succeeds in the nix shell !!.. the overriden nix packages are used and the conflicts are resolved.

I even nuked the ~/.cache and ~/.cabal directories.. again.. things work of course ok inside the nix-shell building manually.. but if I run hie...

cabal-helper: Installing a private copy of Cabal because we couldn't
find the right version anywhere on your system. You can set the environment
variable CABAL_HELPER_DEBUG=1 to see where we searched.

Note that this installation might take a little while but it will only
happen once per Cabal library version used in your build-plans.

If you want to avoid this automatic installation altogether install
version 3.2.0.0 of the Cabal library manually, either using cabal or your
system package manager. With cabal you can use the following command:
    $ cabal install Cabal --constraint "Cabal == 3.2.0.0"

FYI the build products and cabal-helper executable cache are all in the
following directory, you can simply delete it if you think something
is broken :
    /Users/erick/.cache/cabal-helper

but then again:

$ which cabal
/nix/store/pv127qh7r7nzcv9j4ci024ziaabrsps3-cabal-install-3.2.0.0/bin/cabal

$ cabal --version
cabal-install version 3.2.0.0
compiled using version 3.2.0.0 of the Cabal library 

I am hesitant to raise the issue first with the haskell-ide-engine project cause I am afraid they are going to say.. well.. it is nix problem... which it might be I guess.. at least I think it is fair to look at this side of things first and figure out who is misbehaving or if I am doing the overrides wrong or if it is all-hies that is doing the override incorrectly.. not sure.. your help is appreciated ๐Ÿ™

Thanks!

Can you show the full logs after nuking ~/.cache/cabal-helper and then running hie? Doesn't matter if it's a bit longer. Tip: You can format the comment like this to have an expandable section:

<details>

โ€‹```
lots of logs here
โ€‹```
</details>

Thanks for the tip ..good to know. See below. In fact this is after removing ~/.cabal (I was desperate last night.. still am :-)

$ rm -fr /Users/erick/.cache/cabal-helper
$ hie
Running HIE(hie)
  Version 1.4 x86_64 ghc-8.8.3
To run as a LSP server on stdio, provide the '--lsp' argument
Current directory:/Users/erick/sandbox/sase3

args:[]

Looking for project config cradle...

2020-07-04 07:01:37.031553 [ThreadId 4] - Cabal-Helper decided to use: ProjLocV2Dir {plProjectDirV2 = "/Users/erick/sandbox/sase3"}
2020-07-04 07:01:37.03228 [ThreadId 4] - Module "/Users/erick/sandbox/sase3/File.hs" is loaded by Cradle: Cradle {cradleRootDir = "/Users/erick/sandbox/sase3", cradleOptsProg = CradleAction: Other CabalV2}
2020-07-04 07:01:37.032536 [ThreadId 4] - Executing GHC on path with args: --numeric-version
2020-07-04 07:01:37.152811 [ThreadId 4] - Executing GHC on path with args: --print-libdir


###################################################

Cradle: Cabal project
Project Ghc version: 8.8.3
Libdir: Just "/nix/store/45hiivv8ckry1awp3pg043d3c7f2y5wx-ghc-8.8.3-with-packages/lib/ghc-8.8.3"
Searching for Haskell source files...
Found 13 Haskell source files.

###################################################

Found the following files:

/Users/erick/sandbox/sase3/Setup.hs
/Users/erick/sandbox/sase3/lib/Jotun/Model.hs
/Users/erick/sandbox/sase3/lib/Utils/Ini.hs
/Users/erick/sandbox/sase3/lib/Utils/Options.hs
/Users/erick/sandbox/sase3/src/Jotun/Server/Handler/Home.hs
/Users/erick/sandbox/sase3/src/Jotun/Server/Handler/Nowhere.hs
/Users/erick/sandbox/sase3/src/Jotun/Server/Settings.hs
/Users/erick/sandbox/sase3/src/Jotun/Server/Settings/StaticFiles.hs
/Users/erick/sandbox/sase3/src/Jotun/Server/Application.hs
/Users/erick/sandbox/sase3/src/Jotun/Server/Import.hs
/Users/erick/sandbox/sase3/src/Jotun/Server/Foundation.hs
/Users/erick/sandbox/sase3/src/Jotun/Main.hs
/Users/erick/sandbox/sase3/src/Jotun/Options.hs


Load them all now. This may take a very long time.

2020-07-04 07:01:37.31816 [ThreadId 4] - New cradle: /Users/erick/sandbox/sase3/Setup.hs
2020-07-04 07:01:37.319322 [ThreadId 4] - Cabal-Helper decided to use: ProjLocV2Dir {plProjectDirV2 = "/Users/erick/sandbox/sase3"}
2020-07-04 07:01:37.319377 [ThreadId 4] - Module "/Users/erick/sandbox/sase3/Setup.hs" is loaded by Cradle: Cradle {cradleRootDir = "/Users/erick/sandbox/sase3", cradleOptsProg = CradleAction: Other CabalV2}
2020-07-04 07:01:37.319408 [ThreadId 4] - Found cradle: Cradle {cradleRootDir = "/Users/erick/sandbox/sase3", cradleOptsProg = CradleAction: Other CabalV2}
Build profile: -w ghc-8.8.3 -O1
In order, the following would be built (use -v for more details):
 - sase-0.0.1.0 (exe:jotun) (configuration changed)
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - sase-0.0.1.0 (exe:jotun) (first run)
cabal-helper: Installing a private copy of Cabal because we couldn't
find the right version anywhere on your system. You can set the environment
variable CABAL_HELPER_DEBUG=1 to see where we searched.

Note that this installation might take a little while but it will only
happen once per Cabal library version used in your build-plans.

If you want to avoid this automatic installation altogether install
version 3.2.0.0 of the Cabal library manually, either using cabal or your
system package manager. With cabal you can use the following command:
    $ cabal install Cabal --constraint "Cabal == 3.2.0.0"

FYI the build products and cabal-helper executable cache are all in the
following directory, you can simply delete it if you think something
is broken :
    /Users/erick/.cache/cabal-helper
Please do report any problems you encounter.

Installing Cabal 3.2.0.0 ...
Warning: The package list for 'hackage.haskell.org' does not exist. Run 'cabal
update' to download it.RemoteRepo {remoteRepoName = "hackage.haskell.org",
remoteRepoURI = http://hackage.haskell.org/, remoteRepoSecure = Just True,
remoteRepoRootKeys =
["fe331502606802feac15e514d9b9ea83fee8b6ffef71335479a2e68d84adc6b0","1ea9ba32c526d1cc91ab5e5bd364ec5e9e8cb67179a471872f6e26f0ae773d42","2c6c3627bd6c982990239487f1abd02e08a02e6cf16edb105a8012d444d870c3","0a5c7ea47cd1b15f01f5f51a33adda7e655bc0f0b0615baa8e271f4c3351e21d","51f0161b906011b52c6613376b1ae937670da69322113a246a09f807c62f6921"],
remoteRepoKeyThreshold = 3, remoteRepoShouldTryHttps = True}
Warning: The package list for 'hackage.haskell.org' does not exist. Run 'cabal
update' to download it.RemoteRepo {remoteRepoName = "hackage.haskell.org",
remoteRepoURI = http://hackage.haskell.org/, remoteRepoSecure = Just True,
remoteRepoRootKeys =
["fe331502606802feac15e514d9b9ea83fee8b6ffef71335479a2e68d84adc6b0","1ea9ba32c526d1cc91ab5e5bd364ec5e9e8cb67179a471872f6e26f0ae773d42","2c6c3627bd6c982990239487f1abd02e08a02e6cf16edb105a8012d444d870c3","0a5c7ea47cd1b15f01f5f51a33adda7e655bc0f0b0615baa8e271f4c3351e21d","51f0161b906011b52c6613376b1ae937670da69322113a246a09f807c62f6921"],
remoteRepoKeyThreshold = 3, remoteRepoShouldTryHttps = True}
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] next goal: Cabal (user goal)
[__0] rejecting: Cabal-3.0.1.0/installed-3.0.1.0 (constraint from user target
requires ==3.2.0.0)
[__0] fail (backjumping, conflict set: Cabal)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: Cabal

callProcessStderr: cabal --no-require-sandbox v2-install --with-compiler=/nix/store/45hiivv8ckry1awp3pg043d3c7f2y5wx-ghc-8.8.3-with-packages/bin/ghc --with-hc-pkg=/nix/store/45hiivv8ckry1awp3pg043d3c7f2y5wx-ghc-8.8.3-with-packages/bin/ghc-pkg --package-env=/Users/erick/.cache/cabal-helper/ghc-8.8.3.package-envs/Cabal-3.2.0.0.package-env --lib Cabal-3.2.0.0 (exit 1): failed
hie: panic! cabal-helper: Installing Cabal version 3.2.0.0 failed.

You have the following choices to fix this:

- The easiest way to try and fix this is just reconfigure the project and try
  again:
        $ cabal clean && cabal configure

- If that fails you can try to install the version of Cabal mentioned above
  into your global/user package-db somehow, though you'll probably have to
  fix something otherwise it wouldn't have failed above:
        $ cabal install Cabal --constraint 'Cabal == 3.2.0.0'

- If you're using `Build-Type: Simple`:
  - You can see if you can reinstall your cabal-install executable while
    having it linked to a version of Cabal that's available in you
    package-dbs or can be built automatically:
        $ ghc-pkg list | grep Cabal  # find an available Cabal version
            Cabal-W.X.Y.Z
        $ cabal install cabal-install --constraint 'Cabal == W.X.*'
    Afterwards you'll have to reconfigure your project:
        $ cabal clean && cabal configure

- If you're using `Build-Type: Custom`:
  - Have cabal-install rebuild your Setup.hs executable with a version of the
    Cabal library that you have available in your global/user package-db:
        $ cabal clean && cabal configure
    You might also have to install some version of the Cabal to do this:
        $ cabal install Cabal

Now, for the sake of digging further, I did cabal update to fetch the hackage package db which I had nuked before in desperation .. then I repeat the hie invocation. Now it succeeds in installing its own copy of cabal (why doesn't it like the one I am providing with nix? ๐Ÿค” ..hmm.. it is also cabal-3.2.0.0 .. ).. for completion's sake, these are the logs of that:

$ cabal update
Downloading the latest package list from hackage.haskell.org
$  hie
Running HIE(hie)
  Version 1.4 x86_64 ghc-8.8.3
To run as a LSP server on stdio, provide the '--lsp' argument
Current directory:/Users/erick/sandbox/sase3

args:[]

Looking for project config cradle...

2020-07-04 07:16:37.539258 [ThreadId 4] - Cabal-Helper decided to use: ProjLocV2Dir {plProjectDirV2 = "/Users/erick/sandbox/sase3"}
2020-07-04 07:16:37.539938 [ThreadId 4] - Module "/Users/erick/sandbox/sase3/File.hs" is loaded by Cradle: Cradle {cradleRootDir = "/Users/erick/sandbox/sase3", cradleOptsProg = CradleAction: Other CabalV2}
2020-07-04 07:16:37.540169 [ThreadId 4] - Executing GHC on path with args: --numeric-version
2020-07-04 07:16:37.608484 [ThreadId 4] - Executing GHC on path with args: --print-libdir


###################################################

Cradle: Cabal project
Project Ghc version: 8.8.3
Libdir: Just "/nix/store/45hiivv8ckry1awp3pg043d3c7f2y5wx-ghc-8.8.3-with-packages/lib/ghc-8.8.3"
Searching for Haskell source files...
Found 13 Haskell source files.

###################################################

Found the following files:

/Users/erick/sandbox/sase3/Setup.hs
/Users/erick/sandbox/sase3/lib/Jotun/Model.hs
/Users/erick/sandbox/sase3/lib/Utils/Ini.hs
/Users/erick/sandbox/sase3/lib/Utils/Options.hs
/Users/erick/sandbox/sase3/src/Jotun/Server/Handler/Home.hs
/Users/erick/sandbox/sase3/src/Jotun/Server/Handler/Nowhere.hs
/Users/erick/sandbox/sase3/src/Jotun/Server/Settings.hs
/Users/erick/sandbox/sase3/src/Jotun/Server/Settings/StaticFiles.hs
/Users/erick/sandbox/sase3/src/Jotun/Server/Application.hs
/Users/erick/sandbox/sase3/src/Jotun/Server/Import.hs
/Users/erick/sandbox/sase3/src/Jotun/Server/Foundation.hs
/Users/erick/sandbox/sase3/src/Jotun/Main.hs
/Users/erick/sandbox/sase3/src/Jotun/Options.hs


Load them all now. This may take a very long time.

2020-07-04 07:16:37.755042 [ThreadId 4] - New cradle: /Users/erick/sandbox/sase3/Setup.hs
2020-07-04 07:16:37.756466 [ThreadId 4] - Cabal-Helper decided to use: ProjLocV2Dir {plProjectDirV2 = "/Users/erick/sandbox/sase3"}
2020-07-04 07:16:37.756545 [ThreadId 4] - Module "/Users/erick/sandbox/sase3/Setup.hs" is loaded by Cradle: Cradle {cradleRootDir = "/Users/erick/sandbox/sase3", cradleOptsProg = CradleAction: Other CabalV2}
2020-07-04 07:16:37.756622 [ThreadId 4] - Found cradle: Cradle {cradleRootDir = "/Users/erick/sandbox/sase3", cradleOptsProg = CradleAction: Other CabalV2}
Resolving dependencies...
Build profile: -w ghc-8.8.3 -O1
In order, the following would be built (use -v for more details):
 - sase-0.0.1.0 (lib) (configuration changed)
 - sase-0.0.1.0 (exe:jotun) (configuration changed)
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - clock-0.8 (lib) (requires download & build)
 - call-stack-0.2.0 (lib) (requires download & build)
 - hspec-discover-2.7.1 (lib) (requires download & build)
 - splitmix-0.0.5 (lib) (requires download & build)
 - tf-random-0.5 (lib) (requires download & build)
 - HUnit-1.6.0.0 (lib) (requires download & build)
 - QuickCheck-2.14 (lib) (requires download & build)
 - hspec-expectations-0.8.2 (lib) (requires download & build)
 - quickcheck-io-0.2.0 (lib) (requires download & build)
 - hspec-core-2.7.1 (lib) (requires download & build)
 - hspec-2.7.1 (lib) (requires download & build)
 - sase-0.0.1.0 (test:lib-test) (dependency rebuilt)
Downloading  clock-0.8
Downloaded   clock-0.8
Downloading  call-stack-0.2.0
Starting     clock-0.8 (lib)
Downloaded   call-stack-0.2.0
Downloading  splitmix-0.0.5
Starting     call-stack-0.2.0 (lib)
Building     clock-0.8 (lib)
Downloaded   splitmix-0.0.5
Downloading  tf-random-0.5
Starting     splitmix-0.0.5 (lib)
Building     call-stack-0.2.0 (lib)
Downloaded   tf-random-0.5
Downloading  hspec-discover-2.7.1
Starting     tf-random-0.5 (lib)
Building     splitmix-0.0.5 (lib)
Installing   call-stack-0.2.0 (lib)
Downloaded   hspec-discover-2.7.1
Downloading  QuickCheck-2.14
Starting     hspec-discover-2.7.1 (lib)
Installing   clock-0.8 (lib)
Building     tf-random-0.5 (lib)
Installing   splitmix-0.0.5 (lib)
Completed    call-stack-0.2.0 (lib)
Completed    clock-0.8 (lib)
Building     hspec-discover-2.7.1 (lib)
Downloaded   QuickCheck-2.14
Downloading  HUnit-1.6.0.0
Completed    splitmix-0.0.5 (lib)
Starting     QuickCheck-2.14 (lib)
Downloaded   HUnit-1.6.0.0
Downloading  hspec-expectations-0.8.2
Starting     HUnit-1.6.0.0 (lib)
Downloaded   hspec-expectations-0.8.2
Downloading  quickcheck-io-0.2.0
Installing   hspec-discover-2.7.1 (lib)
Building     QuickCheck-2.14 (lib)
Downloaded   quickcheck-io-0.2.0
Building     HUnit-1.6.0.0 (lib)
Downloading  hspec-core-2.7.1
Installing   tf-random-0.5 (lib)
Completed    hspec-discover-2.7.1 (lib)
Downloaded   hspec-core-2.7.1
Downloading  hspec-2.7.1
Completed    tf-random-0.5 (lib)
Downloaded   hspec-2.7.1
Installing   HUnit-1.6.0.0 (lib)
Completed    HUnit-1.6.0.0 (lib)
Starting     hspec-expectations-0.8.2 (lib)
Building     hspec-expectations-0.8.2 (lib)
Installing   hspec-expectations-0.8.2 (lib)
Completed    hspec-expectations-0.8.2 (lib)
Installing   QuickCheck-2.14 (lib)
Completed    QuickCheck-2.14 (lib)
Starting     quickcheck-io-0.2.0 (lib)
Building     quickcheck-io-0.2.0 (lib)
Installing   quickcheck-io-0.2.0 (lib)
Completed    quickcheck-io-0.2.0 (lib)
Starting     hspec-core-2.7.1 (lib)
Building     hspec-core-2.7.1 (lib)
Installing   hspec-core-2.7.1 (lib)
Completed    hspec-core-2.7.1 (lib)
Starting     hspec-2.7.1 (lib)
Building     hspec-2.7.1 (lib)
Installing   hspec-2.7.1 (lib)
Completed    hspec-2.7.1 (lib)
cabal-helper: Installing a private copy of Cabal because we couldn't
find the right version anywhere on your system. You can set the environment
variable CABAL_HELPER_DEBUG=1 to see where we searched.

Note that this installation might take a little while but it will only
happen once per Cabal library version used in your build-plans.

If you want to avoid this automatic installation altogether install
version 3.2.0.0 of the Cabal library manually, either using cabal or your
system package manager. With cabal you can use the following command:
    $ cabal install Cabal --constraint "Cabal == 3.2.0.0"

FYI the build products and cabal-helper executable cache are all in the
following directory, you can simply delete it if you think something
is broken :
    /Users/erick/.cache/cabal-helper
Please do report any problems you encounter.

Installing Cabal 3.2.0.0 ...
Resolving dependencies...
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - Cabal-3.2.0.0 (lib) (requires download & build)
Downloading  Cabal-3.2.0.0
Downloaded   Cabal-3.2.0.0
Starting     Cabal-3.2.0.0 (lib)
Building     Cabal-3.2.0.0 (lib)
Installing   Cabal-3.2.0.0 (lib)
Completed    Cabal-3.2.0.0 (lib)
done
Loaded package environment from /Users/erick/.cache/cabal-helper/ghc-8.8.3.package-envs/Cabal-3.2.0.0.package-env
Loaded package environment from /Users/erick/.cache/cabal-helper/ghc-8.8.3.package-envs/Cabal-3.2.0.0.package-env
[1 of 5] Compiling CabalHelper.Shared.Common ( /Users/erick/.cache/cabal-helper/cabal-helper-1.1.0.0--Cabal-3.2.0.0--4c2b698186ef0fd4fd60f842be28ca0f8b1e048164895db761ebcde334750a62.build/CabalHelper/Shared/Common.hs, /Users/erick/.cache/cabal-helper/cabal-helper-1.1.0.0--Cabal-3.2.0.0--4c2b698186ef0fd4fd60f842be28ca0f8b1e048164895db761ebcde334750a62.build/CabalHelper/Shared/Common.o )
[2 of 5] Compiling CabalHelper.Shared.InterfaceTypes ( /Users/erick/.cache/cabal-helper/cabal-helper-1.1.0.0--Cabal-3.2.0.0--4c2b698186ef0fd4fd60f842be28ca0f8b1e048164895db761ebcde334750a62.build/CabalHelper/Shared/InterfaceTypes.hs, /Users/erick/.cache/cabal-helper/cabal-helper-1.1.0.0--Cabal-3.2.0.0--4c2b698186ef0fd4fd60f842be28ca0f8b1e048164895db761ebcde334750a62.build/CabalHelper/Shared/InterfaceTypes.o )
[3 of 5] Compiling CabalHelper.Runtime.Compat ( /Users/erick/.cache/cabal-helper/cabal-helper-1.1.0.0--Cabal-3.2.0.0--4c2b698186ef0fd4fd60f842be28ca0f8b1e048164895db761ebcde334750a62.build/CabalHelper/Runtime/Compat.hs, /Users/erick/.cache/cabal-helper/cabal-helper-1.1.0.0--Cabal-3.2.0.0--4c2b698186ef0fd4fd60f842be28ca0f8b1e048164895db761ebcde334750a62.build/CabalHelper/Runtime/Compat.o )
[4 of 5] Compiling CabalHelper.Runtime.HelperMain ( /Users/erick/.cache/cabal-helper/cabal-helper-1.1.0.0--Cabal-3.2.0.0--4c2b698186ef0fd4fd60f842be28ca0f8b1e048164895db761ebcde334750a62.build/CabalHelper/Runtime/HelperMain.hs, /Users/erick/.cache/cabal-helper/cabal-helper-1.1.0.0--Cabal-3.2.0.0--4c2b698186ef0fd4fd60f842be28ca0f8b1e048164895db761ebcde334750a62.build/CabalHelper/Runtime/HelperMain.o )
[5 of 5] Compiling Main             ( /Users/erick/.cache/cabal-helper/cabal-helper-1.1.0.0--Cabal-3.2.0.0--4c2b698186ef0fd4fd60f842be28ca0f8b1e048164895db761ebcde334750a62.build/CabalHelper/Runtime/Main.hs, /Users/erick/.cache/cabal-helper/cabal-helper-1.1.0.0--Cabal-3.2.0.0--4c2b698186ef0fd4fd60f842be28ca0f8b1e048164895db761ebcde334750a62.build/Main.o )
Linking /Users/erick/.cache/cabal-helper/cabal-helper-1.1.0.0--Cabal-3.2.0.0--4c2b698186ef0fd4fd60f842be28ca0f8b1e048164895db761ebcde334750a62.build/cabal-helper ...
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - sase-0.0.1.0 (lib) (configuration changed)
 - sase-0.0.1.0 (exe:jotun) (configuration changed)
Configuring library for sase-0.0.1.0..
Warning: 'hs-source-dirs: test' directory does not exist.
Preprocessing library for sase-0.0.1.0..
Building library for sase-0.0.1.0..
Configuring executable 'jotun' for sase-0.0.1.0..
Warning: The package has an extraneous version range for a dependency on an
internal library: sase -any && ==0.0.1.0. This version range includes the
current package but isn't needed as the current package's library will always
be used.
Warning: 'hs-source-dirs: test' directory does not exist.
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - sase-0.0.1.0 (lib) (configuration changed)
Configuring library for sase-0.0.1.0..
Warning: 'hs-source-dirs: test' directory does not exist.
2020-07-04 07:21:46.795573 [ThreadId 4] - Fail on cradle initialisation: (ExitFailure 2)["Could not obtain flags for: \"Setup.hs\".","","This module was not part of any component we are aware of.","","Component: ChLibName ChMainLibName with source directory: [\"lib\"]","Component: ChExeName \"jotun\" with source directory: [\"src\"]","Component: ChTestName \"lib-test\" with source directory: [\"test\"]","","","To expose a module, refer to:","https://www.haskell.org/cabal/users-guide/developing-packages.html",""]
2020-07-04 07:21:46.795902 [ThreadId 4] - New cradle: /Users/erick/sandbox/sase3/lib/Jotun/Model.hs
2020-07-04 07:21:46.800589 [ThreadId 4] - Cabal-Helper decided to use: ProjLocV2Dir {plProjectDirV2 = "/Users/erick/sandbox/sase3"}
2020-07-04 07:21:46.800701 [ThreadId 4] - Module "/Users/erick/sandbox/sase3/lib/Jotun/Model.hs" is loaded by Cradle: Cradle {cradleRootDir = "/Users/erick/sandbox/sase3", cradleOptsProg = CradleAction: Other CabalV2}
2020-07-04 07:21:46.800755 [ThreadId 4] - Found cradle: Cradle {cradleRootDir = "/Users/erick/sandbox/sase3", cradleOptsProg = CradleAction: Other CabalV2}
Build profile: -w ghc-8.8.3 -O1
In order, the following would be built (use -v for more details):
 - sase-0.0.1.0 (lib) (configuration changed)
 - sase-0.0.1.0 (exe:jotun) (configuration changed)
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - sase-0.0.1.0 (test:lib-test) (first run)
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - sase-0.0.1.0 (lib) (configuration changed)
 - sase-0.0.1.0 (exe:jotun) (dependency rebuilt)
Configuring library for sase-0.0.1.0..
Warning: 'hs-source-dirs: test' directory does not exist.
Preprocessing library for sase-0.0.1.0..
Building library for sase-0.0.1.0..
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - sase-0.0.1.0 (lib) (configuration changed)
Configuring library for sase-0.0.1.0..
Warning: 'hs-source-dirs: test' directory does not exist.
2020-07-04 07:21:57.364309 [ThreadId 4] - Cradle set succesfully
2020-07-04 07:21:57.831994 [ThreadId 4] - New cradle: /Users/erick/sandbox/sase3/src/Jotun/Server/Handler/Home.hs
2020-07-04 07:21:57.833422 [ThreadId 4] - Cabal-Helper decided to use: ProjLocV2Dir {plProjectDirV2 = "/Users/erick/sandbox/sase3"}
2020-07-04 07:21:57.833466 [ThreadId 4] - Module "/Users/erick/sandbox/sase3/src/Jotun/Server/Handler/Home.hs" is loaded by Cradle: Cradle {cradleRootDir = "/Users/erick/sandbox/sase3", cradleOptsProg = CradleAction: Other CabalV2}
2020-07-04 07:21:57.833495 [ThreadId 4] - Found cradle: Cradle {cradleRootDir = "/Users/erick/sandbox/sase3", cradleOptsProg = CradleAction: Other CabalV2}
Build profile: -w ghc-8.8.3 -O1
In order, the following would be built (use -v for more details):
 - sase-0.0.1.0 (lib) (configuration changed)
 - sase-0.0.1.0 (exe:jotun) (configuration changed)
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - sase-0.0.1.0 (test:lib-test) (first run)
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - sase-0.0.1.0 (lib) (configuration changed)
 - sase-0.0.1.0 (exe:jotun) (dependency rebuilt)
Configuring library for sase-0.0.1.0..
Warning: 'hs-source-dirs: test' directory does not exist.
Preprocessing library for sase-0.0.1.0..
Building library for sase-0.0.1.0..
2020-07-04 07:22:04.561823 [ThreadId 4] - Cradle did not load succesfully

###################################################
###################################################

Dumping diagnostics:


/Users/erick/sandbox/sase3/Setup.hs: FAILED
	Fail on initialisation for "/Users/erick/sandbox/sase3/Setup.hs". Could not obtain flags for: "Setup.hs".
/Users/erick/sandbox/sase3/lib/Jotun/Model.hs: OK
/Users/erick/sandbox/sase3/lib/Utils/Ini.hs: OK
/Users/erick/sandbox/sase3/lib/Utils/Options.hs: OK
/Users/erick/sandbox/sase3/src/Jotun/Server/Handler/Home.hs: OK
/Users/erick/sandbox/sase3/src/Jotun/Server/Handler/Nowhere.hs: OK
/Users/erick/sandbox/sase3/src/Jotun/Server/Settings.hs: OK
/Users/erick/sandbox/sase3/src/Jotun/Server/Settings/StaticFiles.hs: OK
/Users/erick/sandbox/sase3/src/Jotun/Server/Application.hs: OK
/Users/erick/sandbox/sase3/src/Jotun/Server/Import.hs: OK
/Users/erick/sandbox/sase3/src/Jotun/Server/Foundation.hs: OK
/Users/erick/sandbox/sase3/src/Jotun/Main.hs: OK
/Users/erick/sandbox/sase3/src/Jotun/Options.hs: OK


Note: loading of 'Setup.hs' is not supported.

Ok.. now I fire off my editor (of course, still inside the nix shell) .. the logs I get from that LSP client are:

:: --> haskell-ide-engine initialize(1)


haskell-ide-engine: 2020-07-04 07:26:02.763523 [ThreadId 4] - Run entered for HIE(hie) Version 1.4 x86_64 ghc-8.8.3


haskell-ide-engine: 2020-07-04 07:26:02.764329 [ThreadId 4] - Operating as a LSP server on stdio


haskell-ide-engine: 2020-07-04 07:26:02.764356 [ThreadId 4] - Current directory:/Users/erick/sandbox/sase


haskell-ide-engine: 2020-07-04 07:26:02.764375 [ThreadId 4] - Operating system:darwin


haskell-ide-engine: 2020-07-04 07:26:02.764393 [ThreadId 4] - args:["--lsp"]


haskell-ide-engine: haskell-lsp:configuration parse error. RequestMessage {_jsonrpc = "2.0", _id = IdInt 1, _method = Initialize, _params = InitializeParams {_processId = Just 22470, _rootPath = Just "/Users/erick/sandbox/sase", _rootUri = Just (Uri {getUri = "file:///Users/erick/sandbox/sase"}), _initializationOptions = Just (Object (fromList [])), _capabilities = ClientCapabilities {_workspace = Just (WorkspaceClientCapabilities {_applyEdit = Just True, _workspaceEdit = Just (WorkspaceEditClientCapabilities {_documentChanges = Just True}), _didChangeConfiguration = Just (DidChangeConfigurationClientCapabilities {_dynamicRegistration = Just True}), _didChangeWatchedFiles = Nothing, _symbol = Just (SymbolClientCapabilities {_dynamicRegistration = Just True, _symbolKind = Just (SymbolKindClientCapabilities {_valueSet = Just (List [SkFile,SkModule,SkNamespace,SkPackage,SkClass,SkMethod,SkProperty,SkField,SkConstructor,SkEnum,SkInterface,SkFunction,SkVariable,SkConstant,SkString,SkNumber,SkBoolean,SkArray,SkObject,SkKey,SkNull,SkEnumMember,SkStruct,SkEvent,SkOperator,SkTypeParameter])})}), _executeCommand = Just (ExecuteClientCapabilities {_dynamicRegistration = Nothing}), _workspaceFolders = Just True, _configuration = Just True}), _textDocument = Just (TextDocumentClientCapabilities {_synchronization = Just (SynchronizationTextDocumentClientCapabilities {_dynamicRegistration = Just True, _willSave = Just True, _willSaveWaitUntil = Just True, _didSave = Just True}), _completion = Just (CompletionClientCapabilities {_dynamicRegistration = Just True, _completionItem = Just (CompletionItemClientCapabilities {_snippetSupport = Just True, _commitCharactersSupport = Nothing, _documentationFormat = Nothing, _deprecatedSupport = Nothing, _preselectSupport = Nothing}), _completionItemKind = Just (CompletionItemKindClientCapabilities {_valueSet = Just (List [CiText,CiMethod,CiFunction,CiConstructor,CiField,CiVariable,CiClass,CiInterface,CiModule,CiProperty,CiUnit,CiValue,CiEnum,CiKeyword,CiSnippet,CiColor,CiFile,CiReference,CiFolder,CiEnumMember,CiConstant,CiStruct,CiEvent,CiOperator,CiTypeParameter])}), _contextSupport = Nothing}), _hover = Just (HoverClientCapabilities {_dynamicRegistration = Just True, _contentFormat = Just (List [MkMarkdown,MkPlainText])}), _signatureHelp = Just (SignatureHelpClientCapabilities {_dynamicRegistration = Just True, _signatureInformation = Just (SignatureInformationClientCapabilities {documentationFormat = Nothing})}), _references = Just (ReferencesClientCapabilities {_dynamicRegistration = Just True}), _documentHighlight = Just (DocumentHighlightClientCapabilities {_dynamicRegistration = Just True}), _documentSymbol = Just (DocumentSymbolClientCapabilities {_dynamicRegistration = Just True, _symbolKind = Just (DocumentSymbolKindClientCapabilities {_valueSet = Just (List [SkFile,SkModule,SkNamespace,SkPackage,SkClass,SkMethod,SkProperty,SkField,SkConstructor,SkEnum,SkInterface,SkFunction,SkVariable,SkConstant,SkString,SkNumber,SkBoolean,SkArray,SkObject,SkKey,SkNull,SkEnumMember,SkStruct,SkEvent,SkOperator,SkTypeParameter])}), _hierarchicalDocumentSymbolSupport = Just True}), _formatting = Just (FormattingClientCapabilities {_dynamicRegistration = Just True}), _rangeFormatting = Just (RangeFormattingClientCapabilities {_dynamicRegistration = Just True}), _onTypeFormatting = Nothing, _definition = Just (DefinitionClientCapabilities {_dynamicRegistration = Just True}), _typeDefinition = Just (TypeDefinitionClientCapabilities {_dynamicRegistration = Just True}), _implementation = Just (ImplementationClientCapabilities {_dynamicRegistration = Just True}), _codeAction = Just (CodeActionClientCapabilities {_dynamicRegistration = Just True, _codeActionLiteralSupport = Just (CodeActionLiteralSupport {_codeActionKind = CodeActionKindClientCapabilities {_valueSet = List []}})}), _codeLens = Nothing, _documentLink = Nothing, _colorProvider = Just (ColorProviderClientCapabilities {_dynamicRegistration = Just True}), _rename = Just (RenameClientCapabilities {_dynamicRegistration = Just True, _prepareSupport = Nothing}), _publishDiagnostics = Just (PublishDiagnosticsClientCapabilities {_relatedInformation = Just True}), _foldingRange = Nothing}), _window = Just (WindowClientCapabilities {_workDoneProgress = Just True}), _experimental = Just (fromList [])}, _trace = Nothing, _workspaceFolders = Just (List [WorkspaceFolder {_uri = "file:///Users/erick/sandbox/sase", _name = "sase"}])}} "key \"languageServerHaskell\" not found"


haskell-ide-engine: 2020-07-04 07:26:02.767964 [ThreadId 4] - Cabal-Helper decided to use: ProjLocV2Dir {plProjectDirV2 = "/Users/erick/sandbox/sase"}


haskell-ide-engine: 2020-07-04 07:26:02.768022 [ThreadId 4] - Module "/Users/erick/sandbox/sase/File.hs" is loaded by Cradle: Cradle {cradleRootDir = "/Users/erick/sandbox/sase", cradleOptsProg = CradleAction: Other CabalV2}


haskell-ide-engine: 2020-07-04 07:26:02.768192 [ThreadId 4] - Executing GHC on path with args: --numeric-version


haskell-ide-engine: 2020-07-04 07:26:02.856572 [ThreadId 9] - Executing GHC on path with args: --print-libdir


:: <<< haskell-ide-engine 1


::  -> haskell-ide-engine initialized


::  -> haskell-ide-engine textDocument/didOpen


haskell-ide-engine: Using hie version: Version 1.4 x86_64 ghc-8.8.3


haskell-ide-engine: 2020-07-04 07:26:02.968101 [ThreadId 15] - New cradle: /Users/erick/sandbox/sase/src/Jotun/Options.hs


haskell-ide-engine: Using hoogle db at: /Users/erick/.hoogle/default-haskell-5.0.17.hoo


haskell-ide-engine: 2020-07-04 07:26:02.97001 [ThreadId 15] - Cabal-Helper decided to use: ProjLocV2Dir {plProjectDirV2 = "/Users/erick/sandbox/sase"}


haskell-ide-engine: 2020-07-04 07:26:02.970066 [ThreadId 15] - Module "/Users/erick/sandbox/sase/src/Jotun/Options.hs" is loaded by Cradle: Cradle {cradleRootDir = "/Users/erick/sandbox/sase", cradleOptsProg = CradleAction: Other CabalV2}


haskell-ide-engine: 2020-07-04 07:26:02.9701 [ThreadId 15] - Found cradle: Cradle {cradleRootDir = "/Users/erick/sandbox/sase", cradleOptsProg = CradleAction: Other CabalV2}


:: <-- haskell-ide-engine window/workDoneProgress/create(0)


:: >>> haskell-ide-engine 0


:: <-  haskell-ide-engine $/progress


haskell-ide-engine: Resolving dependencies...


haskell-ide-engine: cabal: Could not resolve dependencies:


haskell-ide-engine: [__0] trying: persistent-mysql-2.10.2.3 (user goal)


haskell-ide-engine: [__1] trying: base-4.13.0.0/installed-4.13.0.0 (dependency of


haskell-ide-engine: persistent-mysql)


haskell-ide-engine: [__2] trying: persistent-mysql-haskell-0.6.0 (user goal)


haskell-ide-engine: [__3] next goal: tls (dependency of persistent-mysql-haskell)


haskell-ide-engine: [__3] rejecting: tls-1.5.4/installed-EQGz6tvU5RpKV1lFE5vTpJ (conflict:


haskell-ide-engine: persistent-mysql-haskell => tls>=1.3.5 && <1.5)


haskell-ide-engine: [__3] skipping: tls-1.5.4, tls-1.5.3, tls-1.5.2, tls-1.5.1, tls-1.5.0 (has the


haskell-ide-engine: same characteristics that caused the previous version to fail: excluded by


haskell-ide-engine: constraint '>=1.3.5 && <1.5' from 'persistent-mysql-haskell')


haskell-ide-engine: [__3] trying: tls-1.4.1


haskell-ide-engine: [__4] trying: x509-1.7.5/installed-TqSiN7KBYCwsGoagrW4 (dependency of tls)


haskell-ide-engine: [__5] trying: memory-0.15.0/installed-8hr1W6hgHs84pJa6Fce0sL (dependency of


haskell-ide-engine: tls)


haskell-ide-engine: [__6] trying: async-2.2.2/installed-HBBQNycGuFQI3YHCpQoFNf (dependency of tls)


haskell-ide-engine: [__7] next goal: mysql-haskell (dependency of persistent-mysql-haskell)


haskell-ide-engine: [__7] rejecting: mysql-haskell-0.8.4.2/installed-1Gp1W6Sj6ueBn1jmHnKP6a


haskell-ide-engine: (conflict: tls==1.4.1, mysql-haskell =>


haskell-ide-engine: tls==1.5.4/installed-EQGz6tvU5RpKV1lFE5vTpJ)


haskell-ide-engine: [__7] rejecting: mysql-haskell-0.8.4.2, mysql-haskell-0.8.4.1,


haskell-ide-engine: mysql-haskell-0.8.4.0, mysql-haskell-0.8.3.0, mysql-haskell-0.8.2.0 (conflict:


haskell-ide-engine: x509 => memory==0.15.0/installed-8hr1W6hgHs84pJa6Fce0sL, mysql-haskell =>


haskell-ide-engine: memory>=0.14.4 && <0.15)


haskell-ide-engine: [__7] rejecting: mysql-haskell-0.8.1.0 (conflict: x509 =>


haskell-ide-engine: memory==0.15.0/installed-8hr1W6hgHs84pJa6Fce0sL, mysql-haskell =>


haskell-ide-engine: memory<=0.14.2)


haskell-ide-engine: [__7] rejecting: mysql-haskell-0.8.0.0 (conflict: tls==1.4.1, mysql-haskell =>


haskell-ide-engine: tls>=1.3.5 && <1.4)


haskell-ide-engine: [__7] skipping: mysql-haskell-0.7.1.0, mysql-haskell-0.7.0.0,


haskell-ide-engine: mysql-haskell-0.6.0.0, mysql-haskell-0.5.1.0, mysql-haskell-0.5.0.0,


haskell-ide-engine: mysql-haskell-0.4.1.0, mysql-haskell-0.4.0.0 (has the same characteristics


haskell-ide-engine: that caused the previous version to fail: excludes 'tls' version 1.4.1)


haskell-ide-engine: [__7] rejecting: mysql-haskell-0.3.0.0 (conflict: persistent-mysql-haskell =>


haskell-ide-engine: mysql-haskell>=0.8.0.0 && <1.0)


haskell-ide-engine: [__7] skipping: mysql-haskell-0.2.0.0, mysql-haskell-0.1.0.0 (has the same


haskell-ide-engine: characteristics that caused the previous version to fail: excluded by


haskell-ide-engine: constraint '>=0.8.0.0 && <1.0' from 'persistent-mysql-haskell')


haskell-ide-engine: [__7] fail (backjumping, conflict set: mysql-haskell,


haskell-ide-engine: persistent-mysql-haskell, tls, x509)


haskell-ide-engine: After searching the rest of the dependency tree exhaustively, these were the


haskell-ide-engine: goals I've had most trouble fulfilling: tls, base, persistent-mysql-haskell,


haskell-ide-engine: x509, mysql-haskell, memory, async, persistent-mysql


haskell-ide-engine: Try running with --minimize-conflict-set to improve the error message.


haskell-ide-engine: 


haskell-ide-engine: 2020-07-04 07:26:06.239607 [ThreadId 9] - Scheduler thread exited unexpectedly: callProcessStderr: cabal v2-build --with-ghc=/nix/store/45hiivv8ckry1awp3pg043d3c7f2y5wx-ghc-8.8.3-with-packages/bin/ghc --with-ghc-pkg=/nix/store/45hiivv8ckry1awp3pg043d3c7f2y5wx-ghc-8.8.3-with-packages/bin/ghc-pkg --with-haddock=/nix/store/45hiivv8ckry1awp3pg043d3c7f2y5wx-ghc-8.8.3-with-packages/bin/haddock --builddir=/Users/erick/sandbox/sase/dist-newstyle --dry-run all (exit 1): failed

Hmm... it is not using the overrided nix packages (which have fixes for this dependency problem). Ok so I grabbed that last command issued by hie to build cabal:

$ cabal v2-build --with-ghc=/nix/store/45hiivv8ckry1awp3pg043d3c7f2y5wx-ghc-8.8.3-with-packages/bin/ghc --with-ghc-pkg=/nix/store/45hiivv8ckry1awp3pg043d3c7f2y5wx-ghc-8.8.3-with-packages/bin/ghc-pkg --with-haddock=/nix/store/45hiivv8ckry1awp3pg043d3c7f2y5wx-ghc-8.8.3-with-packages/bin/haddock --builddir=/Users/erick/sandbox/sase/dist-newstyle --dry-run all
Resolving dependencies...
Build profile: -w ghc-8.8.3 -O1
In order, the following would be built (use -v for more details):
 - sase-0.0.1.0 (exe:jotun) (first run)

so that succeeds.. that was a dry run.. but even if I just remove the dry run option:

$ cabal v2-build --with-ghc=/nix/store/45hiivv8ckry1awp3pg043d3c7f2y5wx-ghc-8.8.3-with-packages/bin/ghc --with-ghc-pkg=/nix/store/45hiivv8ckry1awp3pg043d3c7f2y5wx-ghc-8.8.3-with-packages/bin/ghc-pkg --with-haddock=/nix/store/45hiivv8ckry1awp3pg043d3c7f2y5wx-ghc-8.8.3-with-packages/bin/haddock --builddir=/Users/erick/sandbox/sase/dist-newstyle
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - sase-0.0.1.0 (exe:jotun) (first run)
Preprocessing executable 'jotun' for sase-0.0.1.0..
Building executable 'jotun' for sase-0.0.1.0..
[ 2 of 10] Compiling Jotun.Server.Settings ( src/Jotun/Server/Settings.hs, /Users/erick/sandbox/sase/dist-newstyle/build/x86_64-osx/ghc-8.8.3/sase-0.0.1.0/x/jotun/build/jotun/jotun-tmp/Jotun/Server/Settings.o )

(some unrelated compile error follows which is not relevant to this problem.. this is the compile error I am trying to get my editor to show :-)  ... but clearly the dependency resolution phase works etc)

Thanks for helping me by taking a look at this. Cheers!

I'm pretty sure that cabal-helper requires whatever Cabal (the library) version that cabal --numeric-version (the cabal binary from cabal-install) gives back, which is probably 3.2.0.0 in your case. However you probably only have Cabal 3.0.1.0 in the environment (you can see that with ghc-pkg list).

There might be a better way to fix this, but check out how I did it in the nixpkgs-infra template, specifically https://github.com/Infinisil/all-hies/blob/eff5d9a5e1a84150014095494331cf63e59923af/templates/nixpkgs-infra/all-hies-template.cabal#L18-L20 and https://github.com/Infinisil/all-hies/blob/eff5d9a5e1a84150014095494331cf63e59923af/templates/nixpkgs-infra/default.nix#L29-L35

In your case this would be Cabal_3_2_0_0 (your nixpkgs version should have that). If you then check ghc-pkg list it should contain that version of Cabal, and you should be able to remove ~/.cache/cabal-helper and run hie to have it use the version provided by Nix.

Hmm.. I see.. ok I understand the problem in principle.. however.. I am a bit puzzled.. where is that Cabal_3_0_1_0 coming from? .. (and that is more of a question for myself but still hoping you might just have an inkling where that might be indeed coming from) .. I mean my base version of nixpkgs is fairly recent and it does offer Cabal_3_2_0_0 along with Cabal_2_4_1_0 and Cabal_2_2_0_1. .. there is no 3_0_1_0 in my Nixpkgs .. and I myself aren't overriding that anywhere in my infrastructure.. so I must conclude some package I am using is overriding that in? .. my goodness how can one track that?

I just tried adding an explicit override in my default.nix to use Cabal 3.2.0.0 and it still shows 3.0.1.0 in my ghc-pkg list..

Hmm.... ๐Ÿค”

like:

nix-repl> base = import <nixpkgs> {}
nix-repl> pinnedVersion = base.pkgs.lib.importJSON ./nixpkgs.json 
nix-repl> nixpkgs = import (base.pkgs.fetchFromGitHub {owner = "NixOS";repo  = "nixpkgs"nix-repl> nixpkgs = import (base.pkgs.fetchFromGitHub {owner = "NixOS";repo  = "nixpkgs";inherit (pinnedVersion) rev sha256;}) {} 

nix-repl> nixpkgs.pkgs.haskell.packages.ghc883.Cabal 

nixpkgs.pkgs.haskell.packages.ghc883.Cabal
nixpkgs.pkgs.haskell.packages.ghc883.Cabal-ide-backend
nixpkgs.pkgs.haskell.packages.ghc883.CabalSearch
nixpkgs.pkgs.haskell.packages.ghc883.Cabal_2_2_0_1
nixpkgs.pkgs.haskell.packages.ghc883.Cabal_2_4_1_0
nixpkgs.pkgs.haskell.packages.ghc883.Cabal_3_2_0_0

nix-repl> nixpkgs.pkgs.haskellPackages.Cabal
nixpkgs.pkgs.haskellPackages.Cabal
nixpkgs.pkgs.haskellPackages.Cabal-ide-backend
nixpkgs.pkgs.haskellPackages.CabalSearch
nixpkgs.pkgs.haskellPackages.Cabal_2_2_0_1
nixpkgs.pkgs.haskellPackages.Cabal_2_4_1_0
nixpkgs.pkgs.haskellPackages.Cabal_3_2_0_0

Cabal 3.0.1.0 comes shipped with the GHC version, https://www.snoyman.com/base has an overview of which GHC ships which Cabal versions.

As long as ghc-pkg list has Cabal-3.2.0.0 it should work. E.g. the nixpkgs-infra template has this output for ghc-pkg list:

/nix/store/zvxw1wz5lqz7cl292q74pkv7nn0fsn0m-ghc-8.6.5-with-packages/lib/ghc-8.6.5/package.conf.d
    Cabal-2.4.0.1
    Cabal-3.0.0.0
    array-0.5.3.0
    base-4.12.0.0
    binary-0.8.6.0
    bytestring-0.10.8.2
    containers-0.6.0.1
    deepseq-1.4.4.0
    directory-1.3.3.0
    filepath-1.4.2.1
    ghc-8.6.5
    ghc-boot-8.6.5
    ghc-boot-th-8.6.5
    ghc-compact-0.1.0.0
    ghc-heap-8.6.5
    ghc-prim-0.5.3
    ghci-8.6.5
    haskeline-0.7.4.3
    hpc-0.6.0.3
    integer-gmp-1.0.2.0
    libiserv-8.6.3
    mtl-2.2.2
    parsec-3.1.13.0
    pretty-1.1.3.6
    process-1.6.5.0
    rts-1.0
    stm-2.5.0.0
    template-haskell-2.14.0.0
    terminfo-0.4.1.2
    text-1.2.3.1
    time-1.8.0.2
    transformers-0.5.6.2
    unix-2.7.2.2
    xhtml-3000.2.2.1

Both the change in the cabal file and the default.nix I showed in #65 (comment) are needed for this (but use Cabal_3_2_0_0 in your case)

Ok got it .. thanks. I am closing this since it really isn't an issue with all-hies. Cheers and thanks for your help!