Stack: nix streamingProcess: runInteractiveProcess: exec: does not exist

Created on 18 Jun 2016  路  27Comments  路  Source: commercialhaskell/stack

Stack stuck and would not resolve dependencies.

$ stack build
No packages found in snapshot which provide a "hsc2hs" executable, which is a build-tool dependency of "skein"
Missing build-tools may be caused by dependencies of the build-tool being overridden by extra-deps.
This should be fixed soon - see this issue https://github.com/commercialhaskell/stack/issues/595

No packages found in snapshot which provide a "hsc2hs" executable, which is a build-tool dependency of "postgresql-libpq"
Missing build-tools may be caused by dependencies of the build-tool being overridden by extra-deps.
This should be fixed soon - see this issue https://github.com/commercialhaskell/stack/issues/595

clock-0.5.1: configure
aeson-0.11.1.4: configure
adjunctions-4.3: configure
case-insensitive-1.2.0.6: configure
blaze-builder-0.4.0.2: configure
crypto-random-0.0.9: configure
crypto-cipher-types-0.0.9: configure
double-conversion-2.0.1.0: configure
Progress: 8/57/home/netsu/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3: streamingProcess: runInteractiveProcess: exec: does not exist (No such file or directory)

/home/netsu/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3: streamingProcess: runInteractiveProcess: exec: does not exist (No such file or directory)

/home/netsu/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3: streamingProcess: runInteractiveProcess: exec: does not exist (No such file or directory)

/home/netsu/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3: streamingProcess: runInteractiveProcess: exec: does not exist (No such file or directory)

/home/netsu/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3: streamingProcess: runInteractiveProcess: exec: does not exist (No such file or directory)

/home/netsu/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3: streamingProcess: runInteractiveProcess: exec: does not exist (No such file or directory)

/home/netsu/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3: streamingProcess: runInteractiveProcess: exec: does not exist (No such file or directory)

/home/netsu/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3: streamingProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
$ stack --version
Version 1.1.2 x86_64 hpack-0.14.1

Same for stack 1.1.3 from git.

$ nix-build --version
nix-build (Nix) 1.11.2
$ cat stack.yaml 
flags: {}
nix:
  enable: true
  shell-file: shell_stack.nix
extra-package-dbs: []
ghc-options:
  ! '*': -ghci-script .ghci_conf
packages:
- '.'
- location:
    git: https://github.com/snapframework/heist.git
    commit: 829fc6133d328de8e7af1675832e42658c5da387
  extra-dep: true
- location:
    git: https://github.com/snapframework/io-streams-haproxy.git
    commit: ab208d49fe73c9cf05e46c0d929eec311fb0cfd9
  extra-dep: true
- location:
    git: https://github.com/snapframework/snap-server.git
    commit: f2c4ced4f3414a3a2e7eaf422c5002a8decb2512
  extra-dep: true
- location:
    git: https://github.com/snapframework/snap-core.git
    commit: 64e25f72d7e3375145b4a77e5c2da288aa821922
  extra-dep: true
- location:
    git: https://github.com/snapframework/snap.git
    commit: bb45b70ec1234bef4b193c1daa617a8134fe829e
  extra-dep: true
- location:
    git: https://github.com/snapframework/snap-loader-static.git
    commit: 4df25f78d96a4cecab747452001a8f7523be9b77
- location:
    git: https://github.com/snapframework/snap-loader-dynamic
    commit: 32680dc0b8f65eecefacfbb17e35df61f7fe3a7d
- location:
    git: https://github.com/haskell-servant/servant.git
    commit: c2c9bef5715bdfb1819f54e00127a62f2fdc44ec
  subdirs:
  - servant
  - servant-blaze
  extra-dep: true
( . . . )
- location:
    git: https://github.com/dbp/hspec-snap.git
    commit: a09c22cd49affbd883236ffb13643642869c6863
  extra-dep: true
extra-deps:
- aeson-0.11.1.4
- clock-0.5.1
- heist-1.0.0.0
- hspec-snap-1.0.0.0
- servant-0.6.1
- servant-blaze-0.6.1
- snap-1.0.0.0
- snap-core-1.0.0.0
- snap-server-1.0.0.0
rebuild-ghc-options: true
compiler-check: newer-minor
compiler: ghc-7.10.3
resolver: lts-5.15
require-stack-version: ! '>= 1.1.2'
$ cat shell_stack.nix
# only works with Stack >= 1.1.3, with stack-1.1.2 will use lts-5.15
{ nixpkgs ? import <nixpkgs> { config.allowUnfree = true; }
, ghc_lts ? nixpkgs.haskell.packages.lts-5_15 }:

with nixpkgs;
with haskell.lib;

let
  ghc_stack = ghc_lts.override rec {
    overrides = self: super: {
      # fix hoogle dependency in lts-5_15
      vector-algorithms = overrideCabal super.vector-algorithms (drv: {
        libraryHaskellDepends = with self; [ mtl mwc-random ] ++ drv.libraryHaskellDepends;
      });
      # fix dependencies not resolved by stack # <-- fix bug with stack-1.1.3
      # pipes-transduce = super.pipes-transduce.override {
      #   foldl = self.foldl_1_2_1;
      # };
      # foldl_1_2_1 = overrideCabal super.foldl (drv: {
      #   version = "1.2.1";
      #   sha256 = "0ww0wsv3b11qgpjzj3nlixz5gwy65yhpy40pww0rj7crh7gsibw6";
      # });
    };
  };
in with ghc_stack;

haskell.lib.buildStackProject {
  name = "stackDevEnv";
  buildInputs = with nixpkgs; [ bash git postgresql95 zlib gcc
    pkgconfig openssl cacert # nixpkgs.stack # <-- tried stack with --no-nix in nix-shell
    cabal-install # hsc2hs process-streaming # <-- Do not help to solve issue
  ];
  ghc = (ghcWithHoogle (hpkgs: [
    hlint
    hi
    (dontCheck intero)
    funnyprint
    haskell-docs
    stylish-haskell
    structured-haskell-mode
    ghc-mod
    hasktags
    HaRe
  ]));
  shellHook = ''
    export GIT_SSL_CAINFO='/etc/ssl/certs/ca-certificates.crt'
  '';
}
nix further investigation required help wanted bug

Most helpful comment

+1 to @domenkozar, and additionally:

The quick workaround is

rm -r ~/.stack/setup-exe-cache

All 27 comments

Maybe something wrong with $PATH?

This error go away after removing ~/.stack (but leave ~/.stack/config.yaml only).

Now I have link error (libpq.a and fe-secure-openssl.o). But _libpq_ and _openssl_ are binary dependencies of haskell package libpq which dependency of postgresql-simple, which dependency of current project. So it's pretty strange that it throw linking error for main project.


Full log:

 $ stack clean                       
 $ cp ~/.stack/config.yaml ~/ && rm -Rf ~/.stack && mkdir ~/.stack && mv ~/config.yaml ~/.stack/ 
 $ stack clean                                                                                   
Downloaded lts-5.15 build plan.    
Fetching package index ...remote: Counting objects: 218877, done.
remote: Compressing objects: 100% (176417/176417), done.
remote: Total 218877 (delta 58469), reused 172502 (delta 40264), pack-reused 0
Receiving objects: 100% (218877/218877), 51.27 MiB | 641.00 KiB/s, done.
Resolving deltas: 100% (58469/58469), completed with 1 local object.
From https://github.com/commercialhaskell/all-cabal-hashes
 * [new tag]         current-hackage -> current-hackage
Fetched package index.    
Populated index cache.    
 $ stack build
No packages found in snapshot which provide a "hsc2hs" executable, which is a build-tool dependency of "skein"
Missing build-tools may be caused by dependencies of the build-tool being overridden by extra-deps.
This should be fixed soon - see this issue https://github.com/commercialhaskell/stack/issues/595

No packages found in snapshot which provide a "hsc2hs" executable, which is a build-tool dependency of "postgresql-libpq"
Missing build-tools may be caused by dependencies of the build-tool being overridden by extra-deps.
This should be fixed soon - see this issue https://github.com/commercialhaskell/stack/issues/595

[1 of 1] Compiling Main             ( /run/user/1000/stack10394/Setup.hs, /run/user/1000/stack10394/Setup.o )
Linking /home/netsu/.stack/setup-exe-cache/x86_64-linux-nix/tmp-setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 ...
aeson-0.11.1.4: unregistering
api-afftrack-0.1.4.0: unregistering
api-hasoffers-0.1.2.0: unregistering
clock-0.5.1: unregistering (flags changed from [] to ["--extra-include-dirs=/nix/store/71sjh1wisqiv4gh84c74nrsxgwb2x3pn-cabal-install-1.24.0.0/include","--extra-include-dirs=/nix/store/hbgd7mbpylfz6zxj5bkdyi07yag77b8l-bash-4.3-p42/include","--extra-include-dirs=/nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/include","--extra-include-dirs=/nix/store/syimvl7i9bhcjnm5wvmx40qm3zkr2vjl-git-2.9.0/include","--extra-include-dirs=/nix/store/w2ckdaz3dfpp3b42qycv7d9wwg9gpybb-nss-cacert-3.23/include","--extra-include-dirs=/nix/store/x30lc0shkl4mzhznqjfw5q7i013y9jyp-pkg-config-0.29/include","--extra-include-dirs=/nix/store/x73cisfh2hzim7ilip11jn1h20binmv7-stack-1.1.2/include","--extra-lib-dirs=/nix/store/71sjh1wisqiv4gh84c74nrsxgwb2x3pn-cabal-install-1.24.0.0/lib","--extra-lib-dirs=/nix/store/hbgd7mbpylfz6zxj5bkdyi07yag77b8l-bash-4.3-p42/lib","--extra-lib-dirs=/nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib","--extra-lib-dirs=/nix/store/syimvl7i9bhcjnm5wvmx40qm3zkr2vjl-git-2.9.0/lib","--extra-lib-dirs=/nix/store/w2ckdaz3dfpp3b42qycv7d9wwg9gpybb-nss-cacert-3.23/lib","--extra-lib-dirs=/nix/store/x30lc0shkl4mzhznqjfw5q7i013y9jyp-pkg-config-0.29/lib","--extra-lib-dirs=/nix/store/x73cisfh2hzim7ilip11jn1h20binmv7-stack-1.1.2/lib"])
heist-1.0.0.0: unregistering
io-streams-haproxy-1.0.0.0: unregistering
lens-aeson-1.0.0.5: unregistering
postgresql-simple-0.5.1.3: unregistering
servant-0.6.1: unregistering
servant-blaze-0.6.1: unregistering
servant-snap-0.6: unregistering
snap-1.0.0.0: unregistering
snap-core-1.0.0.0: unregistering
snap-loader-dynamic-1.0.0.0: unregistering
snap-loader-static-1.0.0.0: unregistering (flags changed from [] to ["--extra-include-dirs=/nix/store/71sjh1wisqiv4gh84c74nrsxgwb2x3pn-cabal-install-1.24.0.0/include","--extra-include-dirs=/nix/store/hbgd7mbpylfz6zxj5bkdyi07yag77b8l-bash-4.3-p42/include","--extra-include-dirs=/nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/include","--extra-include-dirs=/nix/store/syimvl7i9bhcjnm5wvmx40qm3zkr2vjl-git-2.9.0/include","--extra-include-dirs=/nix/store/w2ckdaz3dfpp3b42qycv7d9wwg9gpybb-nss-cacert-3.23/include","--extra-include-dirs=/nix/store/x30lc0shkl4mzhznqjfw5q7i013y9jyp-pkg-config-0.29/include","--extra-include-dirs=/nix/store/x73cisfh2hzim7ilip11jn1h20binmv7-stack-1.1.2/include","--extra-lib-dirs=/nix/store/71sjh1wisqiv4gh84c74nrsxgwb2x3pn-cabal-install-1.24.0.0/lib","--extra-lib-dirs=/nix/store/hbgd7mbpylfz6zxj5bkdyi07yag77b8l-bash-4.3-p42/lib","--extra-lib-dirs=/nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib","--extra-lib-dirs=/nix/store/syimvl7i9bhcjnm5wvmx40qm3zkr2vjl-git-2.9.0/lib","--extra-lib-dirs=/nix/store/w2ckdaz3dfpp3b42qycv7d9wwg9gpybb-nss-cacert-3.23/lib","--extra-lib-dirs=/nix/store/x30lc0shkl4mzhznqjfw5q7i013y9jyp-pkg-config-0.29/lib","--extra-lib-dirs=/nix/store/x73cisfh2hzim7ilip11jn1h20binmv7-stack-1.1.2/lib"])
snap-server-1.0.0.0: unregistering
snaplet-postgresql-simple-1.0: unregistering
adjunctions-4.3: download
blaze-builder-0.4.0.2: download
clock-0.5.1: download
base-compat-0.9.1: download
data-default-class-0.0.1: download
bytestring-builder-0.10.6.0.0: download
base64-bytestring-1.0.0.1: download
case-insensitive-1.2.0.6: download
clock-0.5.1: configure
clock-0.5.1: build
data-default-class-0.0.1: configure
data-default-class-0.0.1: build
adjunctions-4.3: configure
data-default-class-0.0.1: copy/register
adjunctions-4.3: build
base-compat-0.9.1: configure
clock-0.5.1: copy/register
directory-tree-0.12.0: download
base-compat-0.9.1: build
bytestring-builder-0.10.6.0.0: configure
bytestring-builder-0.10.6.0.0: build
base64-bytestring-1.0.0.1: configure
bytestring-builder-0.10.6.0.0: copy/register
double-conversion-2.0.1.0: download
base64-bytestring-1.0.0.1: build
blaze-builder-0.4.0.2: configure
extensible-exceptions-0.1.1.4: download
blaze-builder-0.4.0.2: build
case-insensitive-1.2.0.6: configure
base-compat-0.9.1: copy/register
base64-bytestring-1.0.0.1: copy/register
case-insensitive-1.2.0.6: build
directory-tree-0.12.0: configure
fail-4.9.0.0: download
directory-tree-0.12.0: build
extensible-exceptions-0.1.1.4: configure
map-syntax-0.2: download
adjunctions-4.3: copy/register
case-insensitive-1.2.0.6: copy/register
extensible-exceptions-0.1.1.4: build
fail-4.9.0.0: configure
extensible-exceptions-0.1.1.4: copy/register
blaze-builder-0.4.0.2: copy/register
directory-tree-0.12.0: copy/register
fail-4.9.0.0: build
map-syntax-0.2: configure
fail-4.9.0.0: copy/register
map-syntax-0.2: build
map-syntax-0.2: copy/register
kan-extensions-4.2.3: download
http-media-0.6.3: download
ghc-mtl-1.2.1.0: download
ghc-mtl-1.2.1.0: configure
blaze-markup-0.7.0.3: download
cassava-0.4.5.0: download
aeson-0.11.1.4: download
ghc-mtl-1.2.1.0: build
kan-extensions-4.2.3: configure
cookie-0.4.2: download
kan-extensions-4.2.3: build
http-media-0.6.3: configure
ghc-mtl-1.2.1.0: copy/register
http-media-0.6.3: build
cassava-0.4.5.0: configure
cassava-0.4.5.0: build
blaze-markup-0.7.0.3: configure
hint-0.4.3: download
blaze-markup-0.7.0.3: build
cookie-0.4.2: configure
cookie-0.4.2: build
aeson-0.11.1.4: configure
http-media-0.6.3: copy/register
http-types-0.9: download
aeson-0.11.1.4: build
double-conversion-2.0.1.0: configure
kan-extensions-4.2.3: copy/register
cookie-0.4.2: copy/register
double-conversion-2.0.1.0: build
hint-0.4.3: configure
memory-0.11: download
mime-types-0.1.0.7: download
hint-0.4.3: build
http-types-0.9: configure
http-types-0.9: build
memory-0.11: configure
memory-0.11: build
mime-types-0.1.0.7: configure
mime-types-0.1.0.7: build
blaze-markup-0.7.0.3: copy/register
http-types-0.9: copy/register
double-conversion-2.0.1.0: copy/register
mwc-random-0.13.4.0: download
mwc-random-0.13.4.0: configure
blaze-html-0.8.1.1: download
bytestring-conversion-0.3.1: download
hint-0.4.3: copy/register
mwc-random-0.13.4.0: build
blaze-html-0.8.1.1: configure
parallel-3.2.1.0: download
blaze-html-0.8.1.1: build
bytestring-conversion-0.3.1: configure
memory-0.11: copy/register
postgresql-libpq-0.9.1.1: download
bytestring-conversion-0.3.1: build
parallel-3.2.1.0: configure
mime-types-0.1.0.7: copy/register
parallel-3.2.1.0: build
postgresql-libpq-0.9.1.1: configure
pwstore-fast-2.4.4: download
parallel-3.2.1.0: copy/register
bytestring-conversion-0.3.1: copy/register
readable-0.3.1: download
reflection-2.1.2: download
postgresql-libpq-0.9.1.1: build
pwstore-fast-2.4.4: configure
pwstore-fast-2.4.4: build
readable-0.3.1: configure
readable-0.3.1: build
reflection-2.1.2: configure
pwstore-fast-2.4.4: copy/register
reflection-2.1.2: build
resource-pool-0.2.3.2: download
resource-pool-0.2.3.2: configure
readable-0.3.1: copy/register
securemem-0.1.9: download
resource-pool-0.2.3.2: build
securemem-0.1.9: configure
cassava-0.4.5.0: copy/register
securemem-0.1.9: build
postgresql-libpq-0.9.1.1: copy/register
setenv-0.1.1.3: download
setenv-0.1.1.3: configure
resource-pool-0.2.3.2: copy/register
securemem-0.1.9: copy/register
setenv-0.1.1.3: build
snap-loader-static-1.0.0.0: configure
skein-1.0.9.4: download
crypto-cipher-types-0.0.9: download
setenv-0.1.1.3: copy/register
reflection-2.1.2: copy/register
snap-loader-static-1.0.0.0: build
crypto-cipher-types-0.0.9: configure
crypto-random-0.0.9: download
lens-4.13: download
snap-loader-static-1.0.0.0: copy/register
crypto-cipher-types-0.0.9: build
skein-1.0.9.4: configure
blaze-html-0.8.1.1: copy/register
streaming-commons-0.1.15.4: download
skein-1.0.9.4: build
crypto-random-0.0.9: configure
string-conversions-0.4: download
crypto-cipher-types-0.0.9: copy/register
crypto-random-0.0.9: build
lens-4.13: configure
cipher-aes-0.2.11: download
crypto-random-0.0.9: copy/register
lens-4.13: build
streaming-commons-0.1.15.4: configure
system-filepath-0.4.13.4: download
skein-1.0.9.4: copy/register
streaming-commons-0.1.15.4: build
string-conversions-0.4: configure
time-locale-compat-0.1.1.1: download
string-conversions-0.4: build
cipher-aes-0.2.11: configure
string-conversions-0.4: copy/register
cipher-aes-0.2.11: build
system-filepath-0.4.13.4: configure
unexceptionalio-0.3.0: download
system-filepath-0.4.13.4: build
time-locale-compat-0.1.1.1: configure
time-locale-compat-0.1.1.1: build
unexceptionalio-0.3.0: configure
cipher-aes-0.2.11: copy/register
time-locale-compat-0.1.1.1: copy/register
cprng-aes-0.6.1: download
unexceptionalio-0.3.0: build
cprng-aes-0.6.1: configure
http-api-data-0.2.2: download
unexceptionalio-0.3.0: copy/register
cprng-aes-0.6.1: build
http-api-data-0.2.2: configure
errors-2.1.2: download
cprng-aes-0.6.1: copy/register
http-api-data-0.2.2: build
errors-2.1.2: configure
streaming-commons-0.1.15.4: copy/register
clientsession-0.9.1.1: download
errors-2.1.2: build
clientsession-0.9.1.1: configure
http-client-0.4.28: download
system-filepath-0.4.13.4: copy/register
clientsession-0.9.1.1: build
http-client-0.4.28: configure
errors-2.1.2: copy/register
http-client-0.4.28: build
uuid-types-1.0.3: download
uuid-types-1.0.3: configure
unix-compat-0.4.1.4: download
uuid-types-1.0.3: build
unix-compat-0.4.1.4: configure
clientsession-0.9.1.1: copy/register
unix-compat-0.4.1.4: build
http-api-data-0.2.2: copy/register
vault-0.3.0.6: download
vault-0.3.0.6: configure
xmlhtml-0.2.3.4: download
vault-0.3.0.6: build
xmlhtml-0.2.3.4: configure
unix-compat-0.4.1.4: copy/register
uuid-types-1.0.3: copy/register
xmlhtml-0.2.3.4: build
configurator-0.3.0.0: download
configurator-0.3.0.0: configure
zlib-bindings-0.1.1.5: download
vault-0.3.0.6: copy/register
configurator-0.3.0.0: build
zlib-bindings-0.1.1.5: configure
zlib-bindings-0.1.1.5: build
aeson-0.11.1.4: copy/register
servant-0.6.1: configure
postgresql-simple-0.5.1.3: download
zlib-bindings-0.1.1.5: copy/register
servant-0.6.1: build
postgresql-simple-0.5.1.3: configure
io-streams-1.3.5.0: download
http-client-0.4.28: copy/register
postgresql-simple-0.5.1.3: build
io-streams-1.3.5.0: configure
io-streams-1.3.5.0: build
api-afftrack-0.1.4.0: configure
api-afftrack-0.1.4.0: build
configurator-0.3.0.0: copy/register
servant-0.6.1: copy/register
api-hasoffers-0.1.2.0: configure
api-hasoffers-0.1.2.0: build
servant-blaze-0.6.1: configure
servant-blaze-0.6.1: build
api-afftrack-0.1.4.0: copy/register
servant-blaze-0.6.1: copy/register
io-streams-1.3.5.0: copy/register
api-hasoffers-0.1.2.0: copy/register
snap-core-1.0.0.0: configure
snap-core-1.0.0.0: build
io-streams-haproxy-1.0.0.0: configure
io-streams-haproxy-1.0.0.0: build
io-streams-haproxy-1.0.0.0: copy/register
mwc-random-0.13.4.0: copy/register
postgresql-simple-0.5.1.3: copy/register
xmlhtml-0.2.3.4: copy/register
heist-1.0.0.0: configure
heist-1.0.0.0: build
snap-core-1.0.0.0: copy/register
snap-server-1.0.0.0: configure
snap-server-1.0.0.0: build
snap-loader-dynamic-1.0.0.0: configure
snap-loader-dynamic-1.0.0.0: build
lens-4.13: copy/register
snap-loader-dynamic-1.0.0.0: copy/register
lens-aeson-1.0.0.5: download
lens-aeson-1.0.0.5: configure
lens-aeson-1.0.0.5: build
heist-1.0.0.0: copy/register
lens-aeson-1.0.0.5: copy/register
snap-server-1.0.0.0: copy/register
snap-1.0.0.0: configure
snap-1.0.0.0: build
snap-1.0.0.0: copy/register
servant-snap-0.6: configure
servant-snap-0.6: build
snaplet-postgresql-simple-1.0: configure
snaplet-postgresql-simple-1.0: build
snaplet-postgresql-simple-1.0: copy/register
servant-snap-0.6: copy/register
projectname: configure
projectname: build
Completed 73 action(s).

--  While building package projectname using:
      /home/netsu/.stack/setup-exe-cache/x86_64-linux-nix/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 --builddir=.stack-work/dist/x86_64-linux-nix/Cabal-1.22.5.0 build exe:projectname --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: projectname.log

    Configuring projectname...
    Preprocessing executable 'projectname' for projectname...
    [ 1 of 10] Compiling Types.Offer      ( src/Types/Offer.hs, .stack-work/dist/x86_64-linux-nix/Cabal-1.22.5.0/build/projectname/projectname-tmp/Types/Offer.o )
    [ 2 of 10] Compiling Types.Merchant   ( src/Types/Merchant.hs, .stack-work/dist/x86_64-linux-nix/Cabal-1.22.5.0/build/projectname/projectname-tmp/Types/Merchant.o )
    [ 3 of 10] Compiling Types.User       ( src/Types/User.hs, .stack-work/dist/x86_64-linux-nix/Cabal-1.22.5.0/build/projectname/projectname-tmp/Types/User.o )
    [ 4 of 10] Compiling Application      ( src/Application.hs, .stack-work/dist/x86_64-linux-nix/Cabal-1.22.5.0/build/projectname/projectname-tmp/Application.o )
    [ 5 of 10] Compiling Api              ( src/Api.hs, .stack-work/dist/x86_64-linux-nix/Cabal-1.22.5.0/build/projectname/projectname-tmp/Api.o )
    [ 6 of 10] Compiling Db               ( src/Db.hs, .stack-work/dist/x86_64-linux-nix/Cabal-1.22.5.0/build/projectname/projectname-tmp/Db.o )
    [ 7 of 10] Compiling Handlers.Common  ( src/Handlers/Common.hs, .stack-work/dist/x86_64-linux-nix/Cabal-1.22.5.0/build/projectname/projectname-tmp/Handlers/Common.o )
    [ 8 of 10] Compiling Handler          ( src/Handler.hs, .stack-work/dist/x86_64-linux-nix/Cabal-1.22.5.0/build/projectname/projectname-tmp/Handler.o )
    [ 9 of 10] Compiling Handlers.Merchant ( src/Handlers/Merchant.hs, .stack-work/dist/x86_64-linux-nix/Cabal-1.22.5.0/build/projectname/projectname-tmp/Handlers/Merchant.o )
    [10 of 10] Compiling Main             ( src/Main.hs, .stack-work/dist/x86_64-linux-nix/Cabal-1.22.5.0/build/projectname/projectname-tmp/Main.o )
    Linking .stack-work/dist/x86_64-linux-nix/Cabal-1.22.5.0/build/projectname/projectname ...
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `SSLerrmessage':
    (.text+0x38): undefined reference to `ERR_reason_error_string'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x394): undefined reference to `SSL_ctrl'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x3bf): undefined reference to `SSL_CTX_use_certificate_chain_file'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x3dc): undefined reference to `SSL_use_certificate_file'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x452): undefined reference to `ENGINE_by_id'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x46a): undefined reference to `ENGINE_init'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x485): undefined reference to `ENGINE_load_private_key'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x49d): undefined reference to `SSL_use_PrivateKey'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x4c2): undefined reference to `SSL_check_private_key'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x4cc): undefined reference to `ERR_get_error'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x5d2): undefined reference to `SSL_use_PrivateKey_file'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x5e0): undefined reference to `ERR_get_error'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x631): undefined reference to `SSL_CTX_load_verify_locations'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x646): undefined reference to `SSL_CTX_get_cert_store'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x698): undefined reference to `SSL_set_verify'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x6f9): undefined reference to `ERR_get_error'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x742): undefined reference to `ENGINE_finish'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x74e): undefined reference to `ENGINE_free'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x771): undefined reference to `ERR_get_error'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x814): undefined reference to `X509_STORE_load_locations'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x82a): undefined reference to `X509_STORE_set_flags'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x860): undefined reference to `ERR_get_error'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x8d1): undefined reference to `ERR_get_error'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x93b): undefined reference to `ERR_get_error'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x983): undefined reference to `ERR_get_error'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `verify_peer_name_matches_certificate_name':
    (.text+0x9d5): undefined reference to `ASN1_STRING_data'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `verify_peer_name_matches_certificate_name':
    (.text+0x9e0): undefined reference to `ASN1_STRING_length'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `my_sock_write':
    (.text+0xbc1): undefined reference to `BIO_clear_flags'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `my_sock_write':
    (.text+0xbf2): undefined reference to `BIO_set_flags'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `my_sock_read':
    (.text+0xc21): undefined reference to `BIO_clear_flags'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `my_sock_read':
    (.text+0xc52): undefined reference to `BIO_set_flags'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_read_pending':
    (.text+0xcfc): undefined reference to `SSL_pending'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_read':
    (.text+0xd47): undefined reference to `ERR_clear_error'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_read':
    (.text+0xd5a): undefined reference to `SSL_read'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_read':
    (.text+0xd6b): undefined reference to `SSL_get_error'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_read':
    (.text+0xda1): undefined reference to `ERR_get_error'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_write':
    (.text+0xf85): undefined reference to `ERR_clear_error'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_write':
    (.text+0xf97): undefined reference to `SSL_write'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_write':
    (.text+0xfa8): undefined reference to `SSL_get_error'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_write':
    (.text+0xfe1): undefined reference to `ERR_get_error'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_init':
    (.text+0x1206): undefined reference to `CRYPTO_get_id_callback'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_init':
    (.text+0x1214): undefined reference to `CRYPTO_get_locking_callback'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_init':
    (.text+0x1225): undefined reference to `CRYPTO_set_locking_callback'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_init':
    (.text+0x123a): undefined reference to `SSLv23_method'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_init':
    (.text+0x1242): undefined reference to `SSL_CTX_new'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_init':
    (.text+0x1266): undefined reference to `SSL_CTX_ctrl'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_init':
    (.text+0x127e): undefined reference to `SSL_CTX_ctrl'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_init':
    (.text+0x1293): undefined reference to `OPENSSL_config'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_init':
    (.text+0x1298): undefined reference to `SSL_library_init'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_init':
    (.text+0x129d): undefined reference to `SSL_load_error_strings'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_init':
    (.text+0x12b9): undefined reference to `CRYPTO_num_locks'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_init':
    (.text+0x12e4): undefined reference to `CRYPTO_num_locks'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_init':
    (.text+0x133f): undefined reference to `CRYPTO_set_id_callback'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_init':
    (.text+0x1349): undefined reference to `ERR_get_error'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_close':
    (.text+0x13a8): undefined reference to `SSL_shutdown'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_close':
    (.text+0x13b9): undefined reference to `SSL_free'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_close':
    (.text+0x13dc): undefined reference to `X509_free'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_close':
    (.text+0x13f8): undefined reference to `ENGINE_finish'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_close':
    (.text+0x1404): undefined reference to `ENGINE_free'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_close':
    (.text+0x1471): undefined reference to `CRYPTO_get_locking_callback'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_close':
    (.text+0x1482): undefined reference to `CRYPTO_get_id_callback'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_close':
    (.text+0x1495): undefined reference to `CRYPTO_set_id_callback'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_close':
    (.text+0x149e): undefined reference to `CRYPTO_set_locking_callback'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x14d3): undefined reference to `ERR_clear_error'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x14df): undefined reference to `SSL_connect'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x14f5): undefined reference to `SSL_get_peer_certificate'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x1583): undefined reference to `SSL_get_error'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x158b): undefined reference to `ERR_get_error'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x15e5): undefined reference to `X509_get_ext_d2i'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x15f9): undefined reference to `sk_num'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x1634): undefined reference to `sk_value'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x1695): undefined reference to `sk_free'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x16f4): undefined reference to `SSL_new'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x170d): undefined reference to `SSL_set_ex_data'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x171a): undefined reference to `ERR_get_error'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x1771): undefined reference to `ERR_get_error'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x1844): undefined reference to `sk_free'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x18a5): undefined reference to `sk_free'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x18b8): undefined reference to `X509_get_subject_name'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x18d6): undefined reference to `X509_NAME_get_index_by_NID'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x18f2): undefined reference to `X509_NAME_get_entry'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x18fa): undefined reference to `X509_NAME_ENTRY_get_data'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x19a5): undefined reference to `BIO_s_socket'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x1a41): undefined reference to `BIO_new'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x1a63): undefined reference to `SSL_set_bio'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x1a75): undefined reference to `BIO_int_ctrl'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x1b34): undefined reference to `ERR_put_error'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x1b4e): undefined reference to `X509_get_subject_name'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x1b66): undefined reference to `X509_NAME_get_index_by_NID'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `PQsslAttribute':
    (.text+0x1cbf): undefined reference to `SSL_get_version'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `PQsslAttribute':
    (.text+0x1cd4): undefined reference to `SSL_get_current_cipher'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `PQsslAttribute':
    (.text+0x1ce1): undefined reference to `SSL_CIPHER_get_bits'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `PQsslAttribute':
    (.text+0x1d14): undefined reference to `SSL_get_current_compression'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `PQsslAttribute':
    (.text+0x1d3c): undefined reference to `SSL_get_current_cipher'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `PQsslAttribute':
    (.text+0x1d44): undefined reference to `SSL_CIPHER_get_name'
    collect2: error: ld returned 1 exit status
 $

Main question is: is it really possible to setup stack to deal with nix, are they currently compatible, or it will be just wasting a time? Because following official guide not working, and binary dependencies not solved (actually packages installed into _nix_ project environment, so, maybe missed some paths, variables, or/and buildStackProject don't work properly).

That may well be a Cabal bug. It is responsible for invoking ghc. Try using Cabal-1.24 maybe? Or a more recent Cabal-1.22? This should just be a matter of updating what Cabal is in your global db, via the nix-pkgs route.

Main question is: is it really possible to setup stack to deal with nix, are they currently compatible, or it will be just wasting a time? Because following official guide not working, and binary dependencies not solved (actually packages installed into nix project environment, so, maybe missed some paths, variables, or/and buildStackProject don't work properly).

Sorry you've run into difficulties here.

The nix-pkgs folks have decided to change how things works, this may be what is now breaking the integration. Not sure, I'm actually not all that savvy with the nix of things. See https://github.com/commercialhaskell/stack/issues/2259

Stack has not yet adapted to these changes, and so if they have happened, then I think that now nix + stack support may be broken due to changes in nix-pkgs.

We would really like to have good support for nix in stack.

 $ nix-shell ./shell_stack.nix --pure --run "cabal --version"
cabal-install version 1.24.0.0
compiled using version 1.24.0.0 of the Cabal library 

Global cabal have same version.

cabal-install version doesn't matter. Stack uses Cabal, a library, not cabal-install (well except for --solver). Confusing naming, I know. Nothing we can do about that. I might start calling it Cabal-the-library again.

What's stack exec -- ghc-pkg describe Cabal say? Should say 1.22.5 which is an oldish 1.22

name: Cabal
version: 1.22.5.0
id: Cabal-1.22.5.0-9ea569737527320f512dad57b36ee312
key: Cabal_3ux67khMI118y6VpwrFnXN
license: BSD3
copyright: 2003-2006, Isaac Jones
           2005-2011, Duncan Coutts
maintainer: [email protected]
homepage: http://www.haskell.org/cabal/
synopsis: A framework for packaging Haskell software
description:
    The Haskell Common Architecture for Building Applications and
    Libraries: a framework defining a common interface for authors to more
    easily build their Haskell applications in a portable way.
    .
    The Haskell Cabal is part of a larger infrastructure for distributing,
    organizing, and cataloging Haskell libraries and tools.
category: Distribution
author: Isaac Jones <[email protected]>
        Duncan Coutts <[email protected]>
exposed: True
exposed-modules:
    Distribution.Compat.CreatePipe Distribution.Compat.Environment
    Distribution.Compat.Exception Distribution.Compat.ReadP
    Distribution.Compiler Distribution.InstalledPackageInfo
    Distribution.License Distribution.Make Distribution.ModuleName
    Distribution.Package Distribution.PackageDescription
    Distribution.PackageDescription.Check
    Distribution.PackageDescription.Configuration
    Distribution.PackageDescription.Parse
    Distribution.PackageDescription.PrettyPrint
    Distribution.PackageDescription.Utils Distribution.ParseUtils
    Distribution.ReadE Distribution.Simple Distribution.Simple.Bench
    Distribution.Simple.Build Distribution.Simple.Build.Macros
    Distribution.Simple.Build.PathsModule
    Distribution.Simple.BuildPaths Distribution.Simple.BuildTarget
    Distribution.Simple.CCompiler Distribution.Simple.Command
    Distribution.Simple.Compiler Distribution.Simple.Configure
    Distribution.Simple.GHC Distribution.Simple.GHCJS
    Distribution.Simple.Haddock Distribution.Simple.HaskellSuite
    Distribution.Simple.Hpc Distribution.Simple.Install
    Distribution.Simple.InstallDirs Distribution.Simple.JHC
    Distribution.Simple.LHC Distribution.Simple.LocalBuildInfo
    Distribution.Simple.PackageIndex Distribution.Simple.PreProcess
    Distribution.Simple.PreProcess.Unlit Distribution.Simple.Program
    Distribution.Simple.Program.Ar Distribution.Simple.Program.Builtin
    Distribution.Simple.Program.Db Distribution.Simple.Program.Find
    Distribution.Simple.Program.GHC Distribution.Simple.Program.HcPkg
    Distribution.Simple.Program.Hpc Distribution.Simple.Program.Ld
    Distribution.Simple.Program.Run Distribution.Simple.Program.Script
    Distribution.Simple.Program.Strip Distribution.Simple.Program.Types
    Distribution.Simple.Register Distribution.Simple.Setup
    Distribution.Simple.SrcDist Distribution.Simple.Test
    Distribution.Simple.Test.ExeV10 Distribution.Simple.Test.LibV09
    Distribution.Simple.Test.Log Distribution.Simple.UHC
    Distribution.Simple.UserHooks Distribution.Simple.Utils
    Distribution.System Distribution.TestSuite Distribution.Text
    Distribution.Utils.NubList Distribution.Verbosity
    Distribution.Version Language.Haskell.Extension
hidden-modules: Distribution.Compat.Binary
hidden-modules: Distribution.Compat.Binary
                Distribution.Compat.CopyFile Distribution.Compat.TempFile
                Distribution.GetOpt Distribution.Simple.GHC.Internal
                Distribution.Simple.GHC.IPI641 Distribution.Simple.GHC.IPI642
                Distribution.Simple.GHC.ImplInfo Paths_Cabal
trusted: False
import-dirs: /nix/store/6djmaps8h2a1n05wzmgf774gkk5x1dij-ghc-7.10.3/lib/ghc-7.10.3/Cabal_3ux67khMI118y6VpwrFnXN
library-dirs: /nix/store/6djmaps8h2a1n05wzmgf774gkk5x1dij-ghc-7.10.3/lib/ghc-7.10.3/Cabal_3ux67khMI118y6VpwrFnXN
data-dir: /nix/store/6djmaps8h2a1n05wzmgf774gkk5x1dij-ghc-7.10.3/share/x86_64-linux-ghc-7.10.3/Cabal-1.22.5.0
hs-libraries: HSCabal-1.22.5.0-3ux67khMI118y6VpwrFnXN
depends:
    array-0.5.1.0-960bf9ae8875cc30355e086f8853a049
    array-0.5.1.0-960bf9ae8875cc30355e086f8853a049
    base-4.8.2.0-0d6d1084fbc041e1cded9228e80e264d
    binary-0.7.5.0-5784fd031a720c3b84e73006e444c7ca
    bytestring-0.10.6.0-c60f4c543b22c7f7293a06ae48820437
    containers-0.5.6.2-e59c9b78d840fa743d4169d4bea15592
    deepseq-1.4.1.1-614b63b36dd6e29d2b35afff57c25311
    directory-1.2.2.0-f8e14a9d121b76a00a0f669ee724a732
    filepath-1.4.0.0-f97d1e4aebfd7a03be6980454fe31d6e
    pretty-1.1.2.0-5cc412214ea63f61ee84c4fbabdbe0ec
    process-1.2.3.0-78f206acb2330ea8066c6c19c87356f0
    time-1.5.0.1-edbd1a50e7922b396ada189ab8e8523b
    unix-2.7.1.0-343d4f566f30113da92e819f4a148640
haddock-interfaces: /nix/store/njpvjbbmkda5f87jq79228f1cyngmb21-ghc-7.10.3-doc/share/doc/ghc/html/libraries/Cabal-1.22.5.0/Cabal.haddock
haddock-html: /nix/store/njpvjbbmkda5f87jq79228f1cyngmb21-ghc-7.10.3-doc/share/doc/ghc/html/libraries/Cabal-1.22.5.0
pkgroot: "/nix/store/xanzixy20nx7c47gpgx4wiqfd6pspccv-ghc-7.10.3/lib/ghc-7.10.3"

So I should switch to newer ghc version (according to description, seems like, cabal-the-library is part of ghc package). Correct me, if I'm wrong, please.

nix-repl> haskell.compiler.ghc7
haskell.compiler.ghc704        haskell.compiler.ghc7103       haskell.compiler.ghc742Binary  haskell.compiler.ghc784
haskell.compiler.ghc704Binary  haskell.compiler.ghc722        haskell.compiler.ghc763        
haskell.compiler.ghc7102       haskell.compiler.ghc742        haskell.compiler.ghc783        

UPD: checked new Cabal with same ghc bellow. No success.

Same error with ghc-7.10.2 and Cabal version: 1.22.4.0.

Same error with ghc-7.10.3 and Cabal version: 1.24.0.0.

-> % stack exec -- ghc-pkg describe Cabal
name: Cabal
version: 1.24.0.0
id: Cabal-1.24.0.0-2XFzyREsK5Z2I1PJ8zLYMA
key: 2XFzyREsK5Z2I1PJ8zLYMA
license: BSD3
copyright: 2003-2006, Isaac Jones
           2005-2011, Duncan Coutts
maintainer: [email protected]
homepage: http://www.haskell.org/cabal/
synopsis: A framework for packaging Haskell software
description:
    The Haskell Common Architecture for Building Applications and
    Libraries: a framework defining a common interface for authors to more
    easily build their Haskell applications in a portable way.
    .
    The Haskell Cabal is part of a larger infrastructure for distributing,
    organizing, and cataloging Haskell libraries and tools.
category: Distribution
author: Isaac Jones <[email protected]>
        Duncan Coutts <[email protected]>
exposed: True
exposed-modules:
    Distribution.Compat.CreatePipe Distribution.Compat.Environment
    Distribution.Compat.Exception Distribution.Compat.Internal.TempFile
    Distribution.Compat.ReadP Distribution.Compat.Semigroup
    Distribution.Compiler Distribution.InstalledPackageInfo
    Distribution.License Distribution.Make Distribution.ModuleName
    Distribution.Package Distribution.PackageDescription
    Distribution.PackageDescription.Check
    Distribution.PackageDescription.Configuration
    Distribution.PackageDescription.Parse
    Distribution.PackageDescription.PrettyPrint
    Distribution.PackageDescription.Utils Distribution.ParseUtils
    Distribution.ReadE Distribution.Simple Distribution.Simple.Bench
    Distribution.Simple.Build Distribution.Simple.Build.Macros
    Distribution.Simple.Build.PathsModule
    Distribution.Simple.BuildPaths Distribution.Simple.BuildTarget
    Distribution.Simple.CCompiler Distribution.Simple.Command
    Distribution.Simple.Compiler Distribution.Simple.Configure
    Distribution.Simple.GHC Distribution.Simple.GHCJS
    Distribution.Simple.Haddock Distribution.Simple.HaskellSuite
    Distribution.Simple.Hpc Distribution.Simple.Install
    Distribution.Simple.InstallDirs Distribution.Simple.JHC
    Distribution.Simple.LHC Distribution.Simple.LocalBuildInfo
    Distribution.Simple.PackageIndex Distribution.Simple.PreProcess
    Distribution.Simple.PreProcess.Unlit Distribution.Simple.Program
    Distribution.Simple.Program.Ar Distribution.Simple.Program.Builtin
    Distribution.Simple.Program.Db Distribution.Simple.Program.Find
    Distribution.Simple.Program.GHC Distribution.Simple.Program.HcPkg
    Distribution.Simple.Program.Hpc
    Distribution.Simple.Program.Internal Distribution.Simple.Program.Ld
    Distribution.Simple.Program.Run Distribution.Simple.Program.Script
    Distribution.Simple.Program.Strip Distribution.Simple.Program.Types
    Distribution.Simple.Register Distribution.Simple.Setup
    Distribution.Simple.SrcDist Distribution.Simple.Test
    Distribution.Simple.Test.ExeV10 Distribution.Simple.Test.LibV09
    Distribution.Simple.Test.Log Distribution.Simple.UHC
    Distribution.Simple.UserHooks Distribution.Simple.Utils
    Distribution.System Distribution.TestSuite Distribution.Text
    Distribution.Utils.NubList Distribution.Verbosity
    Distribution.Version Language.Haskell.Extension
    Distribution.Compat.Binary
hidden-modules: Distribution.Compat.CopyFile
                Distribution.Compat.GetShortPathName Distribution.Compat.MonadFail
                Distribution.GetOpt Distribution.Lex
                Distribution.Simple.GHC.Internal Distribution.Simple.GHC.IPI642
                Distribution.Simple.GHC.IPIConvert Distribution.Simple.GHC.ImplInfo
                Paths_Cabal
trusted: False
import-dirs: /nix/store/qcnfsm5fa0nj3716ycwk9ay7k7w6d1v0-Cabal-1.24.0.0/lib/ghc-7.10.3/Cabal-1.24.0.0
library-dirs: /nix/store/qcnfsm5fa0nj3716ycwk9ay7k7w6d1v0-Cabal-1.24.0.0/lib/ghc-7.10.3/Cabal-1.24.0.0
data-dir: /nix/store/qcnfsm5fa0nj3716ycwk9ay7k7w6d1v0-Cabal-1.24.0.0/share/x86_64-linux-ghc-7.10.3/Cabal-1.24.0.0
hs-libraries: HSCabal-1.24.0.0-2XFzyREsK5Z2I1PJ8zLYMA
depends:
    array-0.5.1.0-960bf9ae8875cc30355e086f8853a049
    base-4.8.2.0-0d6d1084fbc041e1cded9228e80e264d
    binary-0.7.5.0-5784fd031a720c3b84e73006e444c7ca
    bytestring-0.10.6.0-c60f4c543b22c7f7293a06ae48820437
    containers-0.5.6.2-e59c9b78d840fa743d4169d4bea15592
    deepseq-1.4.1.1-614b63b36dd6e29d2b35afff57c25311
    directory-1.2.2.0-f8e14a9d121b76a00a0f669ee724a732
    filepath-1.4.0.0-f97d1e4aebfd7a03be6980454fe31d6e
    pretty-1.1.2.0-5cc412214ea63f61ee84c4fbabdbe0ec
    process-1.2.3.0-78f206acb2330ea8066c6c19c87356f0
    time-1.5.0.1-edbd1a50e7922b396ada189ab8e8523b
    unix-2.7.1.0-343d4f566f30113da92e819f4a148640
haddock-interfaces: /nix/store/qcnfsm5fa0nj3716ycwk9ay7k7w6d1v0-Cabal-1.24.0.0/share/doc/x86_64-linux-ghc-7.10.3/Cabal-1.24.0.0/html/Cabal.haddock
haddock-html: /nix/store/qcnfsm5fa0nj3716ycwk9ay7k7w6d1v0-Cabal-1.24.0.0/share/doc/x86_64-linux-ghc-7.10.3/Cabal-1.24.0.0/html
pkgroot: "/nix/store/8hl94ypa9pc8n8vzw35hmrcnimpvkcxx-ghc-7.10.3/lib/ghc-7.10.3"
---
name: Cabal
version: 1.22.5.0
id: Cabal-1.22.5.0-9ea569737527320f512dad57b36ee312
key: Cabal_3ux67khMI118y6VpwrFnXN
license: BSD3
copyright: 2003-2006, Isaac Jones
           2005-2011, Duncan Coutts
maintainer: [email protected]
homepage: http://www.haskell.org/cabal/
synopsis: A framework for packaging Haskell software
description:
    The Haskell Common Architecture for Building Applications and
    Libraries: a framework defining a common interface for authors to more
    easily build their Haskell applications in a portable way.
    .
    The Haskell Cabal is part of a larger infrastructure for distributing,
    organizing, and cataloging Haskell libraries and tools.
category: Distribution
author: Isaac Jones <[email protected]>
        Duncan Coutts <[email protected]>
exposed: True
exposed-modules:
    Distribution.Compat.CreatePipe Distribution.Compat.Environment
    Distribution.Compat.Exception Distribution.Compat.ReadP
    Distribution.Compiler Distribution.InstalledPackageInfo
    Distribution.License Distribution.Make Distribution.ModuleName
    Distribution.Package Distribution.PackageDescription
    Distribution.PackageDescription.Check
    Distribution.PackageDescription.Configuration
    Distribution.PackageDescription.Parse
    Distribution.PackageDescription.PrettyPrint
    Distribution.PackageDescription.Utils Distribution.ParseUtils
    Distribution.ReadE Distribution.Simple Distribution.Simple.Bench
    Distribution.Simple.Build Distribution.Simple.Build.Macros
    Distribution.Simple.Build.PathsModule
    Distribution.Simple.BuildPaths Distribution.Simple.BuildTarget
    Distribution.Simple.CCompiler Distribution.Simple.Command
    Distribution.Simple.Compiler Distribution.Simple.Configure
    Distribution.Simple.GHC Distribution.Simple.GHCJS
    Distribution.Simple.Haddock Distribution.Simple.HaskellSuite
    Distribution.Simple.Hpc Distribution.Simple.Install
    Distribution.Simple.InstallDirs Distribution.Simple.JHC
    Distribution.Simple.LHC Distribution.Simple.LocalBuildInfo
    Distribution.Simple.PackageIndex Distribution.Simple.PreProcess
    Distribution.Simple.PreProcess.Unlit Distribution.Simple.Program
    Distribution.Simple.Program.Ar Distribution.Simple.Program.Builtin
    Distribution.Simple.Program.Db Distribution.Simple.Program.Find
    Distribution.Simple.Program.GHC Distribution.Simple.Program.HcPkg
    Distribution.Simple.Program.Hpc Distribution.Simple.Program.Ld
    Distribution.Simple.Program.Run Distribution.Simple.Program.Script
    Distribution.Simple.Program.Strip Distribution.Simple.Program.Types
    Distribution.Simple.Register Distribution.Simple.Setup
    Distribution.Simple.SrcDist Distribution.Simple.Test
    Distribution.Simple.Test.ExeV10 Distribution.Simple.Test.LibV09
    Distribution.Simple.Test.Log Distribution.Simple.UHC
    Distribution.Simple.UserHooks Distribution.Simple.Utils
    Distribution.System Distribution.TestSuite Distribution.Text
    Distribution.Utils.NubList Distribution.Verbosity
    Distribution.Version Language.Haskell.Extension
hidden-modules: Distribution.Compat.Binary
                Distribution.Compat.CopyFile Distribution.Compat.TempFile
                Distribution.GetOpt Distribution.Simple.GHC.Internal
                Distribution.Simple.GHC.IPI641 Distribution.Simple.GHC.IPI642
                Distribution.Simple.GHC.ImplInfo Paths_Cabal
trusted: False
import-dirs: /nix/store/6djmaps8h2a1n05wzmgf774gkk5x1dij-ghc-7.10.3/lib/ghc-7.10.3/Cabal_3ux67khMI118y6VpwrFnXN
library-dirs: /nix/store/6djmaps8h2a1n05wzmgf774gkk5x1dij-ghc-7.10.3/lib/ghc-7.10.3/Cabal_3ux67khMI118y6VpwrFnXN
data-dir: /nix/store/6djmaps8h2a1n05wzmgf774gkk5x1dij-ghc-7.10.3/share/x86_64-linux-ghc-7.10.3/Cabal-1.22.5.0
hs-libraries: HSCabal-1.22.5.0-3ux67khMI118y6VpwrFnXN
depends:
    array-0.5.1.0-960bf9ae8875cc30355e086f8853a049
    base-4.8.2.0-0d6d1084fbc041e1cded9228e80e264d
    binary-0.7.5.0-5784fd031a720c3b84e73006e444c7ca
    bytestring-0.10.6.0-c60f4c543b22c7f7293a06ae48820437
    containers-0.5.6.2-e59c9b78d840fa743d4169d4bea15592
    deepseq-1.4.1.1-614b63b36dd6e29d2b35afff57c25311
    directory-1.2.2.0-f8e14a9d121b76a00a0f669ee724a732
    filepath-1.4.0.0-f97d1e4aebfd7a03be6980454fe31d6e
    pretty-1.1.2.0-5cc412214ea63f61ee84c4fbabdbe0ec
    process-1.2.3.0-78f206acb2330ea8066c6c19c87356f0
    time-1.5.0.1-edbd1a50e7922b396ada189ab8e8523b
    unix-2.7.1.0-343d4f566f30113da92e819f4a148640
haddock-interfaces: /nix/store/njpvjbbmkda5f87jq79228f1cyngmb21-ghc-7.10.3-doc/share/doc/ghc/html/libraries/Cabal-1.22.5.0/Cabal.haddock
haddock-html: /nix/store/njpvjbbmkda5f87jq79228f1cyngmb21-ghc-7.10.3-doc/share/doc/ghc/html/libraries/Cabal-1.22.5.0
pkgroot: "/nix/store/8hl94ypa9pc8n8vzw35hmrcnimpvkcxx-ghc-7.10.3/lib/ghc-7.10.3"

UPD: seems like I leave cabal 1.22.5.0 in core packages, and it's not so easy to override them https://github.com/NixOS/nixpkgs/issues/3822

Thanks for investigating this and posting your progress! It does indeed look like 1.22.5.0 is still in your global packages.

There's a better way to test what's actually being used. The cabal version being used is used as the name of the compiled Setup.hs. So for example, from your output earlier:

--  While building package projectname using:
      /home/netsu/.stack/setup-exe-cache/x86_64-linux-nix/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 --builddir=.stack-work/dist/x86_64-linux-nix/Cabal-1.22.5.0 build exe:projectname --ghc-options " -ddump-hi -ddump-to-file"

1.22.5.0 is a substring. The -v build will have such paths.

in your global packages.

No, I'm sure, that it's part of packages in nix development environment, see: https://github.com/NixOS/nixpkgs/blob/8d86c8274f8cf31d096763839346388c20ce29a2/pkgs/development/haskell-modules/configuration-lts-5.15.nix#L7

Because I have override part of lts packages, but "Cabal the library" is part of ghc package here. Not sure how to override it yet (but sure that's possible).

Actually looking harder at that error message, it probably means that /home/netsu/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 doesn't exist. This doesn't make any sense, though, as we check for it and build otherwise: https://github.com/commercialhaskell/stack/blob/7f7f1a5f67f4ecdd1f3009495f1ff101dd38047e/src/Stack/Build/Execute.hs#L255

yep,

 $ ls /home/netsu/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3
ls: cannot access '/home/netsu/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3': No such file or directory

But:

 $ ls /home/netsu/.stack/setup-exe-cache/x86_64-linux-nix/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3
/home/netsu/.stack/setup-exe-cache/x86_64-linux-nix/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3

And this error, as I wrote above, fixed by erasing ~/.stack. So currently this error block me:

Linking .stack-work/dist/x86_64-linux-nix/Cabal-1.22.5.0/build/projectname/projectname ...
/nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `SSLerrmessage':

Same error with lts-6_3 and Cabal-1.22.5.0. All successfully have build, but main project building throw linking errors.

Adding postgresql-simple to nix packages did not help.

I am also having this problem on nixos-unstable.

This is my version of the error:

[kyle@braavos:~/repos/grove/server]$ stack build
No packages found in snapshot which provide a "hsc2hs" executable, which is a build-tool dependency of "NetSNMP"
Missing build-tools may be caused by dependencies of the build-tool being overridden by extra-deps.
This should be fixed soon - see this issue https://github.com/commercialhaskell/stack/issues/595

animus-0.0.0: build

--  While building package animus-0.0.0 using:
      /home/kyle/.stack/setup-exe-cache/x86_64-linux-nix/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 --builddir=.stack-work/dist/x86_64-linux-nix/Cabal-1.22.5.0 build lib:animus exe:animus --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/kyle/repos/grove/server/.stack-work/logs/animus-0.0.0.log

    Preprocessing library animus-0.0.0...
    In-place registering animus-0.0.0...
    Preprocessing executable 'animus' for animus-0.0.0...
    Linking .stack-work/dist/x86_64-linux-nix/Cabal-1.22.5.0/build/animus/animus ...
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x394): undefined reference to `SSL_ctrl'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x3bf): undefined reference to `SSL_CTX_use_certificate_chain_file'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x3dc): undefined reference to `SSL_use_certificate_file'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x49d): undefined reference to `SSL_use_PrivateKey'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x4c2): undefined reference to `SSL_check_private_key'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x5d2): undefined reference to `SSL_use_PrivateKey_file'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x631): undefined reference to `SSL_CTX_load_verify_locations'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x646): undefined reference to `SSL_CTX_get_cert_store'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `initialize_SSL':
    (.text+0x698): undefined reference to `SSL_set_verify'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_read_pending':
    (.text+0xcfc): undefined reference to `SSL_pending'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_read':
    (.text+0xd5a): undefined reference to `SSL_read'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_read':
    (.text+0xd6b): undefined reference to `SSL_get_error'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_write':
    (.text+0xf97): undefined reference to `SSL_write'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_write':
    (.text+0xfa8): undefined reference to `SSL_get_error'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_init':
    (.text+0x123a): undefined reference to `SSLv23_method'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_init':
    (.text+0x1242): undefined reference to `SSL_CTX_new'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_init':
    (.text+0x1266): undefined reference to `SSL_CTX_ctrl'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_init':
    (.text+0x127e): undefined reference to `SSL_CTX_ctrl'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_init':
    (.text+0x1298): undefined reference to `SSL_library_init'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_init':
    (.text+0x129d): undefined reference to `SSL_load_error_strings'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_close':
    (.text+0x13a8): undefined reference to `SSL_shutdown'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_close':
    (.text+0x13b9): undefined reference to `SSL_free'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x14df): undefined reference to `SSL_connect'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x14f5): undefined reference to `SSL_get_peer_certificate'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x1583): undefined reference to `SSL_get_error'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x16f4): undefined reference to `SSL_new'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x170d): undefined reference to `SSL_set_ex_data'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `pgtls_open_client':
    (.text+0x1a63): undefined reference to `SSL_set_bio'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `PQsslAttribute':
    (.text+0x1cbf): undefined reference to `SSL_get_version'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `PQsslAttribute':
    (.text+0x1cd4): undefined reference to `SSL_get_current_cipher'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `PQsslAttribute':
    (.text+0x1ce1): undefined reference to `SSL_CIPHER_get_bits'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `PQsslAttribute':
    (.text+0x1d14): undefined reference to `SSL_get_current_compression'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `PQsslAttribute':
    (.text+0x1d3c): undefined reference to `SSL_get_current_cipher'
    /nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function `PQsslAttribute':
    (.text+0x1d44): undefined reference to `SSL_CIPHER_get_name'
    collect2: error: ld returned 1 exit status

These are the files that led to the above error:

shell.nix

with import <nixpkgs> { };

haskell.lib.buildStackProject {
  name = "hello-example";
  ghc = haskell.packages.ghc7103.ghc;
  shellHook = "export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt";
  buildInputs =
    [ git
      net_snmp
      zlib
      postgresql
      libressl
      openssl ];
}

stack.yaml

# This file was automatically generated by stack init
# For more information, see: http://docs.haskellstack.org/en/stable/yaml_configuration/

# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2)
resolver: lts-6.1

nix:
  enable: true
  shell-file: shell.nix

# Local packages, usually specified by relative directory name
packages:
  - '../logos'
  - './opus'
  - './animus'
  # - '../../siphon'
  # - '../../pipes-protolude'
  # - '../../vinyl-ecosystem/vinyl-plus'
  # - '../../vinyl-ecosystem/vinyl-operational'
  # - '../../vinyl-ecosystem/operational-extra'
  - location:
      git:    'https://github.com/layer-3-communications/siphon'
      commit: 'b3140468e947d884bc2034cc0cbe00f7cd7152d3'
    extra-dep: true
  - location:
      git:    'https://github.com/mckeankylej/pipes-protolude'
      commit: '4daa355a7d17fe96e3a6ace399b709ec28b256a8'
    extra-dep: true
  - location:
      git:    'https://github.com/andrewthad/bloodhound'
      commit: '20c6f0409782ad0f0e0122beea724b971dca6483'
    extra-dep: true
  - location:
      git:    'https://github.com/andrewthad/word-vector'
      commit: '5eb30eda4533d217e70349caad4aeddf19e68c79'
    extra-dep: true
  - location:
      git:    'https://github.com/andrewthad/pringletons'
      commit: '84330ed6cc147d86779711da984ffe1451e0b778'
    extra-dep: true
  - location:
      git:    'https://github.com/andrewthad/finite-domain-function'
      commit: 'a72f51694889fee05cc699c946a3878fd1865bb0'
    extra-dep: true
  - location:
      git:    'https://github.com/andrewthad/serpentine'
      commit: '4662f61492b0495b0def074b13ab5458bb74f273'
    extra-dep: true
  - location:
      git:    'https://github.com/andrewthad/singletons'
      commit: 'f1749c5597eb38a37da5701ba1831f128feb32eb'
    extra-dep: true
  - location:
      git:    'https://github.com/jjohnson382/yesod-bootstrap'
      commit: '9000dabd332559469f6cf62449fe11864f7951dd'
  - location:
      git: 'https://github.com/mckeankylej/netsnmp'
      commit: '763a69fed2741e8649f14df9a594b1a7dfb32bc1'
    extra-dep: true
  - location:
      git: 'https://github.com/andrewthad/yesod-markdown'
      commit: '42fa7f525045cf41cf89bd9e3c93bcef6eef10e6'
    extra-dep: true
  - location:
      git: 'https://github.com/andrewthad/yesod-ip'
      commit: '957110f14a09758c18393cdfb65831e1052fa59c'
    extra-dep: true

# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
extra-deps:
  - 'operational-extra-0.4'
  - 'vinyl-plus-0.1.1'
  - 'vinyl-operational-0.1.1'
  - 'yaml-0.8.17.1'
  - 'yesod-crud-persist-0.3'
  - 'yesod-table-2.0.3'
  # - 'yesod-ip-0.4'
  - 'container-builder-0.1'
  - 'pipes-text-0.0.2.4'
  # - 'reflex-0.4.0'
  # - 'ref-tf-0.4'
  # - 'servant-0.5'
  # - 'servant-server-0.5'
  # - 'servant-lucid-0.5'
  # - 'transformers-0.5.1.0'
  # - 'transformers-compat-0.5.1.4'
  # - 'comonad-5'
  - 'ip-0.8.4'
  # - 'yesod-ip-0.5.0'

# Override default flag values for local packages and extra-deps
flags: {}

# Extra package databases containing global packages
extra-package-dbs: []

As of recent nixpkgs (28.08.2016) issue can be solved by using postgresql.lib output in buildInputs instead of postgresql. So this looks like nix-side problem.

@danbst I just got a PR accepted in nixpkgs: https://github.com/NixOS/nixpkgs/pull/18087
No distinction between .lib, .dev is normally needed any longer. A good thing because that was becoming _really_ error-prone. The relevant nix functions are called so you only need to give the package names.
Wait for it to reach nixpkgs-unstable, or you may clone nixpkgs master and use --nix-path nixpkgs=dir/of/the/clone if you want it now.

@mckeankylej I checked and this fixed the (.text+0x394): undefined reference toSSL_ctrl'
/nix/store/ijg4jvw58bjis69mdsc85y4c88rcmv3f-postgresql-9.5.3/lib/libpq.a(fe-secure-openssl.o): In function initialize_SSL': errors you were having

You guys may try it and I close the issue.
Note that if you used packages: in stack.yaml instead of a custom shell.nix file, this behaviour was already there in stack master.

@danbst and @YPares fixes work I suggest closing this issue.

Awesome! Closing the issue. Feel to reopen if in error.

For future reference (me): streamingProcess: runInteractiveProcess: exec: does not exist usually means it called an executable that failed to run since dynamic libraries weren't there, meaning you ran nix-collect-garbage.

+1 to @domenkozar, and additionally:

The quick workaround is

rm -r ~/.stack/setup-exe-cache

What if that doesn't help? I am pretty sure I did run --collect-garbage. But the removal of that folder did not help.

Amazingly, what worked for me was something I should have tried way before reaching the bottom of this thread ... stack clean; then stack build worked.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

abhinav picture abhinav  路  4Comments

Cosmius picture Cosmius  路  3Comments

cybaj picture cybaj  路  3Comments

mgsloan picture mgsloan  路  3Comments

tinkyholloway picture tinkyholloway  路  4Comments