With Nix integration, Stack executes nix-shell with arguments. If the command fails, Stack does not attempt to put that error in any context.
For example, with shell.nix:
{ghc}:
with (import <nixpkgs> {});
haskell.lib.buildStackProject {
inherit ghc;
name = "myEnv";
buildInputs = [ zlib glpk pcre ];
duff;
}
The output of stack build --nix is just (coloured by Nix):
error: syntax error, unexpected ';', expecting '.' or '='
at /home/mpilgrem/Code/Haskell/testNic/shell.nix:8:7:
7| buildInputs = [ zlib glpk pcre ];
8| duff;
| ^
9| }
rather than something like:
Error: [S-1264]
While using nix-instantiate, with arguments:
* /home/mpilgrem/Code/Haskell/testNic/shell.nix
* --arg
* ghc
* with (import <nixpkgs> {}); haskell.compiler.ghc9103
* --argstr
* ghcVersion
* ghc9103
* --show-trace
Stack encountered the following error:
error: syntax error, unexpected ';', expecting '.' or '='
at /home/mpilgrem/Code/Haskell/testNic/shell.nix:8:7:
7| buildInputs = [ zlib glpk pcre ];
8| duff;
| ^
9| }
Unfortunately, there is no way to obtain coloured output from Nix commands:
With Nix integration, Stack executes
nix-shellwith arguments. If the command fails, Stack does not attempt to put that error in any context.For example, with
shell.nix:The output of
stack build --nixis just (coloured by Nix):rather than something like:
Unfortunately, there is no way to obtain coloured output from Nix commands: