Nixpkgs: haskellPackages.postgrest broken

Created on 5 Mar 2020  Â·  8Comments  Â·  Source: NixOS/nixpkgs

It's because configurator-pg is broken and can't see base libraries for some reason. We know from #37442 that postgrest 6.0+ works and fixing configurator-pg (and any other surprises) should fix postgrest.

[cody@nixos:~/nixpkgs]$ nix-build -A haskellPackages.postgrest      
these derivations will be built:
  /nix/store/2hl1hax62jc9djrx9vn870bw61g26kry-wai-cors-0.2.7.drv
  /nix/store/fpn20b6qrw5sg6qb76bb0gdj908d26p3-hasql-pool-0.5.1.drv
  /nix/store/m8nndww5gba41kbb8m3zp6nnsrd46d61-wai-middleware-static-0.8.3.drv
  /nix/store/mjcbv7sffywbb4d0idcdbxsj74wvq5wm-configurator-pg-0.1.0.3.drv
  /nix/store/nb60bk4hckw8gjrj1qcmf156d19jm990-hasql-transaction-1.0.0.1.drv
  /nix/store/lnfzpgfh8hbgcff8nlyczzrcgbz6lj12-postgrest-6.0.2.drv
building '/nix/store/mjcbv7sffywbb4d0idcdbxsj74wvq5wm-configurator-pg-0.1.0.3.drv'...
building '/nix/store/fpn20b6qrw5sg6qb76bb0gdj908d26p3-hasql-pool-0.5.1.drv'...
building '/nix/store/nb60bk4hckw8gjrj1qcmf156d19jm990-hasql-transaction-1.0.0.1.drv'...
building '/nix/store/2hl1hax62jc9djrx9vn870bw61g26kry-wai-cors-0.2.7.drv'...
building '/nix/store/m8nndww5gba41kbb8m3zp6nnsrd46d61-wai-middleware-static-0.8.3.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/4aml49ghv9rdcc3r6q7pl9xfcxh8wl5d-ghc-8.8.2.
setupCompilerEnvironmentPhase
Build with /nix/store/4aml49ghv9rdcc3r6q7pl9xfcxh8wl5d-ghc-8.8.2.
setupCompilerEnvironmentPhase
Build with /nix/store/4aml49ghv9rdcc3r6q7pl9xfcxh8wl5d-ghc-8.8.2.
unpacking sources
unpacking source archive /nix/store/f49lpydjbb5jdgss9dvd4q56y6h4dcc7-wai-cors-0.2.7.tar.gz
source root is wai-cors-0.2.7
setting SOURCE_DATE_EPOCH to timestamp 1000000000 of file wai-cors-0.2.7/wai-cors.cabal
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/setup-package.conf.d -j4 -threaded
unpacking sources
unpacking source archive /nix/store/z4dq2nslk2azmvaiiv2hv18z1ckij2k6-configurator-pg-0.1.0.3.tar.gz
source root is configurator-pg-0.1.0.3
setting SOURCE_DATE_EPOCH to timestamp 1000000000 of file configurator-pg-0.1.0.3/tests/Test.hs
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/setup-package.conf.d -j4 -threaded
setupCompilerEnvironmentPhase
Build with /nix/store/4aml49ghv9rdcc3r6q7pl9xfcxh8wl5d-ghc-8.8.2.
unpacking sources
unpacking source archive /nix/store/dhb9sr8s5k7w3kiy3n96ij0kjk8p6c0n-wai-middleware-static-0.8.3.tar.gz
source root is wai-middleware-static-0.8.3
setting SOURCE_DATE_EPOCH to timestamp 1000000000 of file wai-middleware-static-0.8.3/wai-middleware-static.cabal
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/setup-package.conf.d -j4 -threaded
setupCompilerEnvironmentPhase
Build with /nix/store/4aml49ghv9rdcc3r6q7pl9xfcxh8wl5d-ghc-8.8.2.
[1 of 1] Compiling Main             ( Setup.hs, /build/Main.o )
[1 of 1] Compiling Main             ( Setup.hs, /build/Main.o )
[1 of 1] Compiling Main             ( Setup.hs, /build/Main.o )
Linking Setup ...
Linking Setup ...
Linking Setup ...
unpacking sources
unpacking source archive /nix/store/afzswr9ihnns9fbkq69bazkvkly7gdaj-hasql-transaction-1.0.0.1.tar.gz
source root is hasql-transaction-1.0.0.1
setting SOURCE_DATE_EPOCH to timestamp 1574876062 of file hasql-transaction-1.0.0.1/Setup.hs
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/setup-package.conf.d -j4 -threaded
unpacking sources
unpacking source archive /nix/store/ssjzlfin9ns5ls0z15bsycnrsw4y0hrq-hasql-pool-0.5.1.tar.gz
source root is hasql-pool-0.5.1
setting SOURCE_DATE_EPOCH to timestamp 1559026144 of file hasql-pool-0.5.1/test/Main.hs
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/setup-package.conf.d -j4 -threaded
[1 of 1] Compiling Main             ( Setup.hs, /build/Main.o )
[1 of 1] Compiling Main             ( Setup.hs, /build/Main.o )
Linking Setup ...
Linking Setup ...
configuring
configureFlags: --verbose --prefix=/nix/store/bm0flvpwb8267z20xsfxxvc9fazl3l7w-wai-cors-0.2.7 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --datadir=/nix/store/vaxaajflbca0icadg9h05nj6g3il512j-wai-cors-0.2.7-data/share/ghc-8.8.2 --docdir=/nix/store/n5hda9cns35jw9ii717zfvargfx2mkgw-wai-cors-0.2.7-doc/share/doc/wai-cors-0.2.7 --with-gcc=gcc --package-db=/build/package.conf.d --ghc-option=-j4 --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --disable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --extra-lib-dirs=/nix/store/7yjv8l75a8b1x3vmmnbsdwd5b0gzngga-ncurses-6.1-20190112/lib --extra-lib-dirs=/nix/store/phwyg24nm8z4r91iyrhmdfljxpw1ihd5-libffi-3.3/lib --extra-lib-dirs=/nix/store/r05vk4zq34sps98izq4v4n9h7m1a6wgx-gmp-6.2.0/lib
configuring
configureFlags: --verbose --prefix=/nix/store/if0yi6rr2bdxxk5nkdx8jpllrikq2kbc-wai-middleware-static-0.8.3 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/h5xdfi6yfjf4krz3b3vlq07qk5xq04h5-wai-middleware-static-0.8.3-doc/share/doc/wai-middleware-static-0.8.3 --with-gcc=gcc --package-db=/build/package.conf.d --ghc-option=-j4 --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --extra-lib-dirs=/nix/store/7yjv8l75a8b1x3vmmnbsdwd5b0gzngga-ncurses-6.1-20190112/lib --extra-lib-dirs=/nix/store/phwyg24nm8z4r91iyrhmdfljxpw1ihd5-libffi-3.3/lib --extra-lib-dirs=/nix/store/r05vk4zq34sps98izq4v4n9h7m1a6wgx-gmp-6.2.0/lib
configuring
configureFlags: --verbose --prefix=/nix/store/5iyicrzcbjlm3g7mhcxkpjmw997czqf4-configurator-pg-0.1.0.3 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/6bkfxvygjsrd6fw1mry84gx8agl7blfi-configurator-pg-0.1.0.3-doc/share/doc/configurator-pg-0.1.0.3 --with-gcc=gcc --package-db=/build/package.conf.d --ghc-option=-j4 --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --extra-lib-dirs=/nix/store/7yjv8l75a8b1x3vmmnbsdwd5b0gzngga-ncurses-6.1-20190112/lib --extra-lib-dirs=/nix/store/phwyg24nm8z4r91iyrhmdfljxpw1ihd5-libffi-3.3/lib --extra-lib-dirs=/nix/store/r05vk4zq34sps98izq4v4n9h7m1a6wgx-gmp-6.2.0/lib
configuring
configureFlags: --verbose --prefix=/nix/store/wi4hjgra6wixxam7nzck1k8rjhzj2q7f-hasql-pool-0.5.1 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/k2iydr1l5fylj680861rngxcys87pdkq-hasql-pool-0.5.1-doc/share/doc/hasql-pool-0.5.1 --with-gcc=gcc --package-db=/build/package.conf.d --ghc-option=-j4 --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --extra-lib-dirs=/nix/store/7yjv8l75a8b1x3vmmnbsdwd5b0gzngga-ncurses-6.1-20190112/lib --extra-lib-dirs=/nix/store/phwyg24nm8z4r91iyrhmdfljxpw1ihd5-libffi-3.3/lib --extra-lib-dirs=/nix/store/r05vk4zq34sps98izq4v4n9h7m1a6wgx-gmp-6.2.0/lib
configuring
configureFlags: --verbose --prefix=/nix/store/2wlikk2lq6fp8byk0zaypkpa0zgdzr77-hasql-transaction-1.0.0.1 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/jz3hhgq8irqyjaqb2xjwr4vjbbixrf49-hasql-transaction-1.0.0.1-doc/share/doc/hasql-transaction-1.0.0.1 --with-gcc=gcc --package-db=/build/package.conf.d --ghc-option=-j4 --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --disable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --extra-lib-dirs=/nix/store/7yjv8l75a8b1x3vmmnbsdwd5b0gzngga-ncurses-6.1-20190112/lib --extra-lib-dirs=/nix/store/phwyg24nm8z4r91iyrhmdfljxpw1ihd5-libffi-3.3/lib --extra-lib-dirs=/nix/store/r05vk4zq34sps98izq4v4n9h7m1a6wgx-gmp-6.2.0/lib
Using Parsec parser
Configuring configurator-pg-0.1.0.3...
CallStack (from HasCallStack):
  die', called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:1022:20 in Cabal-3.0.1.0:Distribution.Simple.Configure
  configureFinalizedPackage, called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:475:12 in Cabal-3.0.1.0:Distribution.Simple.Configure
  configure, called at libraries/Cabal/Cabal/Distribution/Simple.hs:625:20 in Cabal-3.0.1.0:Distribution.Simple
  confHook, called at libraries/Cabal/Cabal/Distribution/Simple/UserHooks.hs:65:5 in Cabal-3.0.1.0:Distribution.Simple.UserHooks
  configureAction, called at libraries/Cabal/Cabal/Distribution/Simple.hs:180:19 in Cabal-3.0.1.0:Distribution.Simple
  defaultMainHelper, called at libraries/Cabal/Cabal/Distribution/Simple.hs:116:27 in Cabal-3.0.1.0:Distribution.Simple
  defaultMain, called at Setup.hs:2:8 in main:Main
Setup: Encountered missing or private dependencies:
base >=4.8.2 && <4.13

Using Parsec parser
Configuring wai-middleware-static-0.8.3...
Dependency base >=4.6.0.1 && <5: using base-4.13.0.0
Dependency bytestring >=0.10.0.2 && <0.11: using bytestring-0.10.10.0
Dependency containers >=0.5.0.0 && <0.7: using containers-0.6.2.1
Dependency cryptonite >=0.10 && <1.0: using cryptonite-0.26
Dependency directory >=1.2.0.1 && <1.4: using directory-1.3.4.0
Dependency expiring-cache-map >=0.0.5 && <0.1: using
expiring-cache-map-0.0.6.1
Dependency filepath >=1.3.0.1 && <1.5: using filepath-1.4.2.1
Dependency http-types >=0.8.2 && <0.13: using http-types-0.12.3
Dependency memory >=0.10 && <1.0: using memory-0.15.0
Dependency mime-types >=0.1.0.3 && <0.2: using mime-types-0.1.0.9
Dependency mtl >=2.1.2 && <2.3: using mtl-2.2.2
Dependency old-locale ==1.0.*: using old-locale-1.0.0.7
Dependency semigroups >=0.18 && <1: using semigroups-0.19.1
Dependency text >=0.11.3.1 && <1.3: using text-1.2.4.0
Dependency time >=1.4 && <1.10: using time-1.9.3
Dependency wai >=3.0.0 && <3.3: using wai-3.2.2.1
builder for '/nix/store/mjcbv7sffywbb4d0idcdbxsj74wvq5wm-configurator-pg-0.1.0.3.drv' failed with exit code 1
cannot build derivation '/nix/store/lnfzpgfh8hbgcff8nlyczzrcgbz6lj12-postgrest-6.0.2.drv': 1 dependencies couldn't be built
error: build of '/nix/store/lnfzpgfh8hbgcff8nlyczzrcgbz6lj12-postgrest-6.0.2.drv' failed
bug haskell

Most helpful comment

I filed a PR against PostgREST that should help: https://github.com/PostgREST/postgrest/pull/1454

All 8 comments

can't see base libraries for some reason

Here's the error in question:

Setup: Encountered missing or private dependencies:
base >=4.8.2 && <4.13
...
builder for '/nix/store/mjcbv7sffywbb4d0idcdbxsj74wvq5wm-configurator-pg-0.1.0.3.drv' failed with exit code 1
...

What appears to be happening here is that configurator-pg-0.1.0.3 has a dependency on base (>=4.8.2 && <4.13), however GHC-8.8 contains base-4.13:

https://gitlab.haskell.org/ghc/ghc/wikis/commentary/libraries/version-history

The easiest way to fix this would be to get a fix upstream released (or even just a Hackage revision if that is all that is needed).

Otherwise, we could have a temporary fix here in nixpkgs.

I've uploaded a version of configurator-pg that allows base-4.13, thanks for the report.

Note that postgrest itself appears to need some bounds relaxed; the following is output from building with stack and lts-15.2:

In the dependencies for postgrest-6.0.2:
    base-4.13.0.0 from stack configuration does not match >=4.9 && <4.13  (latest matching version is 4.12.0.0)
    configurator-pg must match >=0.1 && <0.2, but the stack configuration has no specified version  (latest
                    matching version is 0.1.0.3)
    hasql-transaction-1.0.0.1 from stack configuration does not match >=0.7.2 && <0.8  (latest matching version
                              is 0.7.2)
    interpolatedstring-perl6 must match >=1 && <1.1, but the stack configuration has no specified version 
                             (latest matching version is 1.0.2)
    lens-4.18.1 from stack configuration does not match >=4.14 && <4.18  (latest matching version is 4.17.1)
    lens-aeson-1.1 from stack configuration does not match >=1.0.1 && <1.1  (latest matching version is 1.0.2)
    network-3.1.1.1 from stack configuration does not match <2.9  (latest matching version is 2.8.0.1)
    optparse-applicative-0.15.1.0 from stack configuration does not match >=0.13 && <0.15  (latest matching
                                  version is 0.14.3.0)
    regex-tdfa-1.3.1.0 from stack configuration does not match >=1.2.2 && <1.3  (latest matching version
                       is 1.2.3.2)
    swagger2-2.5 from stack configuration does not match >=2.4 && <2.5  (latest matching version is 2.4)
    time-1.9.3 from stack configuration does not match >=1.6 && <1.9  (latest matching version is 1.8.0.4)
    warp-3.3.9 from stack configuration does not match >=3.2.12 && <3.3  (latest matching version is 3.2.28)
needed since postgrest is a build target.

I filed a PR against PostgREST that should help: https://github.com/PostgREST/postgrest/pull/1454

https://github.com/PostgREST/postgrest/pull/1454 has been merged, so postgrest should be good to go.

EDIT: after the updated dependency bounds make it to hackage, I suppose

PostgREST 7.0.0 has made it to hackage, and it builds fine there with GHC 8.8. So this could now be fixed in nixpkgs (or is it fixed automatically?).

@robx The current state of the haskell-updates branch is that it still has postgrest-6.0.2:

$ cd /some/path/to/nixpkgs/
$ git checkout haskell-updates
$ nix repl ./.
nix-repl> haskellPackages.postgrest
error: Package ‘postgrest-6.0.2’ in pkgs/development/haskell-modules/hackage-packages.nix:193127 is marked as broken, refusing to evaluate.

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.

If you wait a day or so, it should be automatically updated to see the latest version of postgrest.

However, it appears that postgrest is marked broken. It will not be marked unbroken automatically, so please send a PR doing so:

https://discourse.nixos.org/t/video-tutorial-how-to-fix-broken-haskell-packages-in-nix/3968

I think marking it as no longer broken might have happened already in https://github.com/NixOS/nixpkgs/pull/85230/. Using current master, I was able to build postgrest. We can probably close this issue.

Good catch, thanks @glasserc!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Infinisil picture Infinisil  Â·  146Comments

worldofpeace picture worldofpeace  Â·  103Comments

7c6f434c picture 7c6f434c  Â·  66Comments

ttuegel picture ttuegel  Â·  98Comments

globin picture globin  Â·  65Comments