Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure: error: curses library not found, so this package cannot be built when installing terminfo on nixos #3233

Closed
mzabani opened this issue Jun 27, 2017 · 6 comments
Milestone

Comments

@mzabani
Copy link

mzabani commented Jun 27, 2017

Using stack 1.4.0 compiled with Cabal-1.24.2.0 on Nixos 17.03 with lts-8.20 and ghc-8.0.2, I can't install terminfo on any of my projects:

mzabani@nixos:~/Projects/bancot]$ stack install terminfo
terminfo-0.4.1.0: configure
Package terminfo uses a custom Cabal build, but does not use a custom-setup stanza
Not using the explicit setup deps approach based on configuration
Strongly recommend fixing the package's cabal file

--  While building package terminfo-0.4.1.0 using:
  /run/user/1000/stack10060/terminfo-0.4.1.0/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0/setup/setup --builddir=.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0 configure --with-ghc=/nix/store/8v64zpyci6rgrzzbhc2bfa911yfmnfw5-ghc-8.0.2/bin/ghc --with-ghc-pkg=/nix/store/8v64zpyci6rgrzzbhc2bfa911yfmnfw5-ghc-8.0.2/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/mzabani/.stack/snapshots/x86_64-linux-nix/lts-8.20/8.0.2/pkgdb --libdir=/home/mzabani/.stack/snapshots/x86_64-linux-nix/lts-8.20/8.0.2/lib --bindir=/home/mzabani/.stack/snapshots/x86_64-linux-nix/lts-8.20/8.0.2/bin --datadir=/home/mzabani/.stack/snapshots/x86_64-linux-nix/lts-8.20/8.0.2/share --libexecdir=/home/mzabani/.stack/snapshots/x86_64-linux-nix/lts-8.20/8.0.2/libexec --sysconfdir=/home/mzabani/.stack/snapshots/x86_64-linux-nix/lts-8.20/8.0.2/etc --docdir=/home/mzabani/.stack/snapshots/x86_64-linux-nix/lts-8.20/8.0.2/doc/terminfo-0.4.1.0 --htmldir=/home/mzabani/.stack/snapshots/x86_64-linux-nix/lts-8.20/8.0.2/doc/terminfo-0.4.1.0 --haddockdir=/home/mzabani/.stack/snapshots/x86_64-linux-nix/lts-8.20/8.0.2/doc/terminfo-0.4.1.0 --dependency=base=base-4.9.1.0 --extra-include-dirs=/nix/store/05053nfzcqbrij1qxd2z20yhamyg14dj-glpk-4.61/include --extra-include-dirs=/nix/store/6m705shsri2f131cq07fq95dswcrjg5l-postgresql-9.5.6/include --extra-include-dirs=/nix/store/8s9rnmlr3kpf1g9wwr5hzxiiqk706mlw-zlib-1.2.11-dev/include --extra-include-dirs=/nix/store/8v64zpyci6rgrzzbhc2bfa911yfmnfw5-ghc-8.0.2/include --extra-include-dirs=/nix/store/hasadnj5n3lfmm3n85knhwq7kb61i63g-pcre-8.40-dev/include --extra-include-dirs=/nix/store/pf89226bwyplwszk8brivdfrx04ly7k5-ncurses-6.0-dev/include --extra-lib-dirs=/nix/store/05053nfzcqbrij1qxd2z20yhamyg14dj-glpk-4.61/lib --extra-lib-dirs=/nix/store/8v64zpyci6rgrzzbhc2bfa911yfmnfw5-ghc-8.0.2/lib --extra-lib-dirs=/nix/store/ally147d2h11jv34w1saml1ni7kkxmch-pcre-8.40/lib --extra-lib-dirs=/nix/store/kk8r62xz5g1hn1mn1307fcj24anp5m6g-zlib-1.2.11/lib --extra-lib-dirs=/nix/store/sj8rnawbay2j2hiqgazsbq05rlpha5lq-ncurses-6.0/lib --extra-lib-dirs=/nix/store/smqi632v999n8i77q5f74cwhc9a1vyhy-postgresql-9.5.6-lib/lib
Process exited with code: ExitFailure 1
Logs have been written to: /home/mzabani/Projects/bancot/.stack-work/logs/terminfo-0.4.1.0.log

[1 of 2] Compiling Main             ( /run/user/1000/stack10060/terminfo-0.4.1.0/Setup.lhs, /run/user/1000/stack10060/terminfo-0.4.1.0/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0/setup/Main.o )
[2 of 2] Compiling StackSetupShim   ( /home/mzabani/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /run/user/1000/stack10060/terminfo-0.4.1.0/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0/setup/StackSetupShim.o )
Linking /run/user/1000/stack10060/terminfo-0.4.1.0/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0/setup/setup ...
Configuring terminfo-0.4.1.0...
configure: WARNING: unrecognized options: --with-compiler
checking for gcc... /nix/store/b43ww9wkpwjxha7ql7mizxpa2vb6yk5r-gcc-wrapper-5.4.0/bin/cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /nix/store/b43ww9wkpwjxha7ql7mizxpa2vb6yk5r-gcc-wrapper-5.4.0/bin/cc accepts -g... yes
checking for /nix/store/b43ww9wkpwjxha7ql7mizxpa2vb6yk5r-gcc-wrapper-5.4.0/bin/cc option to accept ISO C89... none needed
checking for setupterm in -ltinfo... no
checking for setupterm in -lncursesw... no
checking for setupterm in -lncurses... no
checking for setupterm in -lcurses... no
configure: error: in `/run/user/1000/stack10060/terminfo-0.4.1.0':
configure: error: curses library not found, so this package cannot be built
See `config.log' for more details

Here is ~/Projects/bancot/stack.yaml:

resolver: lts-8.20
packages:
- '.'
extra-deps: []
flags: {}
extra-package-dbs: []

Here is ~/.stack/config.yaml:

nix:
  packages:
  - zlib
  - pcre
  - glpk
  - postgresql
  - ncurses
  enable: true
  pure: true
  system-ghc: true

I have also tried setting pure to false, but nothing changed. I do have ncurses-6.0 installed, as can be seen by the build command itself. I have also tried lts-7.24, but had the same results.

Sorry if this is old news for you, I can't seem to find anything related to this on the other issues.
Thank you in advance.

@mzabani
Copy link
Author

mzabani commented Jul 19, 2017

I imagine you guys must be pretty busy, is there any more information I can get to help with this issue or anything I could try to fix this (I'm just an amateur with Nix, but if there any pointers on where to look and learn maybe I could help anyway).

fmthoma referenced this issue in judah/terminfo Jul 20, 2017
It's complicated (see e.g. PR #21), and we don't actually need it for the
build.
@chris-martin
Copy link
Contributor

@mzabani This comment seems to be the workaround.

Actually, I'm not sure this is even actually a bug - It's just that the terminfo package has a surprising set of native dependencies. We may want to file an issue at terminfo to add some documentation for this.

@chris-martin
Copy link
Contributor

Upon further experimentation, it seems that you only need the ncurses and gcc Nix packages.

@lboklin
Copy link

lboklin commented Aug 13, 2017

@chris-martin It doesn't solve the problem for me.

@mgsloan mgsloan added this to the Support milestone Aug 14, 2017
@mtesseract
Copy link

I can confirm that using the following .stack/config.yaml:

system-ghc: true
nix:
  enable: true
  packages: [ gcc ncurses ]

I can build terminfo-0.4.1.0 with stack (and then also intero).
The "gcc" entry in the packages field above seems mandatory — with only "ncurses" building terminfo fails with the reported curses problem.

@mpilgrem
Copy link
Member

I am closing this issue given the passage of time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants