Haskell stack not working after upgrade to 19.03


after upgrading to nixos-19.03 stack started misbehaving:

$ stack ghci                                                                                                                                         
error: attribute 'ghc863' missing, at (string):1:43                                                                                                                          
(use '--show-trace' to show detailed location information)

While a simple stack --help works (i.e. the expected output is produced).

Am I doing something wrong or should I report a bug?

1 Like

Could you provide a bit more information?

Like, could you provide the --show-trace output, the default.nix and the stack.yaml that you are uisng?

I think haskell.compiler.ghc863 was removed from nixpkgs. You may want to use a stack resolver that points to ghc864.

1 Like

You can alternatively point stack to a version of nixpkgs that has ghc863

  path: [nixpkgs=https://github.com/NixOS/nixpkgs/archive/REV.tar.gz]

Removing ~/.stack and running stack againg solved the problem :slight_smile:

How? Shouldn’t it have still been looking for ghc863, which still shouldn’t have existed? What GHC version is getting?

1 Like

I confirm both the problem (upgrading to 19.03 breaks stack) and the effectiveness of the solution from @wfranzini (delete .stack directory and invoking stack again).

Please note that i get this error minutes ago, after executing <nixos-rebuild switch --upgrade> from the stable channel, so it is still an issue.

little after that, trying to work on another project, i got the message “attribute ‘ghc843’ missing”…
So, this don’t solve for everithing, just for the originally reported issue. And, the same error is informed if you try to use --trace

It doesn’t for stack repl at least.