stack2nix icon indicating copy to clipboard operation
stack2nix copied to clipboard

Runtime-dependency on cabal executable?

Open nh2 opened this issue 6 years ago • 6 comments

I got this:

Ensuring cabal version is >= 2 ...
stack2nix: ERROR: cabal version must be 2 or higher. Current version: 1.22.6.0
CallStack (from HasCallStack):
  error, called at src/Stack2nix/Util.hs:47:49 in stack2nix-0.1.3.1-3EqQ1tT1vMJGpAYSWfmhUQ:Stack2nix.Util

I see it calls cabal --version. Why is that?

stack2nix already link in the Cabal library, so couldn't it use only functionality from that? Then it wouldn't care about whatever cabal is in path (or even require it to be installed).

nh2 avatar May 28 '18 16:05 nh2

Another question: For now, how can I get exactly a version of the cabal executable that's known to work with stack2nix? Can I obtain it as part of stack2nix's nix-shell environment?

nh2 avatar May 28 '18 19:05 nh2

Hmm here this was deleted: https://github.com/input-output-hk/stack2nix/commit/4e31eb8c9f4ad8431e533b3ca078c986869cc0d8#diff-04c6e90faac2675aa89e2176d2eec7d8L26:

-4. Ensure `cabal` (via `cabal-install` package), `cabal2nix` >= 2.2.1, and `stack2nix` are in your `$PATH`

Am I doing something wrong / should there not be a runtime dependency any more? (cc @domenkozar)

nh2 avatar May 28 '18 19:05 nh2

cabal update is still ran to make sure hackage db is up to date. It could be made optional.

iirc stack2nix did provision itself a cabal from nixpkgs, are you using master branch?

domenkozar avatar May 28 '18 20:05 domenkozar

@domenkozar Yeah I'm in 9070f9173ae32f0be6f7830c41c8cfb8e780fdbf. In nix-shell --pure default.nix there's no cabal in PATH. Am I looking in the wrong spot?

nh2 avatar May 28 '18 20:05 nh2

Ah yeah, we should probably pin down <nixpkgs> at https://github.com/input-output-hk/stack2nix/blob/master/src/Stack2nix/Util.hs#L73

domenkozar avatar May 29 '18 17:05 domenkozar

Relevant #102

domenkozar avatar Aug 14 '18 10:08 domenkozar