yesodweb / yesod-scaffold

The Yesod scaffolding, with branches for different versions.
MIT License
75 stars 39 forks source link

Build fails on postgres scaffolding #196

Closed ishmum123 closed 4 years ago

ishmum123 commented 4 years ago

Steps -

1) stack new my-postgres yesodweb/postgres && cd my-postgres

2) stack build

Error -

-- While building package postgresql-libpq-0.9.4.2 using: /tmp/stack2194/postgresql-libpq-0.9.4.2/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/setup/setup --builddir=.stack-work/dist/x86_64-linux/Cabal-2.4.0.1 configure --user --package-db=clear --package-db=global --package-db=/home/ishmum/.stack/snapshots/x86_64-linux/6bb64d6dbaa9062ce9d1d9bfd4866f5cb2778982d4ba69b1e6bb2e7711d7d1ee/8.6.5/pkgdb --libdir=/home/ishmum/.stack/snapshots/x86_64-linux/6bb64d6dbaa9062ce9d1d9bfd4866f5cb2778982d4ba69b1e6bb2e7711d7d1ee/8.6.5/lib --bindir=/home/ishmum/.stack/snapshots/x86_64-linux/6bb64d6dbaa9062ce9d1d9bfd4866f5cb2778982d4ba69b1e6bb2e7711d7d1ee/8.6.5/bin --datadir=/home/ishmum/.stack/snapshots/x86_64-linux/6bb64d6dbaa9062ce9d1d9bfd4866f5cb2778982d4ba69b1e6bb2e7711d7d1ee/8.6.5/share --libexecdir=/home/ishmum/.stack/snapshots/x86_64-linux/6bb64d6dbaa9062ce9d1d9bfd4866f5cb2778982d4ba69b1e6bb2e7711d7d1ee/8.6.5/libexec --sysconfdir=/home/ishmum/.stack/snapshots/x86_64-linux/6bb64d6dbaa9062ce9d1d9bfd4866f5cb2778982d4ba69b1e6bb2e7711d7d1ee/8.6.5/etc --docdir=/home/ishmum/.stack/snapshots/x86_64-linux/6bb64d6dbaa9062ce9d1d9bfd4866f5cb2778982d4ba69b1e6bb2e7711d7d1ee/8.6.5/doc/postgresql-libpq-0.9.4.2 --htmldir=/home/ishmum/.stack/snapshots/x86_64-linux/6bb64d6dbaa9062ce9d1d9bfd4866f5cb2778982d4ba69b1e6bb2e7711d7d1ee/8.6.5/doc/postgresql-libpq-0.9.4.2 --haddockdir=/home/ishmum/.stack/snapshots/x86_64-linux/6bb64d6dbaa9062ce9d1d9bfd4866f5cb2778982d4ba69b1e6bb2e7711d7d1ee/8.6.5/doc/postgresql-libpq-0.9.4.2 --dependency=Cabal=Cabal-2.4.1.0-3JC906oWQ73Ah7bYkIcI4J --dependency=base=base-4.12.0.0 --dependency=bytestring=bytestring-0.10.8.2 --dependency=unix=unix-2.7.2.2 -f-use-pkg-config --exact-configuration --ghc-option=-fhide-source-paths Process exited with code: ExitFailure 1

snoyberg commented 4 years ago

Please provide the full error log

ishmum123 commented 4 years ago

error.log

stack --version Version 2.1.3, Git revision 636e3a759d51127df2b62f90772def126cdf6d1f (7735 commits) x86_64 hpack-0.31.2

stack exec -- ghc --version The Glorious Glasgow Haskell Compilation System, version 8.6.5

snoyberg commented 4 years ago

The error is that you're missing the system libraries for building the PostgreSQL library. From your log:

postgresql-libpq          > Configuring postgresql-libpq-0.9.4.2...
postgresql-libpq          > setup: '/usr/bin/pg_config' exited with an error:
postgresql-libpq          > You need to install postgresql-server-dev-NN for building a server-side
postgresql-libpq          > extension or libpq-dev for building a client-side application.
ishmum123 commented 4 years ago

I am very sorry, I was actually looking for the error at the end of the file. Found it now