Running stack build or stack build --nix fails on NixOs due to Zlib issues.
environment.systemPackages = with pkgs; [
emacs25
vim
pkgs.dmenu
i3status
google-chrome
git
gnupg
htop
redshift
#Haskell
stack
zlib
];
resolver: lts-7.18
packages:
- '.'
extra-deps: []
flags: {}
extra-package-dbs: []
nix:
enable: true
And the following cabal file.
name: example
version: 0.1.0.0
synopsis: Initial project template from stack
description: Please see README.md
homepage: https://github.com/githubuser/example#readme
license: BSD3
license-file: LICENSE
author: Author name here
maintainer: [email protected]
copyright: 2017 Author name here
category: Web
build-type: Simple
extra-source-files: README.md
cabal-version: >=1.10
library
hs-source-dirs: src
exposed-modules: Lib
build-depends: base >= 4.7 && < 5
, zlib
default-language: Haskell2010
executable example-exe
hs-source-dirs: app
main-is: Main.hs
ghc-options: -threaded -rtsopts -with-rtsopts=-N
build-depends: base
, example
default-language: Haskell2010
test-suite example-test
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: Spec.hs
build-depends: base
, example
ghc-options: -threaded -rtsopts -with-rtsopts=-N
default-language: Haskell2010
source-repository head
type: git
location: https://github.com/githubuser/example
Stack build to work.
Stack build fails due to zlib errors.
If you suspect that a stack command misbehaved, please include the output of that command in --verbose mode.
If the output is larger than a page please paste the output in a Gist.
$ stack build --verbose
2017-02-03 07:36:32.078618: [debug] Checking for project config at: /home/ashton/Documents/example/stack.yaml
@(Stack/Config.hs:863:9)
2017-02-03 07:36:32.079006: [debug] Loading project config file stack.yaml
@(Stack/Config.hs:881:13)
2017-02-03 07:36:32.083473: [debug] Trying to decode /home/ashton/.stack/build-plan-cache/x86_64-linux-nix/lts-7.18.cache
@(Data/Store/VersionTagged.hs:68:5)
2017-02-03 07:36:32.091794: [debug] Success decoding /home/ashton/.stack/build-plan-cache/x86_64-linux-nix/lts-7.18.cache
@(Data/Store/VersionTagged.hs:72:13)
2017-02-03 07:36:32.100733: [debug] Getting system compiler version
@(Stack/Setup.hs:370:17)
2017-02-03 07:36:32.101319: [debug] Run process: /nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/bin/ghc --info
@(System/Process/Read.hs:306:3)
2017-02-03 07:36:32.175263: [debug] Process finished in [92m73ms[0m: /nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/bin/ghc --info
@(System/Process/Read.hs:306:3)
2017-02-03 07:36:32.177435: [debug] Getting global package database location
@(Stack/GhcPkg.hs:55:5)
2017-02-03 07:36:32.177665: [debug] Run process: /nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/bin/ghc-pkg --no-user-package-db list --global
@(System/Process/Read.hs:306:3)
2017-02-03 07:36:32.178515: [debug] Asking GHC for its version
@(Stack/Setup/Installed.hs:103:13)
2017-02-03 07:36:32.178798: [debug] Run process: /nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/bin/ghc --numeric-version
@(System/Process/Read.hs:306:3)
2017-02-03 07:36:32.184927: [debug] Getting Cabal package version
@(Stack/GhcPkg.hs:189:5)
2017-02-03 07:36:32.185246: [debug] Run process: /nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/bin/ghc-pkg --no-user-package-db field --simple-output Cabal version
@(System/Process/Read.hs:306:3)
2017-02-03 07:36:32.207870: [debug] Process finished in [92m30ms[0m: /nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/bin/ghc-pkg --no-user-package-db list --global
@(System/Process/Read.hs:306:3)
2017-02-03 07:36:32.213589: [debug] Process finished in [92m28ms[0m: /nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/bin/ghc-pkg --no-user-package-db field --simple-output Cabal version
@(System/Process/Read.hs:306:3)
2017-02-03 07:36:32.239149: [debug] Process finished in [92m60ms[0m: /nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/bin/ghc --numeric-version
@(System/Process/Read.hs:306:3)
2017-02-03 07:36:32.239430: [debug] Resolving package entries
@(Stack/Setup.hs:252:5)
2017-02-03 07:36:32.240111: [debug] Starting to execute command inside EnvConfig
@(Stack/Runners.hs:163:18)
2017-02-03 07:36:32.240215: [debug] Parsing the cabal files of the local packages
@(Stack/Build/Source.hs:298:5)
2017-02-03 07:36:32.241346: [debug] Parsing the targets
@(Stack/Build/Source.hs:235:5)
2017-02-03 07:36:32.241625: [debug] Exception ignored when attempting to load /home/ashton/Documents/example/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.0.0/stack-build-cache: /home/ashton/Documents/example/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.0.0/stack-build-cache: openBinaryFile: does not exist (No such file or directory)
@(Data/Store/VersionTagged.hs:86:9)
2017-02-03 07:36:32.241871: [debug] Start: getPackageFiles /home/ashton/Documents/example/example.cabal
@(Stack/Package.hs:250:21)
2017-02-03 07:36:32.242975: [warn] Warning: File listed in example.cabal file does not exist: README.md
@(Stack/Package.hs:1218:8)
2017-02-03 07:36:32.243104: [debug] Finished in 1ms: getPackageFiles /home/ashton/Documents/example/example.cabal
@(Stack/Package.hs:250:21)
2017-02-03 07:36:32.243467: [debug] Finding out which packages are already installed
@(Stack/Build/Installed.hs:68:5)
2017-02-03 07:36:32.243639: [debug] Run process: /nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/bin/ghc-pkg --global --no-user-package-db dump --expand-pkgroot
@(System/Process/Read.hs:306:3)
2017-02-03 07:36:32.281855: [debug] Process finished in [92m38ms[0m: /nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/bin/ghc-pkg --global --no-user-package-db dump --expand-pkgroot
@(System/Process/Read.hs:306:3)
2017-02-03 07:36:32.290304: [debug] Ignoring package haskeline due to wanting version 0.7.3.0 instead of 0.7.2.3
@(Stack/Build/Installed.hs:191:5)
2017-02-03 07:36:32.290494: [debug] Ignoring package Cabal due to wanting version 1.24.2.0 instead of 1.24.0.0
@(Stack/Build/Installed.hs:191:5)
2017-02-03 07:36:32.291025: [debug] Run process: /nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/bin/ghc-pkg --user --no-user-package-db --package-db /home/ashton/.stack/snapshots/x86_64-linux-nix/lts-7.18/8.0.1/pkgdb dump --expand-pkgroot
@(System/Process/Read.hs:306:3)
2017-02-03 07:36:32.318554: [debug] Process finished in [92m27ms[0m: /nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/bin/ghc-pkg --user --no-user-package-db --package-db /home/ashton/.stack/snapshots/x86_64-linux-nix/lts-7.18/8.0.1/pkgdb dump --expand-pkgroot
@(System/Process/Read.hs:306:3)
2017-02-03 07:36:32.318803: [debug] Run process: /nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/bin/ghc-pkg --user --no-user-package-db --package-db /home/ashton/Documents/example/.stack-work/install/x86_64-linux-nix/lts-7.18/8.0.1/pkgdb dump --expand-pkgroot
@(System/Process/Read.hs:306:3)
2017-02-03 07:36:32.345834: [debug] Process finished in [92m26ms[0m: /nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/bin/ghc-pkg --user --no-user-package-db --package-db /home/ashton/Documents/example/.stack-work/install/x86_64-linux-nix/lts-7.18/8.0.1/pkgdb dump --expand-pkgroot
@(System/Process/Read.hs:306:3)
2017-02-03 07:36:32.346222: [debug] Constructing the build plan
@(Stack/Build/ConstructPlan.hs:159:5)
2017-02-03 07:36:32.346590: [debug] Trying to decode /home/ashton/.stack/indices/Hackage/00-index.cache
@(Data/Store/VersionTagged.hs:68:5)
2017-02-03 07:36:32.440522: [debug] Success decoding /home/ashton/.stack/indices/Hackage/00-index.cache
@(Data/Store/VersionTagged.hs:72:13)
2017-02-03 07:36:32.544170: [debug] Checking if we are going to build multiple executables with the same name
@(Stack/Build.hs:196:5)
2017-02-03 07:36:32.544336: [debug] Executing the build plan
@(Stack/Build/Execute.hs:454:5)
2017-02-03 07:36:32.545159: [debug] Getting global package database location
@(Stack/GhcPkg.hs:55:5)
2017-02-03 07:36:32.545228: [debug] Run process: /nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/bin/ghc-pkg --no-user-package-db list --global
@(System/Process/Read.hs:306:3)
2017-02-03 07:36:32.573401: [debug] Process finished in [92m28ms[0m: /nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/bin/ghc-pkg --no-user-package-db list --global
@(System/Process/Read.hs:306:3)
2017-02-03 07:36:32.573963: [debug] Precompiled cache input = (["--dependency=base=base-4.9.0.0","--dependency=bytestring=bytestring-0.10.8.1","--extra-include-dirs=/nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/include","--extra-lib-dirs=/nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/lib"],fromList ["base-4.9.0.0","bytestring-0.10.8.1"])
@(Stack/Build/Cache.hs:282:5)
2017-02-03 07:36:32.574163: [debug] Exception ignored when attempting to load /home/ashton/.stack/precompiled/x86_64-linux-nix/ghc-8.0.1/1.24.0.0/zlib-0.6.1.2/EZwIBKgMdtUiGIIsM02THao1WhXkLgnnVaOzlTeMqkU=: /home/ashton/.stack/precompiled/x86_64-linux-nix/ghc-8.0.1/1.24.0.0/zlib-0.6.1.2/EZwIBKgMdtUiGIIsM02THao1WhXkLgnnVaOzlTeMqkU=: openBinaryFile: does not exist (No such file or directory)
@(Data/Store/VersionTagged.hs:86:9)
2017-02-03 07:36:32.583193: [debug] Exception ignored when attempting to load /run/user/1000/stack29830/zlib-0.6.1.2/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.0.0/stack-config-cache: /run/user/1000/stack29830/zlib-0.6.1.2/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.0.0/stack-config-cache: openBinaryFile: does not exist (No such file or directory)
@(Data/Store/VersionTagged.hs:86:9)
2017-02-03 07:36:32.583370: [debug] Exception ignored when attempting to load /run/user/1000/stack29830/zlib-0.6.1.2/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.0.0/stack-cabal-mod: /run/user/1000/stack29830/zlib-0.6.1.2/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.0.0/stack-cabal-mod: openBinaryFile: does not exist (No such file or directory)
@(Data/Store/VersionTagged.hs:86:9)
2017-02-03 07:36:32.583549: [info] zlib-0.6.1.2: configure
@(Stack/Build/Execute.hs:826:23)
2017-02-03 07:36:32.584333: [debug] Run process: /home/ashton/.stack/setup-exe-cache/x86_64-linux-nix/Cabal-simple_mPHDZzAJ_1.24.0.0_ghc-8.0.1 --builddir=.stack-work/dist/x86_64-linux-nix/Cabal-1.24.0.0 configure --with-ghc=/nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/bin/ghc --with-ghc-pkg=/nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-7.18/8.0.1/pkgdb --libdir=/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-7.18/8.0.1/lib --bindir=/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-7.18/8.0.1/bin --datadir=/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-7.18/8.0.1/share --libexecdir=/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-7.18/8.0.1/libexec --sysconfdir=/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-7.18/8.0.1/etc --docdir=/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-7.18/8.0.1/doc/zlib-0.6.1.2 --htmldir=/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-7.18/8.0.1/doc/zlib-0.6.1.2 --haddockdir=/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-7.18/8.0.1/doc/zlib-0.6.1.2 --dependency=base=base-4.9.0.0 --dependency=bytestring=bytestring-0.10.8.1 --extra-include-dirs=/nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/include --extra-lib-dirs=/nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/lib
@(System/Process/Read.hs:340:3)
-- While building package zlib-0.6.1.2 using:
/home/ashton/.stack/setup-exe-cache/x86_64-linux-nix/Cabal-simple_mPHDZzAJ_1.24.0.0_ghc-8.0.1 --builddir=.stack-work/dist/x86_64-linux-nix/Cabal-1.24.0.0 configure --with-ghc=/nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/bin/ghc --with-ghc-pkg=/nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-7.18/8.0.1/pkgdb --libdir=/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-7.18/8.0.1/lib --bindir=/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-7.18/8.0.1/bin --datadir=/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-7.18/8.0.1/share --libexecdir=/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-7.18/8.0.1/libexec --sysconfdir=/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-7.18/8.0.1/etc --docdir=/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-7.18/8.0.1/doc/zlib-0.6.1.2 --htmldir=/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-7.18/8.0.1/doc/zlib-0.6.1.2 --haddockdir=/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-7.18/8.0.1/doc/zlib-0.6.1.2 --dependency=base=base-4.9.0.0 --dependency=bytestring=bytestring-0.10.8.1 --extra-include-dirs=/nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/include --extra-lib-dirs=/nix/store/kvjkwch6d466xdmrkjzbh1n6vp573sy8-ghc-8.0.1/lib
Process exited with code: ExitFailure 1
Logs have been written to: /home/ashton/Documents/example/.stack-work/logs/zlib-0.6.1.2.log
Configuring zlib-0.6.1.2...
Cabal-simple_mPHDZzAJ_1.24.0.0_ghc-8.0.1: Missing dependency on a foreign
library:
* Missing (or bad) header file: zlib.h
* Missing C library: z
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
If the header file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
$ stack --version
Version 1.3.2 x86_64
Compiled with:
- Cabal-1.24.0.0
- Glob-0.7.13
- HUnit-1.3.1.2
- MonadRandom-0.4.2.3
- QuickCheck-2.8.2
- SHA-1.6.4.2
- StateVar-1.1.0.4
- aeson-1.0.2.1
- aeson-compat-0.3.6
- annotated-wl-pprint-0.7.0
- ansi-terminal-0.6.2.3
- ansi-wl-pprint-0.6.7.3
- array-0.5.1.1
- asn1-encoding-0.9.4
- asn1-parse-0.9.4
- asn1-types-0.3.2
- async-2.1.1
- attoparsec-0.13.1.0
- auto-update-0.1.4
- base-4.9.0.0
- base-compat-0.9.1
- base-orphans-0.5.4
- base16-bytestring-0.1.1.6
- base64-bytestring-1.0.0.1
- bifunctors-5.4.1
- binary-0.8.3.0
- binary-tagged-0.1.4.2
- blaze-builder-0.4.0.2
- blaze-html-0.8.1.3
- blaze-markup-0.7.1.1
- byteable-0.1.1
- bytestring-0.10.8.1
- bytestring-builder-0.10.8.1.0
- case-insensitive-1.2.0.7
- cereal-0.5.4.0
- clock-0.7.2
- comonad-5
- conduit-1.2.8
- conduit-extra-1.1.15
- connection-0.2.6
- constraints-0.8
- containers-0.5.7.1
- contravariant-1.4
- cookie-0.4.2.1
- cryptohash-0.11.9
- cryptohash-conduit-0.1.1
- cryptonite-0.19
- data-default-class-0.1.2.0
- deepseq-1.4.2.0
- digest-0.0.1.2
- directory-1.2.6.2
- distributive-0.5.0.2
- dlist-0.8.0.2
- easy-file-0.2.1
- either-4.4.1.1
- enclosed-exceptions-1.0.2
- errors-2.1.3
- exceptions-0.8.3
- extra-1.4.10
- fail-4.9.0.0
- fast-logger-2.4.7
- file-embed-0.0.10
- filelock-0.1.0.1
- filepath-1.4.1.0
- free-4.12.4
- fsnotify-0.2.1
- generic-deriving-1.11.1
- generics-sop-0.2.3.0
- ghc-boot-th-8.0.1
- ghc-prim-0.5.0.0
- gitrev-1.2.0
- hashable-1.2.4.0
- hastache-0.6.1
- hinotify-0.3.9
- hit-0.6.3
- hourglass-0.2.10
- hpack-0.15.0
- hpc-0.6.0.3
- hspec-2.2.4
- hspec-core-2.2.4
- hspec-discover-2.2.4
- hspec-expectations-0.7.2
- hspec-smallcheck-0.4.1
- http-api-data-0.2.4
- http-client-0.5.5
- http-client-tls-0.3.3.1
- http-conduit-2.2.3
- http-types-0.9.1
- ieee754-0.7.9
- integer-gmp-1.0.0.1
- lifted-async-0.9.0
- lifted-base-0.2.3.8
- logict-0.6.0.2
- memory-0.13
- microlens-0.4.7.0
- mime-types-0.1.0.7
- mmorph-1.0.9
- monad-control-1.0.1.0
- monad-logger-0.3.20.1
- monad-loops-0.4.3
- monad-unlift-0.2.0
- mono-traversable-1.0.1
- mtl-2.2.1
- nats-1.1.1
- network-2.6.3.1
- network-uri-2.6.1.0
- old-locale-1.0.0.7
- old-time-1.1.0.3
- open-browser-0.2.1.0
- optparse-applicative-0.13.0.0
- optparse-simple-0.0.3
- parsec-3.1.11
- path-0.5.11
- path-io-1.2.0
- path-pieces-0.2.1
- patience-0.1.1
- pem-0.2.2
- persistent-2.6
- persistent-sqlite-2.6
- persistent-template-2.5.1.6
- pid1-0.1.0.1
- prelude-extras-0.4.0.3
- pretty-1.1.3.3
- primitive-0.6.1.0
- process-1.4.2.0
- profunctors-5.2
- project-template-0.2.0
- quickcheck-io-0.1.4
- random-1.1
- regex-applicative-0.3.3
- regex-applicative-text-0.1.0.1
- resource-pool-0.2.3.2
- resourcet-1.1.8.1
- retry-0.7.4.2
- rts-1.0
- safe-0.3.10
- safe-exceptions-0.1.4.0
- scientific-0.3.4.9
- semigroupoids-5.1
- semigroups-0.18.2
- setenv-0.1.1.3
- silently-1.2.5
- smallcheck-1.1.1
- socks-0.5.5
- split-0.2.3.1
- stm-2.4.4.1
- stm-chans-3.0.0.4
- store-0.2.1.2
- store-core-0.2.0.2
- streaming-commons-0.1.16
- syb-0.6
- system-fileio-0.3.16.3
- system-filepath-0.4.13.4
- tagged-0.8.5
- tar-0.5.0.3
- template-haskell-2.11.0.0
- temporary-1.2.0.4
- text-1.2.2.1
- text-binary-0.2.1.1
- text-metrics-0.1.0
- tf-random-0.5
- th-expand-syns-0.4.1.0
- th-lift-0.7.6
- th-lift-instances-0.1.11
- th-orphans-0.13.3
- th-reify-many-0.1.6
- th-utilities-0.2.0.1
- time-1.6.0.1
- time-locale-compat-0.1.1.3
- tls-1.3.8
- transformers-0.5.2.0
- transformers-base-0.4.4
- transformers-compat-0.5.1.4
- unexceptionalio-0.3.0
- unicode-transforms-0.1.0.1
- unix-2.7.2.0
- unix-compat-0.4.3.1
- unix-time-0.3.7
- unordered-containers-0.2.7.1
- utf8-string-1.0.1.1
- vector-0.11.0.0
- vector-algorithms-0.7.0.1
- vector-binary-instances-0.2.3.3
- void-0.7.1
- x509-1.6.5
- x509-store-1.6.2
- x509-system-1.6.4
- x509-validation-1.6.5
- yaml-0.8.21.1
- zip-archive-0.3.0.5
- zlib-0.6.1.2
- zlib-bindings-0.1.1.5
Installed via configuration.nix on a NixOs VM (64 bit).
Something like this has come up before - does this resolve the issue https://github.com/commercialhaskell/stack/issues/2130#issuecomment-247032332 ?
There's lots of other discussion, not sure if this is the solution. Searching nix and zlib brings up a fair number of relevant issues.
Worked like a charm, thank you!
To fix it I added (as mentioned above) to global stack configuration:
nix:
enable: true
packages: [zlib.dev, zlib.out]
to:
~/.stack/config.yaml
I was getting this build error when running stack hoogle
packages: [zlib.dev, zlib.out] was my resort
This worked for me, but https://github.com/input-output-hk/cardano-sl/issues/2496 said the opposite:
I recommend not having global packages specified, since you'll have to override each project that uses the shell-file.
I hope there'd be a nice solution addressing both at once.
I hope there'd be a nice solution addressing both at once.
$ stack --nix-help | grep -A 1 nix-packages
Usage: stack [--[no-]nix] [--[no-]nix-pure] [--nix-packages NAMES]
[--nix-shell-file FILE] [--nix-shell-options OPTIONS]
--
--nix-packages NAMES List of packages that should be available in the
nix-shell (space separated)
For instance pandoc has zlib dependency and pandoc could be done with following stack command:
$ stack --nix --nix-packages zlib install pandoc
For reference this answer solves it without using stack's nix integration by adding zlib to the load path
@ruhatch that answer is more or less the same what stack --nix --nix-packages zlib install pandoc does
@ruhatch that answer is more or less the same what
stack --nix --nix-packages zlib install pandocdoes
Indeed, but some use cases need to ignore stack --nix invocations. In my case the application was calling stack exec inside the testing framework, which causes issues with nix-shell. If anyone else runs into similar issues the above solution is another option.
Most helpful comment
To fix it I added (as mentioned above) to global stack configuration:
to:
I was getting this build error when running
stack hoogle