haskellari / postgresql-simple

Mid-level client library for accessing PostgreSQL from Haskell
Other
88 stars 46 forks source link

Failed to build on Windows (missing pg_config) #41

Open sharno opened 4 years ago

sharno commented 4 years ago

I'm trying to build a new stack haskell app on Windows 10 and I get this error message:

postgresql-libpq    > configure
postgresql-libpq    > [1 of 2] Compiling Main             ( C:\\Users\sharno\AppData\Local\Temp\stack-1eb9259dd9158e32\postgresql-libpq-0.9.4.2\Setup.hs, C:\\Users\sharno\AppData\Local\Temp\stack-1eb9259dd9158e32\postgresql-libpq-0.9.4.2\.stack-work\dist\29cc6475\setup\Main.o )
postgresql-libpq    > [2 of 2] Compiling StackSetupShim   ( C:\\Users\sharno\AppData\Roaming\stack\setup-exe-src\setup-shim-Z6RU0evB.hs, C:\\Users\sharno\AppData\Local\Temp\stack-1eb9259dd9158e32\postgresql-libpq-0.9.4.2\.stack-work\dist\29cc6475\setup\StackSetupShim.o )
postgresql-libpq    > Linking C:\\Users\\sharno\\AppData\\Local\\Temp\\stack-1eb9259dd9158e32\\postgresql-libpq-0.9.4.2\\.stack-work\\dist\\29cc6475\\setup\\setup.exe ...
postgresql-libpq    > Configuring postgresql-libpq-0.9.4.2...
postgresql-libpq    > setup.exe: The program 'pg_config' is required but it could not be found.
postgresql-libpq    >

--  While building package postgresql-libpq-0.9.4.2 using:
      C:\Users\sharno\AppData\Local\Temp\stack-1eb9259dd9158e32\postgresql-libpq-0.9.4.2\.stack-work\dist\29cc6475\setup\setup --builddir=.stack-work\dist\29cc6475 configure --user --package-db=clear --package-db=global --package-db=C:\Users\sharno\AppData\Roaming\stack\snapshots\6aa81d94\pkgdb --libdir=C:\Users\sharno\AppData\Roaming\stack\snapshots\6aa81d94\lib --bindir=C:\Users\sharno\AppData\Roaming\stack\snapshots\6aa81d94\bin --datadir=C:\Users\sharno\AppData\Roaming\stack\snapshots\6aa81d94\share --libexecdir=C:\Users\sharno\AppData\Roaming\stack\snapshots\6aa81d94\libexec --sysconfdir=C:\Users\sharno\AppData\Roaming\stack\snapshots\6aa81d94\etc --docdir=C:\Users\sharno\AppData\Roaming\stack\snapshots\6aa81d94\doc\postgresql-libpq-0.9.4.2 --htmldir=C:\Users\sharno\AppData\Roaming\stack\snapshots\6aa81d94\doc\postgresql-libpq-0.9.4.2 --haddockdir=C:\Users\sharno\AppData\Roaming\stack\snapshots\6aa81d94\doc\postgresql-libpq-0.9.4.2 --dependency=Cabal=Cabal-3.0.1.0 --dependency=Win32=Win32-2.6.1.0 --dependency=base=base-4.13.0.0 --dependency=bytestring=bytestring-0.10.10.0 -f-use-pkg-config --extra-include-dirs=C:\Users\sharno\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531\mingw64\include --extra-lib-dirs=C:\Users\sharno\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531\mingw64\lib --extra-lib-dirs=C:\Users\sharno\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531\mingw64\bin --exact-configuration --ghc-option=-fhide-source-paths
    Process exited with code: ExitFailure 1

Is there a way to skip the pg_config requirement? As I don't intend to install postgresql locally on this machine

arnemileswinter commented 2 years ago

you don't need to install psql, just the psql developer libraries. on arch and alpine these are called postgresql-libs. There's surely an analogue for windows