nh2 / static-haskell-nix

easily build most Haskell programs into fully static Linux executables
388 stars 36 forks source link

static build: ghc: can't find a package database #23

Closed clojurians-org closed 5 years ago

clojurians-org commented 5 years ago

i use the following default.nix to static build: https://github.com/clojurians-org/nix-haskell-build/blob/master/postgrest/default.nix the nix-shell --runs 'cabal new-repl' is successsful and also cabal build. but i get error with 'nix-build':

compileBuildDriverPhase
setupCompileFlags: -package-db=/build/setup-package.conf.d -j8 -threaded
Loaded package environment from /build/postgrest/.ghc.environment.x86_64-linux-8.4.3
ghc: can't find a package database at /home/larluo/.cabal/store/ghc-8.4.3/package.db
builder for '/nix/store/shlrhn20iimxra5nxdnn87rdicyl8blk-postgrest-5.2.0.drv' failed with exit code 1
error: build of '/nix/store/shlrhn20iimxra5nxdnn87rdicyl8blk-postgrest-5.2.0.drv' failed
clojurians-org commented 5 years ago

i delete dist, dist-newstyle, .ghc.environment.x86_64-linux-8.4.3, now it's okay