1

I've previous solved this issue, but I don't remember what I did... So thought I'd post it here to settle it.

I'm trying to build a Haskell package with stack build nix, I'm following the answer from https://stackoverflow.com/a/47110522/1663462 but it runs into an error of:

Unpacking GHC into /home/chris/.stack/programs/x86_64-linuRunning /home/chris/.stack/programs/x86_64-linux-nix/ghc-8.0.2.temp/ghc-8.0.2/configure --prefix=/home/chris/.stack/programs/x86_64-linux-nix/ghc-8.0.2/ in directory /home/chris/.stack/programs/x86_64-linux-nix/ghc-8.0.2.temp/ghc-8.0.2/ exited with ExitFailure 1                         

checking for path to top of build tree...                                  
/home/chris/.stack/programs/x86_64-linux-nix/ghc-8.0.2.temp/ghc-8.0.2/configure: utils/ghc-pwd/dist-install/build/tmp/ghc-pwd-bindist: /bin/bash: bad interpreter: No such file or directory       
configure: error: cannot determine current directory    

How can I solve this?


stack --nix setup results in:

Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Already downloaded.                
Running /home/chris/.stack/programs/x86_64-linux-nix/ghc-8.0.2.temp/ghc-8.0.2/configure --prefix=/home/chris/.stack/programs/x86_64-linux-nix/ghc-8.0.2/ in directory /home/chris/.stack/programs/x86_64-linux-nix/ghc-8.0.2.temp/ghc-8.0.2/ exited with ExitFailure 1

checking for path to top of build tree... 
/home/chris/.stack/programs/x86_64-linux-nix/ghc-8.0.2.temp/ghc-8.0.2/configure: utils/ghc-pwd/dist-install/build/tmp/ghc-pwd-bindist: /bin/bash: bad interpreter: No such file or directory
configure: error: cannot determine current directory


Error: Error encountered while configuring GHC with
         /home/chris/.stack/programs/x86_64-linux-nix/ghc-8.0.2.temp/ghc-8.0.2/configure --prefix=/home/chris/.stack/programs/x86_64-linux-nix/ghc-8.0.2/
         run in /home/chris/.stack/programs/x86_64-linux-nix/ghc-8.0.2.temp/ghc-8.0.2/

       The following directories may now contain files, but won't be used by stack:
         - /home/chris/.stack/programs/x86_64-linux-nix/ghc-8.0.2.temp/
         - /home/chris/.stack/programs/x86_64-linux-nix/ghc-8.0.2/

Configuring GHC ...
Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286

1 Answers1

0
nix:
    enable: true
    packages:
      - pkgconfig
      - autoconf
      - gcc
      - xorg.libX11
      - xorg.libXext
      - xorg.libXft
      - xorg.libXinerama
      - xorg.libXpm
      - xorg.libXrandr
      - xorg.libXrender

The above worked for me. I think it's just the autoconf that is needed. Answering with the full list in case it's not.

Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286