{"action":"created","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/15995","repository_url":"https://api.github.com/repos/NixOS/nixpkgs","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/15995/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/15995/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/15995/events","html_url":"https://github.com/NixOS/nixpkgs/issues/15995","id":158550614,"number":15995,"title":"Haskell/Stack: terminfo library cannot be built because of missing ncurses","user":{"login":"fmthoma","id":5918766,"avatar_url":"https://avatars.githubusercontent.com/u/5918766?v=3","gravatar_id":"","url":"https://api.github.com/users/fmthoma","html_url":"https://github.com/fmthoma","followers_url":"https://api.github.com/users/fmthoma/followers","following_url":"https://api.github.com/users/fmthoma/following{/other_user}","gists_url":"https://api.github.com/users/fmthoma/gists{/gist_id}","starred_url":"https://api.github.com/users/fmthoma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmthoma/subscriptions","organizations_url":"https://api.github.com/users/fmthoma/orgs","repos_url":"https://api.github.com/users/fmthoma/repos","events_url":"https://api.github.com/users/fmthoma/events{/privacy}","received_events_url":"https://api.github.com/users/fmthoma/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/0.kind:%20question","name":"0.kind: question","color":"84b6eb"},{"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/6.topic:%20haskell","name":"6.topic: haskell","color":"fef2c0"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-06-05T11:46:32Z","updated_at":"2016-06-08T09:29:20Z","closed_at":"2016-06-07T22:27:33Z","body":"## Issue description\r\n\r\nWhen building a haskell project depending on the `terminfo` library (possibly through other libraries like `vty`) using `stack --nix`, the build fails since the `ncurses` library cannot be found during the configure phase of `terminfo`. Adding\r\n```yaml\r\nnix:\r\n  packages: [ncurses]\r\n```\r\nto `stack.yaml` remedies the problem, however this is a very ad-hoc solution. The problem also already occurred for ghc (#2969, #5616) and others (https://github.com/ekmett/wl-pprint-terminfo/issues/7).\r\n\r\n### Steps to reproduce\r\n\r\n* Start with a clean stack environment (`mv ~/.stack ~/.stack.bkup`)\r\n* Set up a new stack/cabal project (`stack new foo`)\r\n* Make the project depend on `terminfo` by adding in your foo.cabal:\r\n\r\n    ```\r\n    [...]\r\n    executable foo-exe\r\n      hs-source-dirs:      app\r\n      main-is:             Main.hs\r\n      ghc-options:         -threaded -rtsopts -with-rtsopts=-N\r\n      build-depends:       base\r\n                         , terminfo -- <- add this line\r\n                         , foo\r\n      default-language:    Haskell2010\r\n    [...]\r\n    ```\r\n* `stack --nix build`\r\n\r\nResult:\r\n```\r\nterminfo-0.4.0.2: download\r\nterminfo-0.4.0.2: configure\r\nProgress: 1/2\r\n--  While building package terminfo-0.4.0.2 using:\r\n      /run/user/1000/stack13135/terminfo-0.4.0.2/.stack-work/dist/x86_64-linux-nix/Cabal-1.22.5.0/setup/setup --builddir=.stack-work/dist/x86_64-linux-nix/Cabal-1.22.5.0 configure --with-ghc=/nix/store/n962p1idgzh07wvhxam5r6icv894kj61-ghc-7.10.3/bin/ghc --with-ghc-pkg=/nix/store/n962p1idgzh07wvhxam5r6icv894kj61-ghc-7.10.3/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/fthoma/.stack/snapshots/x86_64-linux-nix/lts-5.0/7.10.3/pkgdb --libdir=/home/fthoma/.stack/snapshots/x86_64-linux-nix/lts-5.0/7.10.3/lib --bindir=/home/fthoma/.stack/snapshots/x86_64-linux-nix/lts-5.0/7.10.3/bin --datadir=/home/fthoma/.stack/snapshots/x86_64-linux-nix/lts-5.0/7.10.3/share --libexecdir=/home/fthoma/.stack/snapshots/x86_64-linux-nix/lts-5.0/7.10.3/libexec --sysconfdir=/home/fthoma/.stack/snapshots/x86_64-linux-nix/lts-5.0/7.10.3/etc --docdir=/home/fthoma/.stack/snapshots/x86_64-linux-nix/lts-5.0/7.10.3/doc/terminfo-0.4.0.2 --htmldir=/home/fthoma/.stack/snapshots/x86_64-linux-nix/lts-5.0/7.10.3/doc/terminfo-0.4.0.2 --haddockdir=/home/fthoma/.stack/snapshots/x86_64-linux-nix/lts-5.0/7.10.3/doc/terminfo-0.4.0.2 --dependency=base=base-4.8.2.0-0d6d1084fbc041e1cded9228e80e264d --extra-include-dirs=/nix/store/n962p1idgzh07wvhxam5r6icv894kj61-ghc-7.10.3/include --extra-lib-dirs=/nix/store/n962p1idgzh07wvhxam5r6icv894kj61-ghc-7.10.3/lib\r\n    Process exited with code: ExitFailure 1\r\n    Logs have been written to: /home/fthoma/projects/foo/.stack-work/logs/terminfo-0.4.0.2.log\r\n\r\n    [1 of 1] Compiling Main             ( /run/user/1000/stack13135/terminfo-0.4.0.2/Setup.lhs, /run/user/1000/stack13135/terminfo-0.4.0.2/.stack-work/dist/x86_64-linux-nix/Cabal-1.22.5.0/setup/Main.o )\r\n    Linking /run/user/1000/stack13135/terminfo-0.4.0.2/.stack-work/dist/x86_64-linux-nix/Cabal-1.22.5.0/setup/setup ...\r\n    Configuring terminfo-0.4.0.2...\r\n    configure: WARNING: unrecognized options: --with-compiler, --with-gcc\r\n    checking for gcc... gcc\r\n    checking whether the C compiler works... yes\r\n    checking for C compiler default output file name... a.out\r\n    checking for suffix of executables... \r\n    checking whether we are cross compiling... no\r\n    checking for suffix of object files... o\r\n    checking whether we are using the GNU C compiler... yes\r\n    checking whether gcc accepts -g... yes\r\n    checking for gcc option to accept ISO C89... none needed\r\n    checking how to run the C preprocessor... gcc -E\r\n    checking for grep that handles long lines and -e... /nix/store/dp6c8mcsashywfkppdzic3l1qz4n9paq-gnugrep-2.22/bin/grep\r\n    checking for egrep... /nix/store/dp6c8mcsashywfkppdzic3l1qz4n9paq-gnugrep-2.22/bin/grep -E\r\n    checking for ANSI C header files... yes\r\n    checking for sys/types.h... yes\r\n    checking for sys/stat.h... yes\r\n    checking for stdlib.h... yes\r\n    checking for string.h... yes\r\n    checking for memory.h... yes\r\n    checking for strings.h... yes\r\n    checking for inttypes.h... yes\r\n    checking for stdint.h... yes\r\n    checking for unistd.h... yes\r\n    checking ncurses.h usability... no\r\n    checking ncurses.h presence... no\r\n    checking for ncurses.h... no\r\n    checking curses.h usability... no\r\n    checking curses.h presence... no\r\n    checking for curses.h... no\r\n    configure: error: in `/run/user/1000/stack13135/terminfo-0.4.0.2':\r\n    configure: error: curses headers could not be found, so this package cannot be built\r\n    See `config.log' for more details\r\n```\r\n\r\n## Technical details\r\n\r\n* System: NixOS 16.03.886.0068260 (Emu)\r\n* Nix version: nix-env (Nix) 1.11.2\r\n* Nixpkgs version: 16.03.886.0068260\r\n* Stackage: tried with LTS-5.0 through LTS-5.9"},"comment":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/comments/224537343","html_url":"https://github.com/NixOS/nixpkgs/issues/15995#issuecomment-224537343","issue_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/15995","id":224537343,"user":{"login":"fmthoma","id":5918766,"avatar_url":"https://avatars.githubusercontent.com/u/5918766?v=3","gravatar_id":"","url":"https://api.github.com/users/fmthoma","html_url":"https://github.com/fmthoma","followers_url":"https://api.github.com/users/fmthoma/followers","following_url":"https://api.github.com/users/fmthoma/following{/other_user}","gists_url":"https://api.github.com/users/fmthoma/gists{/gist_id}","starred_url":"https://api.github.com/users/fmthoma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmthoma/subscriptions","organizations_url":"https://api.github.com/users/fmthoma/orgs","repos_url":"https://api.github.com/users/fmthoma/repos","events_url":"https://api.github.com/users/fmthoma/events{/privacy}","received_events_url":"https://api.github.com/users/fmthoma/received_events","type":"User","site_admin":false},"created_at":"2016-06-08T09:29:20Z","updated_at":"2016-06-08T09:29:20Z","body":"@peti it is compiled by `stack --nix`,  which uses `nix-shell` under the hood. This she'll misses the `ncurses` dependency. Although I am not sure what mechanism exactly Stack uses to compute the actual dependencies to include in the Nix shell. "}}
{"actor":{"display_login":"fmthoma"}}