gopro
gopro copied to clipboard
Postgres's dependencies is missing
During the installation process, I discovered that the installation of Postgres was necessary. Although not a significant issue, I believe it would be beneficial to include this information in the readme.md file.
Specifically, the only requirement for installation is the libpq-dev package.
Oh interesting. I wonder how hard it is to make that optional.
My build process seems to magically include it (via nix), but I'm aware some people don't use nix for some reason. :)
Trying to compile on an M1 Mac running MacOS 13.6 (Ventura). I installed libpq via Homebrew and tried to build "gopro". The entirety of my knowledge about Haskell is "I've heard of it before" so I don't really know what else to try for troubleshooting besides the below. I have the full output if you need/want it but since it's 2130+ lines and I wasn't sure whether I was successful at attaching it as a file, I'll start off just pasting the beginning and the end:
krhorer@MacBook-Pro gopro % export LDFLAGS="-L/opt/homebrew/opt/libpq/lib"
krhorer@MacBook-Pro gopro % export CPPFLAGS="-I/opt/homebrew/opt/libpq/include"
krhorer@MacBook-Pro gopro % export PKG_CONFIG_PATH="/opt/homebrew/opt/libpq/lib/pkgconfig"
krhorer@MacBook-Pro gopro % ~/.ghcup/bin/stack-2.9.3 build
Cabal file info not found for gpmf-0.2.1.0, updating
Selected mirror https://hackage.haskell.org/
Downloading root
Waiting to acquire cache lock on /Users/krhorer/.stack/pantry/hackage/hackage-security-lock
Acquired cache lock on /Users/krhorer/.stack/pantry/hackage/hackage-security-lock
Released cache lock on /Users/krhorer/.stack/pantry/hackage/hackage-security-lock
Selected mirror https://hackage.haskell.org/
Downloading timestamp
Downloading snapshot
Downloading mirrors
Cannot update index (no local copy)
Downloading index
Waiting to acquire cache lock on /Users/krhorer/.stack/pantry/hackage/hackage-security-lock
Acquired cache lock on /Users/krhorer/.stack/pantry/hackage/hackage-security-lock
Released cache lock on /Users/krhorer/.stack/pantry/hackage/hackage-security-lock
Updated package index downloaded
Calculating hashes to check for hackage-security rebases or filesystem changes
No old cache found, populating cache from scratch
Populating cache from file size 872314880, hash eb205440c569926a8f89508b484ebd216719dfa6783768dd1618e1b4d3427c69
Populating package index cache ...
Package index cache populated
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Downloaded ghc-9.2.8.
ld: unknown option: --version
ld: unknown option: --version
Installed GHC.
WARNING: Ignoring iconv's bounds on bytestring (>=0.9 && <0.10 || >=0.10 && <0.11); using bytestring-0.11.4.0.
Reason: allow-newer enabled.
[1 of 2] Compiling Main ( /Users/krhorer/.stack/setup-exe-src/setup-SvXsv1f_.hs, /Users/krhorer/.stack/setup-exe-src/setup-SvXsv1f_.o )
[2 of 2] Compiling StackSetupShim ( /Users/krhorer/.stack/setup-exe-src/setup-shim-SvXsv1f_.hs, /Users/krhorer/.stack/setup-exe-src/setup-shim-SvXsv1f_.o )
Linking /Users/krhorer/.stack/setup-exe-cache/aarch64-osx/tmp-Cabal-simple_SvXsv1f__3.6.3.0_ghc-9.2.8 ...
OneTuple > configure OneTuple > Configuring OneTuple-0.3.1... OneTuple > build Only > configure OneTuple > Preprocessing library for OneTuple-0.3.1.. OneTuple > Building library for OneTuple-0.3.1.. OneTuple > [1 of 3] Compiling Data.Tuple.Solo OneTuple > [2 of 3] Compiling Data.Tuple.OneTuple OneTuple > [3 of 3] Compiling Data.Tuple.Solo.TH Only > Configuring Only-0.1... OneTuple > copy/register OneTuple > Installing library in /Users/krhorer/.stack/snapshots/aarch64-osx/0efedd24125fc1b7c38726e8636836463f32799260c9c43978187cf4f46e3531/9.2.8/lib/aarch64-osx-ghc-9.2.8/OneTuple-0.3.1-19aagblaKIO8EaYqHzGys7
Only > build SHA > configure Only > Preprocessing library for Only-0.1.. Only > Building library for Only-0.1.. OneTuple > Registering library for OneTuple-0.3.1.. Only > [1 of 1] Compiling Data.Tuple.Only SHA > Configuring SHA-1.6.4.4... Only > copy/register Only > Installing library in /Users/krhorer/.stack/snapshots/aarch64-osx/0efedd24125fc1b7c38726e8636836463f32799260c9c43978187cf4f46e3531/9.2.8/lib/aarch64-osx-ghc-9.2.8/Only-0.1-DiaFlOQSZ1l8JCg8TmCabZ
SHA > build StateVar > configure SHA > Preprocessing library for SHA-1.6.4.4.. SHA > Building library for SHA-1.6.4.4.. Only > Registering library for Only-0.1.. SHA > [1 of 1] Compiling Data.Digest.Pure.SHA StateVar > Configuring StateVar-1.2.2... StateVar > build appar > configure appar > Warning: appar.cabal:20:37: version operators used. To use version operators
appar > the package needs to specify at least 'cabal-version: >= 1.8'.
StateVar > Preprocessing library for StateVar-1.2.2.. StateVar > Building library for StateVar-1.2.2.. StateVar > [1 of 1] Compiling Data.StateVar appar > Configuring appar-0.1.8... StateVar > copy/register StateVar > Installing library in /Users/krhorer/.stack/snapshots/aarch64-osx/0efedd24125fc1b7c38726e8636836463f32799260c9c43978187cf4f46e3531/9.2.8/lib/aarch64-osx-ghc-9.2.8/StateVar-1.2.2-4TJ8CI5wrC5B2qk02v8ZQ3
appar > build auto-update > configure appar > Preprocessing library for appar-0.1.8.. appar > Building library for appar-0.1.8.. StateVar > Registering library for StateVar-1.2.2.. appar > appar > on the commandline: warning: [-Wdeprecated-flags]
appar > -Wnoncanonical-monadfail-instances is deprecated: fail is no longer a method of Monad
appar > [1 of 5] Compiling Text.Appar.Input appar > [2 of 5] Compiling Text.Appar.Parser appar > appar > /private/var/folders/p7/sm42kntd7kd9wpcxbxc_gxk00000gn/T/stack-4a7c5e3b9a6ccbaa/appar-0.1.8/Text/Appar/Parser.hs:59:1: warning: [-Wunused-imports]
appar > The import of ‘Control.Monad.Fail’ is redundant
appar > except perhaps to import instances from ‘Control.Monad.Fail’
appar > To import instances alone, use: import Control.Monad.Fail()
appar > | appar > 59 | import Control.Monad.Fail as Fail appar > | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ auto-update > Configuring auto-update-0.1.6... appar > [3 of 5] Compiling Text.Appar.LazyByteString appar > [4 of 5] Compiling Text.Appar.ByteString appar > [5 of 5] Compiling Text.Appar.String auto-update > build base-compat > configure auto-update > Preprocessing library for auto-update-0.1.6..auto-update > Building library for auto-update-0.1.6.. auto-update > [1 of 5] Compiling Control.AutoUpdate appar > copy/register appar > Installing library in /Users/krhorer/.stack/snapshots/aarch64-osx/0efedd24125fc1b7c38726e8636836463f32799260c9c43978187cf4f46e3531/9.2.8/lib/aarch64-osx-ghc-9.2.8/appar-0.1.8-JDvnOo132BQ36taNpNc7pl
appar > Registering library for appar-0.1.8.. auto-update > [2 of 5] Compiling Control.AutoUpdate.Util base-compat > Configuring base-compat-0.12.2... auto-update > [3 of 5] Compiling Control.Debounce.Internal auto-update > [4 of 5] Compiling Control.Debounce auto-update > [5 of 5] Compiling Control.Reaper base-compat > build base-orphans > configure base-compat > Preprocessing library for base-compat-0.12.2..
base-compat > Building library for base-compat-0.12.2.. auto-update > copy/register auto-update > Installing library in /Users/krhorer/.stack/snapshots/aarch64-osx/0efedd24125fc1b7c38726e8636836463f32799260c9c43978187cf4f46e3531/9.2.8/lib/aarch64-osx-ghc-9.2.8/auto-update-0.1.6-7YK7uB2plTWJLTiUcpXP93
auto-update > Registering library for auto-update-0.1.6.. base-orphans > Configuring base-orphans-0.8.8.2... base-orphans > build base16-bytestring > configure base-orphans > Preprocessing library for base-orphans-0.8.8.2..
...
cryptonite > [129 of 136] Compiling Crypto.ECC.Simple.Prim
crypton > [134 of 136] Compiling Crypto.Data.AFIS
cryptonite > [130 of 136] Compiling Crypto.ECC
crypton > [135 of 136] Compiling Crypto.System.CPU
crypton > [136 of 136] Compiling Crypto.Tutorial
cryptonite > [131 of 136] Compiling Crypto.PubKey.EdDSA
cryptonite > [132 of 136] Compiling Crypto.PubKey.ECIES
cryptonite > [133 of 136] Compiling Crypto.PubKey.ECDSA
cryptonite > [134 of 136] Compiling Crypto.Data.AFIS
cryptonite > [135 of 136] Compiling Crypto.System.CPU
cryptonite > [136 of 136] Compiling Crypto.Tutorial
crypton > copy/register
crypton > Installing library in /Users/krhorer/.stack/snapshots/aarch64-osx/0efedd24125fc1b7c38726e8636836463f32799260c9c43978187cf4f46e3531/9.2.8/lib/aarch64-osx-ghc-9.2.8/crypton-0.33-6JGHqg4djMI56geGVGoFNc
crypton > Registering library for crypton-0.33..
cryptonite > copy/register
cryptonite > Installing library in /Users/krhorer/.stack/snapshots/aarch64-osx/0efedd24125fc1b7c38726e8636836463f32799260c9c43978187cf4f46e3531/9.2.8/lib/aarch64-osx-ghc-9.2.8/cryptonite-0.30-7l2D24WzLI0BsqaaTZK92t
cryptonite > Registering library for cryptonite-0.30..
Progress 90/248
Error: [S-7282]
Stack failed to execute the build plan.
While executing the build plan, Stack encountered the following errors:
[S-7011]
While building package postgresql-libpq-0.9.5.0 (scroll up to its section
to see the error) using:
/private/var/folders/p7/sm42kntd7kd9wpcxbxc_gxk00000gn/T/stack-4a7c5e3b9a6ccbaa/postgresql-libpq-0.9.5.0/.stack-work/dist/aarch64-osx/Cabal-3.6.3.0/setup/setup --verbose=1 --builddir=.stack-work/dist/aarch64-osx/Cabal-3.6.3.0 configure --with-ghc=/Users/krhorer/.stack/programs/aarch64-osx/ghc-9.2.8/bin/ghc-9.2.8 --with-ghc-pkg=/Users/krhorer/.stack/programs/aarch64-osx/ghc-9.2.8/bin/ghc-pkg-9.2.8 --user --package-db=clear --package-db=global --package-db=/Users/krhorer/.stack/snapshots/aarch64-osx/0efedd24125fc1b7c38726e8636836463f32799260c9c43978187cf4f46e3531/9.2.8/pkgdb --libdir=/Users/krhorer/.stack/snapshots/aarch64-osx/0efedd24125fc1b7c38726e8636836463f32799260c9c43978187cf4f46e3531/9.2.8/lib --bindir=/Users/krhorer/.stack/snapshots/aarch64-osx/0efedd24125fc1b7c38726e8636836463f32799260c9c43978187cf4f46e3531/9.2.8/bin --datadir=/Users/krhorer/.stack/snapshots/aarch64-osx/0efedd24125fc1b7c38726e8636836463f32799260c9c43978187cf4f46e3531/9.2.8/share --libexecdir=/Users/krhorer/.stack/snapshots/aarch64-osx/0efedd24125fc1b7c38726e8636836463f32799260c9c43978187cf4f46e3531/9.2.8/libexec --sysconfdir=/Users/krhorer/.stack/snapshots/aarch64-osx/0efedd24125fc1b7c38726e8636836463f32799260c9c43978187cf4f46e3531/9.2.8/etc --docdir=/Users/krhorer/.stack/snapshots/aarch64-osx/0efedd24125fc1b7c38726e8636836463f32799260c9c43978187cf4f46e3531/9.2.8/doc/postgresql-libpq-0.9.5.0 --htmldir=/Users/krhorer/.stack/snapshots/aarch64-osx/0efedd24125fc1b7c38726e8636836463f32799260c9c43978187cf4f46e3531/9.2.8/doc/postgresql-libpq-0.9.5.0 --haddockdir=/Users/krhorer/.stack/snapshots/aarch64-osx/0efedd24125fc1b7c38726e8636836463f32799260c9c43978187cf4f46e3531/9.2.8/doc/postgresql-libpq-0.9.5.0 --dependency=Cabal=Cabal-3.6.3.0 --dependency=base=base-4.16.4.0 --dependency=bytestring=bytestring-0.11.4.0 --dependency=unix=unix-2.7.2.2 -f-use-pkg-config --exact-configuration --ghc-option=-fhide-source-paths
Process exited with code: ExitFailure 1
krhorer@MacBook-Pro gopro %
I also tried using stack's --extra-lib-dirs and --extra-include-dirs options but it made no difference. Any help for this Haskell-illerate is appreciated.
Hmm... I need more Macs… I've not used homebrew in a bunch of years. Maybe I can make a temporary login and see if I can make it work with a non-global install.
I'm sure there's a way to do this, but I don't know what it is off-hand.
It seems like you need to get pg_config
in your $PATH. Alternatively, having PKG_CONFIG_PATH=$HOMEBREW/opt/postgresql@16/lib/pkgconfig (wherever you installed $HOMEBREW, maybe PKG_CONFIG_PATH=/opt/homebrew/opt/postgresql@16/lib/pkgconfig) might be what's needed.
@rhorer I just got stack install
to work and I encountered your error as well. My knowledge of Haskell is very limited just like you.
Doing some research it seemed I was missing system library libpq
so I just ran brew install libpq
and then added that to my PATH
using echo 'export PATH="/opt/homebrew/opt/libpq/bin:$PATH"' >> ~/.zshrc
Hope that helps! This repo is so cool, I've been hoping someone would figure something like this out. First project that peaks my interest in learning some Haskell :)
Thanks for confirming. I'll eventually have something with homebrew available, but it still feels a bit weird to me for my own tastes. :)
Thanks @LushS-io, your comment helped me get it working. I had already installed libpq but I had not added it to the $PATH
. I also re-cloned the repo so that may have helped as well. @dustin I see that you mentioned the path also but for some reason, that didn't register at the time I was wrestling with it in September.
just to add to this, on a fresh ubuntu install I needed to run sudo apt-get install libpq-dev
to resolve the pg_config issue!
Also wished this worked on windows ... 😭 but i made it work on WSL Ubuntu on windows 🔥