[Haskell-cafe] Troubles with PostgreSQL, Persistent and Apple M1

Geraldus heraldhoi at gmail.com
Tue Sep 21 20:47:31 UTC 2021

Hi, dear Cafe!

I'm having trouble compiling an application which uses PostgreSQL on a
macbook with an M1 chip.

Postgre itself seems to work fine.  It is installed via `homebrew` (if I'm
not mistaken this is the only way on Mac to get pg_config, which is
required for `persistent-postgresql`).  The error message is following:

persistent-postgresql> <command line>:
5): *Symbol not found: _PQclear*
persistent-postgresql>   Referenced from:
persistent-postgresql>   *Expected in: flat namespace*
persistent-postgresql>  in

The minimal setup to reproduce is following:

- base >= 4.7 && < 5
- persistent >= && < 3
- persistent-postgresql >= && < 3

Digging around gave me just a few clues.  It seems that `libpq` I have is
compiled some other way it expected, and missing some symbols required
`persistent-postgresql` to work.  I believe this is not a bug, rather that
a local configuration issue.

Does anyone know which is right setup to build persistent-postgresql on
Macs with M1 chip? Thanks in advance.


P.S. Please apologize if this is not a right place to ask such questions.
Asked already in Yesod Google Groups and Stack Overflow.  But didn't
received any feedback.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20210922/716eaaea/attachment.html>

More information about the Haskell-Cafe mailing list