I’m trying to port my employer’s large haskell stack project to nix and it’s barfing over zookeeper_mt
. In stack.yaml I enabled the nix build and already added a few nix packages like zlib to cure build errors, but even with zookeeper_mt, I get:
hzk > configure
hzk > Configuring hzk-2.1.0...
hzk > Warning: 'ghc-options: -rtsopts' has no effect for libraries. It should only
hzk > be used for executables.
hzk > build
hzk > Preprocessing library for hzk-2.1.0..
hzk > /run/user/1000/stack-4c469d140762b8b0/hzk-2.1.0/CApi.hsc:76:10: fatal error: zookeeper.h: No such file or directory
hzk > compilation terminated.
hzk > compiling .stack-work/dist/x86_64-linux-nix/Cabal-3.0.1.0/build/Database/Zookeeper/CApi_hsc_make.c failed (exit code 1)
hzk > command was: /nix/store/za1rr3fxmgfbfl6nbigqi819m3m7nkgi-gcc-wrapper-9.3.0/bin/cc -c .stack-work/dist/x86_64-linux-nix/Cabal-3.0.1.0/build/Database/Zookeeper/CApi_hsc_make.c -o .stack-work/dist/x86_64-linux-nix/Cabal-3.0.1.0/build/Database/Zookeeper/CApi_hsc_make.o -fuse-ld=gold -D__GLASGOW_HASKELL__=808 -Dlinux_BUILD_OS=1 -Dx86_64_BUILD_ARCH=1 -Dlinux_HOST_OS=1 -Dx86_64_HOST_ARCH=1 -I/usr/include/zookeeper -I/nix/store/fn0kwfwaf53638xm37wl94la8dxlbjaq-zlib-1.2.11-dev/include -I/nix/store/in9vak3zphkx9c635iz639iabgrib2fl-postgresql-11.8/include -I/nix/store/qsarmp3rsyvhb7m22xl0fdpsnaf3lv6b-pcre-8.44-dev/include -I/nix/store/87w0n6hix0had2lp58i5rgmrr5dn3ghf-pkg-config-wrapper-0.29.2/include -I/nix/store/v1v3flnwxs3n5lhfrfrs16rcygjzzhmy-zookeeper-3.4.13/include -I/nix/store/grng8b5wmrppx2rmcsqkmjyq23bj1j38-zookeeper_mt-3.4.13/include -I/nix/store/qqra09ff0q8vwqicjs20fn1rvn00k6fy-ghc-8.8.3/include -I/nix/store/pj43dfd5k4zb0ivafkyqpr1blzd616ry-git-2.27.0/include -I/nix/store/za1rr3fxmgfbfl6nbigqi819m3m7nkgi-gcc-wrapper-9.3.0/include -I/nix/store/00lmw45jlcm9ln2vi1rxxdz7cblwk3y6-gmp-6.2.0-dev/include -I/usr/include/zookeeper -I/nix/store/fn0kwfwaf53638xm37wl94la8dxlbjaq-zlib-1.2.11-dev/include -I/nix/store/in9vak3zphkx9c635iz639iabgrib2fl-postgresql-11.8/include -I/nix/store/qsarmp3rsyvhb7m22xl0fdpsnaf3lv6b-pcre-8.44-dev/include -I/nix/store/87w0n6hix0had2lp58i5rgmrr5dn3ghf-pkg-config-wrapper-0.29.2/include -I/nix/store/v1v3flnwxs3n5lhfrfrs16rcygjzzhmy-zookeeper-3.4.13/include -I/nix/store/grng8b5wmrppx2rmcsqkmjyq23bj1j38-zookeeper_mt-3.4.13/include -I/nix/store/qqra09ff0q8vwqicjs20fn1rvn00k6fy-ghc-8.8.3/include -I/nix/store/pj43dfd5k4zb0ivafkyqpr1blzd616ry-git-2.27.0/include -I/nix/store/za1rr3fxmgfbfl6nbigqi819m3m7nkgi-gcc-wrapper-9.3.0/include -I/nix/store/00lmw45jlcm9ln2vi1rxxdz7cblwk3y6-gmp-6.2.0-dev/include -I.stack-work/dist/x86_64-linux-nix/Cabal-3.0.1.0/build/autogen -I.stack-work/dist/x86_64-linux-nix/Cabal-3.0.1.0/build/global-autogen -include .stack-work/dist/x86_64-linux-nix/Cabal-3.0.1.0/build/autogen/cabal_macros.h -I/nix/store/fn0kwfwaf53638xm37wl94la8dxlbjaq-zlib-1.2.11-dev/include -I/nix/store/in9vak3zphkx9c635iz639iabgrib2fl-postgresql-11.8/include -I/nix/store/qsarmp3rsyvhb7m22xl0fdpsnaf3lv6b-pcre-8.44-dev/include -I/nix/store/87w0n6hix0had2lp58i5rgmrr5dn3ghf-pkg-config-wrapper-0.29.2/include -I/nix/store/qqra09ff0q8vwqicjs20fn1rvn00k6fy-ghc-8.8.3/include -I/nix/store/pj43dfd5k4zb0ivafkyqpr1blzd616ry-git-2.27.0/include -I/nix/store/za1rr3fxmgfbfl6nbigqi819m3m7nkgi-gcc-wrapper-9.3.0/include -I/nix/store/00lmw45jlcm9ln2vi1rxxdz7cblwk3y6-gmp-6.2.0-dev/include -I/nix/store/fn0kwfwaf53638xm37wl94la8dxlbjaq-zlib-1.2.11-dev/include -I/nix/store/in9vak3zphkx9c635iz639iabgrib2fl-postgresql-11.8/include -I/nix/store/qsarmp3rsyvhb7m22xl0fdpsnaf3lv6b-pcre-8.44-dev/include -I/nix/store/87w0n6hix0had2lp58i5rgmrr5dn3ghf-pkg-config-wrapper-0.29.2/include -I/nix/store/qqra09ff0q8vwqicjs20fn1rvn00k6fy-ghc-8.8.3/include -I/nix/store/pj43dfd5k4zb0ivafkyqpr1blzd616ry-git-2.27.0/include -I/nix/store/za1rr3fxmgfbfl6nbigqi819m3m7nkgi-gcc-wrapper-9.3.0/include -I/nix/store/00lmw45jlcm9ln2vi1rxxdz7cblwk3y6-gmp-6.2.0-dev/include -I/home/ad/.stack/snapshots/x86_64-linux-nix/dd8fbb08ccfb9e77e9ffdb798576edd8f70b7edca799105b5bc2de70a44535a1/8.8.3/lib/x86_64-linux-ghc-8.8.3/vector-0.12.1.2-AWRYcz9jfa25Avs2q9Jg9V/include -I/nix/store/qqra09ff0q8vwqicjs20fn1rvn00k6fy-ghc-8.8.3/lib/ghc-8.8.3/time-1.9.3/include -I/nix/store/fn0kwfwaf53638xm37wl94la8dxlbjaq-zlib-1.2.11-dev/include -I/nix/store/in9vak3zphkx9c635iz639iabgrib2fl-postgresql-11.8/include -I/nix/store/qqra09ff0q8vwqicjs20fn1rvn00k6fy-ghc-8.8.3/include -I/nix/store/pj43dfd5k4zb0ivafkyqpr1blzd616ry-git-2.27.0/include -I/nix/store/za1rr3fxmgfbfl6nbigqi819m3m7nkgi-gcc-wrapper-9.3.0/include -I/nix/store/00lmw45jlcm9ln2vi1rxxdz7cblwk3y6-gmp-6.2.0-dev/include -I/home/ad/.stack/snapshots/x86_64-linux-nix/dd8fbb08ccfb9e77e9ffdb798576edd8f70b7edca799105b5bc2de70a44535a1/8.8.3/lib/x86_64-linux-ghc-8.8.3/primitive-0.7.0.1-CN4ea3Jrhra6yENuqrDg51/include -I/nix/store/fn0kwfwaf53638xm37wl94la8dxlbjaq-zlib-1.2.11-dev/include -I/nix/store/in9vak3zphkx9c635iz639iabgrib2fl-postgresql-11.8/include -I/nix/store/qsarmp3rsyvhb7m22xl0fdpsnaf3lv6b-pcre-8.44-dev/include -I/nix/store/87w0n6hix0had2lp58i5rgmrr5dn3ghf-pkg-config-wrapper-0.29.2/include -I/nix/store/qqra09ff0q8vwqicjs20fn1rvn00k6fy-ghc-8.8.3/include -I/nix/store/pj43dfd5k4zb0ivafkyqpr1blzd616ry-git-2.27.0/include -I/nix/store/za1rr3fxmgfbfl6nbigqi819m3m7nkgi-gcc-wrapper-9.3.0/include -I/nix/store/00lmw45jlcm9ln2vi1rxxdz7cblwk3y6-gmp-6.2.0-dev/include -I/nix/store/fn0kwfwaf53638xm37wl94la8dxlbjaq-zlib-1.2.11-dev/include -I/nix/store/in9vak3zphkx9c635iz639iabgrib2fl-postgresql-11.8/include -I/nix/store/qsarmp3rsyvhb7m22xl0fdpsnaf3lv6b-pcre-8.44-dev/include -I/nix/store/87w0n6hix0had2lp58i5rgmrr5dn3ghf-pkg-config-wrapper-0.29.2/include -I/nix/store/qqra09ff0q8vwqicjs20fn1rvn00k6fy-ghc-8.8.3/include -I/nix/store/pj43dfd5k4zb0ivafkyqpr1blzd616ry-git-2.27.0/include -I/nix/store/za1rr3fxmgfbfl6nbigqi819m3m7nkgi-gcc-wrapper-9.3.0/include -I/nix/store/00lmw45jlcm9ln2vi1rxxdz7cblwk3y6-gmp-6.2.0-dev/include -I/nix/store/fn0kwfwaf53638xm37wl94la8dxlbjaq-zlib-1.2.11-dev/include -I/nix/store/in9vak3zphkx9c635iz639iabgrib2fl-postgresql-11.8/include -I/nix/store/qsarmp3rsyvhb7m22xl0fdpsnaf3lv6b-pcre-8.44-dev/include -I/nix/store/87w0n6hix0had2lp58i5rgmrr5dn3ghf-pkg-config-wrapper-0.29.2/include -I/nix/store/qqra09ff0q8vwqicjs20fn1rvn00k6fy-ghc-8.8.3/include -I/nix/store/pj43dfd5k4zb0ivafkyqpr1blzd616ry-git-2.27.0/include -I/nix/store/za1rr3fxmgfbfl6nbigqi819m3m7nkgi-gcc-wrapper-9.3.0/include -I/nix/store/00lmw45jlcm9ln2vi1rxxdz7cblwk3y6-gmp-6.2.0-dev/include -I/nix/store/fn0kwfwaf53638xm37wl94la8dxlbjaq-zlib-1.2.11-dev/include -I/nix/store/qqra09ff0q8vwqicjs20fn1rvn00k6fy-ghc-8.8.3/include -I/nix/store/pj43dfd5k4zb0ivafkyqpr1blzd616ry-git-2.27.0/include -I/nix/store/za1rr3fxmgfbfl6nbigqi819m3m7nkgi-gcc-wrapper-9.3.0/include -I/nix/store/00lmw45jlcm9ln2vi1rxxdz7cblwk3y6-gmp-6.2.0-dev/include -I/nix/store/qqra09ff0q8vwqicjs20fn1rvn00k6fy-ghc-8.8.3/lib/ghc-8.8.3/bytestring-0.10.10.0/include -I/nix/store/qqra09ff0q8vwqicjs20fn1rvn00k6fy-ghc-8.8.3/include -I/nix/store/pj43dfd5k4zb0ivafkyqpr1blzd616ry-git-2.27.0/include -I/nix/store/za1rr3fxmgfbfl6nbigqi819m3m7nkgi-gcc-wrapper-9.3.0/include -I/nix/store/00lmw45jlcm9ln2vi1rxxdz7cblwk3y6-gmp-6.2.0-dev/include -I/nix/store/qqra09ff0q8vwqicjs20fn1rvn00k6fy-ghc-8.8.3/lib/ghc-8.8.3/base-4.13.0.0/include -I/nix/store/00lmw45jlcm9ln2vi1rxxdz7cblwk3y6-gmp-6.2.0-dev/include -I/nix/store/qqra09ff0q8vwqicjs20fn1rvn00k6fy-ghc-8.8.3/lib/ghc-8.8.3/integer-gmp-1.0.2.0/include -I/nix/store/qqra09ff0q8vwqicjs20fn1rvn00k6fy-ghc-8.8.3/lib/ghc-8.8.3/include -I/nix/store/l9xqrgxn4z795jivmrmjyanlb6jjq66k-libffi-3.3-dev/include -I/nix/store/qqra09ff0q8vwqicjs20fn1rvn00k6fy-ghc-8.8.3/lib/ghc-8.8.3/include/
I can see in nix-shell -p zookeeper_mt
that zookeeper.h ends up in ${zookeeper}/include/zookeeper/
, but that’s just like the ubuntu package which also has this zookeeper subdirectory of /usr/include, and the project works fine in a non-nix stack build with that ubuntu package installed.
I see in that error message -I/nix/store/grng8b5wmrppx2rmcsqkmjyq23bj1j38-zookeeper_mt-3.4.13/include
without the extra /zookeeper
but I’m not sure which bit of the system is responsible for that or how to fix it cos I’m very new to nix. Is it the nix package’s fault, stack’s, or something else?