Troubles with PostgreSQL, Persistent and Apple M1

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>: dlopen(/Users/arthurfayzrakhmanov/.stack/snapshots/x86_64-osx/36432054bd8d13c1da6134758733286b536c65d34222dcf10ecb29bd437c8117/8.10.7/lib/x86_64-osx-ghc-8.10.7/libHSpostgresql-libpq-0.9.4.3-GrxZELytXmSAOH6lAioiw9-ghc8.10.7.dylib, 5): *Symbol not found: _PQclear* persistent-postgresql> Referenced from: /Users/arthurfayzrakhmanov/.stack/snapshots/x86_64-osx/36432054bd8d13c1da6134758733286b536c65d34222dcf10ecb29bd437c8117/8.10.7/lib/x86_64-osx-ghc-8.10.7/libHSpostgresql-libpq-0.9.4.3-GrxZELytXmSAOH6lAioiw9-ghc8.10.7.dylib persistent-postgresql> *Expected in: flat namespace* persistent-postgresql> in /Users/arthurfayzrakhmanov/.stack/snapshots/x86_64-osx/36432054bd8d13c1da6134758733286b536c65d34222dcf10ecb29bd437c8117/8.10.7/lib/x86_64-osx-ghc-8.10.7/libHSpostgresql-libpq-0.9.4.3-GrxZELytXmSAOH6lAioiw9-ghc8.10.7.dylib ``` The minimal setup to reproduce is following: ``` dependencies: - base >= 4.7 && < 5 - persistent >= 2.13.1.2 && < 3 - persistent-postgresql >= 2.13.1.0 && < 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. Sincerely. Arthur. 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.

which version of postgresql you are using? bmaxa@Branimirs-Air ~ % brew search postgres ==> Formulae check_postgres postgresql@10 postgresql@12 postgresql@9.5 postgrest postgis postgresql postgresql@11 postgresql@9.4 postgresql@9.6 qt-postgresql ==> Casks navicat-for-postgresql postgres-unofficial postgrespreferencepane sqlpro-for-postgres ? Greetings, Branimir.
On 21.09.2021., at 22:47, Geraldus
wrote: 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>: dlopen(/Users/arthurfayzrakhmanov/.stack/snapshots/x86_64-osx/36432054bd8d13c1da6134758733286b536c65d34222dcf10ecb29bd437c8117/8.10.7/lib/x86_64-osx-ghc-8.10.7/libHSpostgresql-libpq-0.9.4.3-GrxZELytXmSAOH6lAioiw9-ghc8.10.7.dylib, 5): Symbol not found: _PQclear persistent-postgresql> Referenced from: /Users/arthurfayzrakhmanov/.stack/snapshots/x86_64-osx/36432054bd8d13c1da6134758733286b536c65d34222dcf10ecb29bd437c8117/8.10.7/lib/x86_64-osx-ghc-8.10.7/libHSpostgresql-libpq-0.9.4.3-GrxZELytXmSAOH6lAioiw9-ghc8.10.7.dylib persistent-postgresql> Expected in: flat namespace persistent-postgresql> in /Users/arthurfayzrakhmanov/.stack/snapshots/x86_64-osx/36432054bd8d13c1da6134758733286b536c65d34222dcf10ecb29bd437c8117/8.10.7/lib/x86_64-osx-ghc-8.10.7/libHSpostgresql-libpq-0.9.4.3-GrxZELytXmSAOH6lAioiw9-ghc8.10.7.dylib ```
The minimal setup to reproduce is following:
``` dependencies: - base >= 4.7 && < 5 - persistent >= 2.13.1.2 && < 3 - persistent-postgresql >= 2.13.1.0 && < 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.
Sincerely. Arthur.
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. _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

Thank you for your response. I use 13.4: ``` arthurfayzrakhmanov@MacBook-Pro-Arthur ~/L/h/pg001> brew search postgres ==> Formulae check_postgres postgresql@11 postgresql@9.5 qt-postgresql postgresql ✔ postgresql@12 postgresql@9.6 postgis postgresql@10 postgresql@9.4 postgrest ==> Casks navicat-for-postgresql postgrespreferencepane postgres-unofficial sqlpro-for-postgres arthurfayzrakhmanov@MacBook-Pro-Arthur ~/L/h/pg001> psql --version psql (PostgreSQL) 13.4 ``` ср, 22 сент. 2021 г. в 01:55, Branimir Maksimovic < branimir.maksimovic@gmail.com>:
which version of postgresql you are using? bmaxa@Branimirs-Air ~ % brew search postgres ==> Formulae check_postgres postgresql@10 postgresql@12 postgresql@9.5 postgrest postgis postgresql postgresql@11 postgresql@9.4 postgresql@9.6 qt-postgresql ==> Casks navicat-for-postgresql postgres-unofficial postgrespreferencepane sqlpro-for-postgres
?
Greetings, Branimir.
On 21.09.2021., at 22:47, Geraldus
wrote: 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>: dlopen(/Users/arthurfayzrakhmanov/.stack/snapshots/x86_64-osx/36432054bd8d13c1da6134758733286b536c65d34222dcf10ecb29bd437c8117/8.10.7/lib/x86_64-osx-ghc-8.10.7/libHSpostgresql-libpq-0.9.4.3-GrxZELytXmSAOH6lAioiw9-ghc8.10.7.dylib, 5): *Symbol not found: _PQclear* persistent-postgresql> Referenced from: /Users/arthurfayzrakhmanov/.stack/snapshots/x86_64-osx/36432054bd8d13c1da6134758733286b536c65d34222dcf10ecb29bd437c8117/8.10.7/lib/x86_64-osx-ghc-8.10.7/libHSpostgresql-libpq-0.9.4.3-GrxZELytXmSAOH6lAioiw9-ghc8.10.7.dylib persistent-postgresql> *Expected in: flat namespace* persistent-postgresql> in /Users/arthurfayzrakhmanov/.stack/snapshots/x86_64-osx/36432054bd8d13c1da6134758733286b536c65d34222dcf10ecb29bd437c8117/8.10.7/lib/x86_64-osx-ghc-8.10.7/libHSpostgresql-libpq-0.9.4.3-GrxZELytXmSAOH6lAioiw9-ghc8.10.7.dylib ```
The minimal setup to reproduce is following:
``` dependencies: - base >= 4.7 && < 5 - persistent >= 2.13.1.2 && < 3 - persistent-postgresql >= 2.13.1.0 && < 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.
Sincerely. Arthur.
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. _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

Seems builds no problem… To start postgresql: brew services start postgresql Or, if you don't want/need a background service you can just run: /opt/homebrew/opt/postgresql/bin/postgres -D /opt/homebrew/var/postgres bmaxa@Branimirs-Air ~ % cabal install persistent-postgresql Warning: The package list for 'hackage.haskell.org' is 69 days old. Run 'cabal update' to get the latest list of available packages. Warning: The package list for 'hackage.haskell.org' is 69 days old. Run 'cabal update' to get the latest list of available packages. Resolving dependencies... Build profile: -w ghc-8.10.7 -O1 In order, the following will be built (use -v for more details): - Only-0.1 (lib) (requires build) - blaze-builder-0.4.2.1 (lib) (requires download & build) - base-compat-0.11.2 (lib) (requires build) - base-orphans-0.8.4 (lib) (requires build) - base64-bytestring-1.2.0.1 (lib) (requires download & build) - bytestring-builder-0.10.8.2.0 (lib) (requires download & build) - dlist-1.0 (lib) (requires build) - data-default-class-0.1.2.0 (lib:data-default-class) (requires build) - hsc2hs-0.68.7 (exe:hsc2hs) (requires build) - hashable-1.3.2.0 (lib) (requires build) - old-locale-1.0.0.7 (lib) (requires download & build) - lift-type-0.1.0.1 (lib) (requires download & build) - monad-loops-0.4.3 (lib) (requires download & build) - indexed-traversable-0.1.1 (lib) (requires build) - unliftio-core-0.2.0.1 (lib) (requires download & build) - integer-logarithms-1.0.3.1 (lib) (requires build) - unix-compat-0.5.3 (lib) (requires download & build) - primitive-0.7.1.0 (lib) (requires build) - path-pieces-0.2.1 (lib) (requires download & build) - silently-1.2.5.1 (lib) (requires download & build) - split-0.2.3.4 (lib) (requires download & build) - splitmix-0.1.0.3 (lib) (requires build) - stm-chans-3.0.0.4 (lib:stm-chans) (requires download & build) - easy-file-0.2.2 (lib:easy-file) (requires download & build) - auto-update-0.1.6 (lib) (requires download & build) - utf8-string-1.0.2 (lib) (requires download & build) - tagged-0.8.6.1 (lib) (requires build) - th-abstraction-0.4.2.0 (lib) (requires build) - transformers-compat-0.6.6 (lib) (requires build) - zlib-0.6.2.3 (lib) (requires download & build) - blaze-markup-0.8.2.8 (lib) (requires download & build) - base-compat-batteries-0.11.2 (lib) (requires build) - cookie-0.4.5 (lib) (requires download & build) - postgresql-libpq-0.9.4.3 (lib:postgresql-libpq) (requires download & build) - network-3.1.2.2 (lib:network) (requires download & build) - time-compat-1.9.6 (lib) (requires build) - async-2.2.3 (lib) (requires build) - unordered-containers-0.2.14.0 (lib) (requires build) - data-fix-0.3.1 (lib) (requires build) - case-insensitive-1.2.1.0 (lib) (requires download & build) - old-time-1.1.0.3 (lib:old-time) (requires download & build) - vector-0.12.3.0 (lib) (requires build) - scientific-0.3.7.0 (lib) (requires build) - resourcet-1.2.4.2 (lib) (requires download & build) - random-1.2.0 (lib) (requires build) - string-conversions-0.4.0.1 (lib) (requires download & build) - distributive-0.6.2.1 (lib) (requires build) - th-lift-0.8.2 (lib) (requires download & build) - transformers-base-0.4.5.2 (lib) (requires download & build) - blaze-html-0.9.1.2 (lib) (requires download & build) - typed-process-0.2.6.0 (lib) (requires download & build) - unliftio-0.2.18 (lib) (requires download & build) - http-types-0.12.3 (lib) (requires download & build) - unix-time-0.4.7 (lib:unix-time) (requires download & build) - vector-algorithms-0.8.0.4 (lib) (requires build) - attoparsec-0.14.1 (lib) (requires build) - streaming-commons-0.2.2.1 (lib) (requires download & build) - uuid-types-1.0.5 (lib) (requires build) - comonad-5.0.8 (lib) (requires build) - th-lift-instances-0.1.18 (lib) (requires download & build) - monad-control-1.0.2.3 (lib:monad-control) (requires download & build) - fast-logger-3.0.5 (lib) (requires download & build) - mono-traversable-1.0.15.1 (lib) (requires download & build) - attoparsec-iso8601-1.0.2.0 (lib) (requires download & build) - bifunctors-5.5.11 (lib) (requires build) - resource-pool-0.2.3.2 (lib) (requires download & build) - lifted-base-0.2.3.12 (lib) (requires download & build) - conduit-1.3.4.1 (lib) (requires download & build) - http-api-data-0.4.3 (lib) (requires download & build) - assoc-1.0.2 (lib) (requires build) - conduit-extra-1.3.5 (lib) (requires download & build) - these-1.1.1.1 (lib) (requires build) - monad-logger-0.3.36 (lib) (requires download & build) - strict-0.4.0.1 (lib) (requires build) - aeson-1.5.6.0 (lib) (requires build) - postgresql-simple-0.6.4 (lib) (requires download & build) - persistent-2.13.1.1 (lib) (requires download & build) - persistent-postgresql-2.13.0.3 (lib) (requires download & build) Downloading old-locale-1.0.0.7 Starting base-orphans-0.8.4 (lib) Starting data-default-class-0.1.2.0 (all, legacy fallback) Starting dlist-1.0 (lib) Starting Only-0.1 (lib) Starting base-compat-0.11.2 (lib) Building dlist-1.0 (lib) Building data-default-class-0.1.2.0 (all, legacy fallback) Building base-compat-0.11.2 (lib) Building base-orphans-0.8.4 (lib) Building Only-0.1 (lib) Downloaded old-locale-1.0.0.7 Downloading old-time-1.1.0.3 Installing data-default-class-0.1.2.0 (all, legacy fallback) Installing Only-0.1 (lib) Completed data-default-class-0.1.2.0 (all, legacy fallback) Starting hsc2hs-0.68.7 (exe:hsc2hs) Downloaded old-time-1.1.0.3 Downloading monad-loops-0.4.3 Completed Only-0.1 (lib) Starting hashable-1.3.2.0 (lib) Downloaded monad-loops-0.4.3 Downloading split-0.2.3.4 Building hsc2hs-0.68.7 (exe:hsc2hs) Building hashable-1.3.2.0 (lib) Downloaded split-0.2.3.4 Downloading auto-update-0.1.6 Downloaded auto-update-0.1.6 Downloading unliftio-core-0.2.0.1 Downloaded unliftio-core-0.2.0.1 Downloading base64-bytestring-1.2.0.1 Installing dlist-1.0 (lib) Completed dlist-1.0 (lib) Starting old-locale-1.0.0.7 (lib) Downloaded base64-bytestring-1.2.0.1 Downloading utf8-string-1.0.2 Starting base64-bytestring-1.2.0.1 (lib) Building old-locale-1.0.0.7 (lib) Downloaded utf8-string-1.0.2 Downloading zlib-0.6.2.3 Building base64-bytestring-1.2.0.1 (lib) Installing base-orphans-0.8.4 (lib) Downloaded zlib-0.6.2.3 Downloading bytestring-builder-0.10.8.2.0 Completed base-orphans-0.8.4 (lib) Installing old-locale-1.0.0.7 (lib) Downloaded bytestring-builder-0.10.8.2.0 Downloading lift-type-0.1.0.1 Starting bytestring-builder-0.10.8.2.0 (lib) Installing hashable-1.3.2.0 (lib) Completed old-locale-1.0.0.7 (lib) Starting monad-loops-0.4.3 (lib) Completed hashable-1.3.2.0 (lib) Starting indexed-traversable-0.1.1 (lib) Downloaded lift-type-0.1.0.1 Downloading th-lift-0.8.2 Building bytestring-builder-0.10.8.2.0 (lib) Starting lift-type-0.1.0.1 (lib) Installing bytestring-builder-0.10.8.2.0 (lib) Building monad-loops-0.4.3 (lib) Completed bytestring-builder-0.10.8.2.0 (lib) Starting unliftio-core-0.2.0.1 (lib) Building indexed-traversable-0.1.1 (lib) Downloaded th-lift-0.8.2 Downloading silently-1.2.5.1 Building lift-type-0.1.0.1 (lib) Installing base64-bytestring-1.2.0.1 (lib) Building unliftio-core-0.2.0.1 (lib) Completed base64-bytestring-1.2.0.1 (lib) Starting integer-logarithms-1.0.3.1 (lib) Downloaded silently-1.2.5.1 Downloading unix-compat-0.5.3 Installing lift-type-0.1.0.1 (lib) Completed lift-type-0.1.0.1 (lib) Downloaded unix-compat-0.5.3 Downloading network-3.1.2.2 Building integer-logarithms-1.0.3.1 (lib) Starting unix-compat-0.5.3 (lib) Installing unliftio-core-0.2.0.1 (lib) Completed unliftio-core-0.2.0.1 (lib) Starting primitive-0.7.1.0 (lib) Downloaded network-3.1.2.2 Downloading unix-time-0.4.7 Building unix-compat-0.5.3 (lib) Installing monad-loops-0.4.3 (lib) Completed monad-loops-0.4.3 (lib) Building primitive-0.7.1.0 (lib) Downloaded unix-time-0.4.7 Downloading easy-file-0.2.2 Downloaded easy-file-0.2.2 Downloading resourcet-1.2.4.2 Downloaded resourcet-1.2.4.2 Downloading transformers-base-0.4.5.2 Installing integer-logarithms-1.0.3.1 (lib) Completed integer-logarithms-1.0.3.1 (lib) Starting silently-1.2.5.1 (lib) Downloaded transformers-base-0.4.5.2 Downloading monad-control-1.0.2.3 Installing unix-compat-0.5.3 (lib) Building silently-1.2.5.1 (lib) Completed unix-compat-0.5.3 (lib) Starting split-0.2.3.4 (lib) Downloaded monad-control-1.0.2.3 Downloading lifted-base-0.2.3.12 Downloaded lifted-base-0.2.3.12 Downloading blaze-builder-0.4.2.1 Installing silently-1.2.5.1 (lib) Building split-0.2.3.4 (lib) Completed silently-1.2.5.1 (lib) Starting splitmix-0.1.0.3 (lib) Installing hsc2hs-0.68.7 (exe:hsc2hs) Downloaded blaze-builder-0.4.2.1 Downloading blaze-markup-0.8.2.8 Completed hsc2hs-0.68.7 (exe:hsc2hs) Starting blaze-builder-0.4.2.1 (lib) Building splitmix-0.1.0.3 (lib) Downloaded blaze-markup-0.8.2.8 Downloading blaze-html-0.9.1.2 Installing indexed-traversable-0.1.1 (lib) Building blaze-builder-0.4.2.1 (lib) Completed indexed-traversable-0.1.1 (lib) Starting easy-file-0.2.2 (all, legacy fallback) Downloaded blaze-html-0.9.1.2 Downloading cookie-0.4.5 Installing split-0.2.3.4 (lib) Completed split-0.2.3.4 (lib) Starting auto-update-0.1.6 (lib) Building easy-file-0.2.2 (all, legacy fallback) Downloaded cookie-0.4.5 Downloading fast-logger-3.0.5 Building auto-update-0.1.6 (lib) Downloaded fast-logger-3.0.5 Downloading case-insensitive-1.2.1.0 Downloaded case-insensitive-1.2.1.0 Downloading resource-pool-0.2.3.2 Installing splitmix-0.1.0.3 (lib) Installing base-compat-0.11.2 (lib) Completed splitmix-0.1.0.3 (lib) Starting utf8-string-1.0.2 (lib) Completed base-compat-0.11.2 (lib) Starting tagged-0.8.6.1 (lib) Installing easy-file-0.2.2 (all, legacy fallback) Downloaded resource-pool-0.2.3.2 Downloading unliftio-0.2.18 Completed easy-file-0.2.2 (all, legacy fallback) Starting th-abstraction-0.4.2.0 (lib) Installing auto-update-0.1.6 (lib) Building utf8-string-1.0.2 (lib) Completed auto-update-0.1.6 (lib) Starting transformers-compat-0.6.6 (lib) Building tagged-0.8.6.1 (lib) Downloaded unliftio-0.2.18 Downloading typed-process-0.2.6.0 Building th-abstraction-0.4.2.0 (lib) Downloaded typed-process-0.2.6.0 Downloading http-types-0.12.3 Building transformers-compat-0.6.6 (lib) Downloaded http-types-0.12.3 Downloading mono-traversable-1.0.15.1 Downloaded mono-traversable-1.0.15.1 Downloading conduit-1.3.4.1 Downloaded conduit-1.3.4.1 Downloading path-pieces-0.2.1 Downloaded path-pieces-0.2.1 Downloading streaming-commons-0.2.2.1 Starting path-pieces-0.2.1 (lib) Installing blaze-builder-0.4.2.1 (lib) Downloaded streaming-commons-0.2.2.1 Downloading string-conversions-0.4.0.1 Completed blaze-builder-0.4.2.1 (lib) Installing tagged-0.8.6.1 (lib) Starting zlib-0.6.2.3 (lib) Completed tagged-0.8.6.1 (lib) Starting cookie-0.4.5 (lib) Building path-pieces-0.2.1 (lib) Downloaded string-conversions-0.4.0.1 Downloading th-lift-instances-0.1.18 Downloaded th-lift-instances-0.1.18 Downloading conduit-extra-1.3.5 Building zlib-0.6.2.3 (lib) Building cookie-0.4.5 (lib) Installing transformers-compat-0.6.6 (lib) Downloaded conduit-extra-1.3.5 Downloading attoparsec-iso8601-1.0.2.0 Completed transformers-compat-0.6.6 (lib) Starting old-time-1.1.0.3 (all, legacy fallback) Downloaded attoparsec-iso8601-1.0.2.0 Downloading http-api-data-0.4.3 Downloaded http-api-data-0.4.3 Downloading postgresql-libpq-0.9.4.3 Downloaded postgresql-libpq-0.9.4.3 Downloading postgresql-simple-0.6.4 Installing path-pieces-0.2.1 (lib) Completed path-pieces-0.2.1 (lib) Starting time-compat-1.9.6 (lib) Downloaded postgresql-simple-0.6.4 Downloading stm-chans-3.0.0.4 Installing cookie-0.4.5 (lib) Downloaded stm-chans-3.0.0.4 Downloading monad-logger-0.3.36 Starting stm-chans-3.0.0.4 (all, legacy fallback) Installing utf8-string-1.0.2 (lib) Completed cookie-0.4.5 (lib) Starting async-2.2.3 (lib) Building time-compat-1.9.6 (lib) Completed utf8-string-1.0.2 (lib) Starting unordered-containers-0.2.14.0 (lib) Downloaded monad-logger-0.3.36 Downloading persistent-2.13.1.1 Downloaded persistent-2.13.1.1 Downloading persistent-postgresql-2.13.0.3 Building async-2.2.3 (lib) Building unordered-containers-0.2.14.0 (lib) Downloaded persistent-postgresql-2.13.0.3 Building old-time-1.1.0.3 (all, legacy fallback) Installing async-2.2.3 (lib) Installing primitive-0.7.1.0 (lib) Completed async-2.2.3 (lib) Starting data-fix-0.3.1 (lib) Completed primitive-0.7.1.0 (lib) Starting case-insensitive-1.2.1.0 (lib) Building data-fix-0.3.1 (lib) Building case-insensitive-1.2.1.0 (lib) Building stm-chans-3.0.0.4 (all, legacy fallback) Installing th-abstraction-0.4.2.0 (lib) Completed th-abstraction-0.4.2.0 (lib) Starting postgresql-libpq-0.9.4.3 (all, legacy fallback) Installing case-insensitive-1.2.1.0 (lib) Installing data-fix-0.3.1 (lib) Completed case-insensitive-1.2.1.0 (lib) Starting network-3.1.2.2 (all, legacy fallback) Completed data-fix-0.3.1 (lib) Starting random-1.2.0 (lib) Installing zlib-0.6.2.3 (lib) Completed zlib-0.6.2.3 (lib) Starting base-compat-batteries-0.11.2 (lib) Building random-1.2.0 (lib) Building base-compat-batteries-0.11.2 (lib) Installing old-time-1.1.0.3 (all, legacy fallback) Installing time-compat-1.9.6 (lib) Installing stm-chans-3.0.0.4 (all, legacy fallback) Completed old-time-1.1.0.3 (all, legacy fallback) Starting blaze-markup-0.8.2.8 (lib) Completed time-compat-1.9.6 (lib) Starting distributive-0.6.2.1 (lib) Completed stm-chans-3.0.0.4 (all, legacy fallback) Building blaze-markup-0.8.2.8 (lib) Starting transformers-base-0.4.5.2 (lib) Building distributive-0.6.2.1 (lib) Building transformers-base-0.4.5.2 (lib) Building postgresql-libpq-0.9.4.3 (all, legacy fallback) Installing distributive-0.6.2.1 (lib) Installing transformers-base-0.4.5.2 (lib) Building network-3.1.2.2 (all, legacy fallback) Completed distributive-0.6.2.1 (lib) Starting string-conversions-0.4.0.1 (lib) Completed transformers-base-0.4.5.2 (lib) Starting typed-process-0.2.6.0 (lib) Building string-conversions-0.4.0.1 (lib) Building typed-process-0.2.6.0 (lib) Installing string-conversions-0.4.0.1 (lib) Completed string-conversions-0.4.0.1 (lib) Starting unliftio-0.2.18 (lib) Building unliftio-0.2.18 (lib) Installing typed-process-0.2.6.0 (lib) Completed typed-process-0.2.6.0 (lib) Starting vector-0.12.3.0 (lib) Building vector-0.12.3.0 (lib) Installing postgresql-libpq-0.9.4.3 (all, legacy fallback) Completed postgresql-libpq-0.9.4.3 (all, legacy fallback) Starting scientific-0.3.7.0 (lib) Building scientific-0.3.7.0 (lib) Installing blaze-markup-0.8.2.8 (lib) Completed blaze-markup-0.8.2.8 (lib) Starting resourcet-1.2.4.2 (lib) Installing random-1.2.0 (lib) Building resourcet-1.2.4.2 (lib) Completed random-1.2.0 (lib) Starting th-lift-0.8.2 (lib) Building th-lift-0.8.2 (lib) Installing unordered-containers-0.2.14.0 (lib) Completed unordered-containers-0.2.14.0 (lib) Starting http-types-0.12.3 (lib) Building http-types-0.12.3 (lib) Installing th-lift-0.8.2 (lib) Completed th-lift-0.8.2 (lib) Starting unix-time-0.4.7 (all, legacy fallback) Installing base-compat-batteries-0.11.2 (lib) Installing resourcet-1.2.4.2 (lib) Completed base-compat-batteries-0.11.2 (lib) Starting comonad-5.0.8 (lib) Completed resourcet-1.2.4.2 (lib) Starting monad-control-1.0.2.3 (all, legacy fallback) Building comonad-5.0.8 (lib) Building monad-control-1.0.2.3 (all, legacy fallback) Installing unliftio-0.2.18 (lib) Installing monad-control-1.0.2.3 (all, legacy fallback) Completed unliftio-0.2.18 (lib) Starting blaze-html-0.9.1.2 (lib) Building unix-time-0.4.7 (all, legacy fallback) Completed monad-control-1.0.2.3 (all, legacy fallback) Starting uuid-types-1.0.5 (lib) Building blaze-html-0.9.1.2 (lib) Building uuid-types-1.0.5 (lib) Installing scientific-0.3.7.0 (lib) Completed scientific-0.3.7.0 (lib) Starting lifted-base-0.2.3.12 (lib) Building lifted-base-0.2.3.12 (lib) Installing network-3.1.2.2 (all, legacy fallback) Completed network-3.1.2.2 (all, legacy fallback) Installing http-types-0.12.3 (lib) Installing unix-time-0.4.7 (all, legacy fallback) Starting attoparsec-0.14.1 (lib) Completed http-types-0.12.3 (lib) Starting streaming-commons-0.2.2.1 (lib) Completed unix-time-0.4.7 (all, legacy fallback) Starting fast-logger-3.0.5 (lib) Building attoparsec-0.14.1 (lib) Building streaming-commons-0.2.2.1 (lib) Building fast-logger-3.0.5 (lib) Installing comonad-5.0.8 (lib) Completed comonad-5.0.8 (lib) Starting bifunctors-5.5.11 (lib) Installing lifted-base-0.2.3.12 (lib) Completed lifted-base-0.2.3.12 (lib) Installing uuid-types-1.0.5 (lib) Completed uuid-types-1.0.5 (lib) Building bifunctors-5.5.11 (lib) Installing fast-logger-3.0.5 (lib) Completed fast-logger-3.0.5 (lib) Installing streaming-commons-0.2.2.1 (lib) Completed streaming-commons-0.2.2.1 (lib) Installing bifunctors-5.5.11 (lib) Completed bifunctors-5.5.11 (lib) Starting assoc-1.0.2 (lib) Building assoc-1.0.2 (lib) Installing assoc-1.0.2 (lib) Completed assoc-1.0.2 (lib) Starting these-1.1.1.1 (lib) Building these-1.1.1.1 (lib) Installing these-1.1.1.1 (lib) Completed these-1.1.1.1 (lib) Starting strict-0.4.0.1 (lib) Building strict-0.4.0.1 (lib) Installing blaze-html-0.9.1.2 (lib) Completed blaze-html-0.9.1.2 (lib) Installing strict-0.4.0.1 (lib) Completed strict-0.4.0.1 (lib) Installing attoparsec-0.14.1 (lib) Completed attoparsec-0.14.1 (lib) Starting attoparsec-iso8601-1.0.2.0 (lib) Building attoparsec-iso8601-1.0.2.0 (lib) Installing attoparsec-iso8601-1.0.2.0 (lib) Completed attoparsec-iso8601-1.0.2.0 (lib) Starting http-api-data-0.4.3 (lib) Building http-api-data-0.4.3 (lib) Installing http-api-data-0.4.3 (lib) Completed http-api-data-0.4.3 (lib) Installing vector-0.12.3.0 (lib) Completed vector-0.12.3.0 (lib) Starting th-lift-instances-0.1.18 (lib) Starting resource-pool-0.2.3.2 (lib) Starting vector-algorithms-0.8.0.4 (lib) Starting aeson-1.5.6.0 (lib) Building vector-algorithms-0.8.0.4 (lib) Building resource-pool-0.2.3.2 (lib) Building th-lift-instances-0.1.18 (lib) Building aeson-1.5.6.0 (lib) Installing th-lift-instances-0.1.18 (lib) Completed th-lift-instances-0.1.18 (lib) Installing resource-pool-0.2.3.2 (lib) Completed resource-pool-0.2.3.2 (lib) Installing vector-algorithms-0.8.0.4 (lib) Completed vector-algorithms-0.8.0.4 (lib) Starting mono-traversable-1.0.15.1 (lib) Building mono-traversable-1.0.15.1 (lib) Installing mono-traversable-1.0.15.1 (lib) Completed mono-traversable-1.0.15.1 (lib) Starting conduit-1.3.4.1 (lib) Building conduit-1.3.4.1 (lib) Installing conduit-1.3.4.1 (lib) Completed conduit-1.3.4.1 (lib) Starting conduit-extra-1.3.5 (lib) Building conduit-extra-1.3.5 (lib) Installing conduit-extra-1.3.5 (lib) Completed conduit-extra-1.3.5 (lib) Starting monad-logger-0.3.36 (lib) Building monad-logger-0.3.36 (lib) Installing monad-logger-0.3.36 (lib) Completed monad-logger-0.3.36 (lib) Installing aeson-1.5.6.0 (lib) Completed aeson-1.5.6.0 (lib) Starting postgresql-simple-0.6.4 (lib) Starting persistent-2.13.1.1 (lib) Building persistent-2.13.1.1 (lib) Building postgresql-simple-0.6.4 (lib) Installing postgresql-simple-0.6.4 (lib) Completed postgresql-simple-0.6.4 (lib) Installing persistent-2.13.1.1 (lib) Completed persistent-2.13.1.1 (lib) Starting persistent-postgresql-2.13.0.3 (lib) Building persistent-postgresql-2.13.0.3 (lib) Installing persistent-postgresql-2.13.0.3 (lib) Completed persistent-postgresql-2.13.0.3 (lib) Warning: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: Installation might not be completed as desired! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ The command "cabal install [TARGETS]" doesn't expose libraries. * You might have wanted to add them as dependencies to your package. In this case add "persistent-postgresql" to the build-depends field(s) of your package's .cabal file. * You might have wanted to add them to a GHC environment. In this case use "cabal install --lib persistent-postgresql". The "--lib" flag is provisional: see https://github.com/haskell/cabal/issues/6481 for more information. bmaxa@Branimirs-Air ~ % cabal install --lib persistent-postgresql Warning: The package list for 'hackage.haskell.org' is 69 days old. Run 'cabal update' to get the latest list of available packages. Warning: The package list for 'hackage.haskell.org' is 69 days old. Run 'cabal update' to get the latest list of available packages. Resolving dependencies... Up to date bmaxa@Branimirs-Air ~ % Greetings, Branimir.
On 21.09.2021., at 22:59, Geraldus
wrote: Thank you for your response.
I use 13.4:
``` arthurfayzrakhmanov@MacBook-Pro-Arthur ~/L/h/pg001> brew search postgres ==> Formulae check_postgres postgresql@11 postgresql@9.5 qt-postgresql postgresql ✔ postgresql@12 postgresql@9.6 postgis postgresql@10 postgresql@9.4 postgrest ==> Casks navicat-for-postgresql postgrespreferencepane postgres-unofficial sqlpro-for-postgres arthurfayzrakhmanov@MacBook-Pro-Arthur ~/L/h/pg001> psql --version psql (PostgreSQL) 13.4 ```
ср, 22 сент. 2021 г. в 01:55, Branimir Maksimovic
mailto:branimir.maksimovic@gmail.com>: which version of postgresql you are using? bmaxa@Branimirs-Air ~ % brew search postgres ==> Formulae check_postgres postgresql@10 postgresql@12 postgresql@9.5 postgrest postgis postgresql postgresql@11 postgresql@9.4 postgresql@9.6 qt-postgresql ==> Casks navicat-for-postgresql postgres-unofficial postgrespreferencepane sqlpro-for-postgres ?
Greetings, Branimir.
On 21.09.2021., at 22:47, Geraldus
mailto:heraldhoi@gmail.com> wrote: 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>: dlopen(/Users/arthurfayzrakhmanov/.stack/snapshots/x86_64-osx/36432054bd8d13c1da6134758733286b536c65d34222dcf10ecb29bd437c8117/8.10.7/lib/x86_64-osx-ghc-8.10.7/libHSpostgresql-libpq-0.9.4.3-GrxZELytXmSAOH6lAioiw9-ghc8.10.7.dylib, 5): Symbol not found: _PQclear persistent-postgresql> Referenced from: /Users/arthurfayzrakhmanov/.stack/snapshots/x86_64-osx/36432054bd8d13c1da6134758733286b536c65d34222dcf10ecb29bd437c8117/8.10.7/lib/x86_64-osx-ghc-8.10.7/libHSpostgresql-libpq-0.9.4.3-GrxZELytXmSAOH6lAioiw9-ghc8.10.7.dylib persistent-postgresql> Expected in: flat namespace persistent-postgresql> in /Users/arthurfayzrakhmanov/.stack/snapshots/x86_64-osx/36432054bd8d13c1da6134758733286b536c65d34222dcf10ecb29bd437c8117/8.10.7/lib/x86_64-osx-ghc-8.10.7/libHSpostgresql-libpq-0.9.4.3-GrxZELytXmSAOH6lAioiw9-ghc8.10.7.dylib ```
The minimal setup to reproduce is following:
``` dependencies: - base >= 4.7 && < 5 - persistent >= 2.13.1.2 && < 3 - persistent-postgresql >= 2.13.1.0 && < 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.
Sincerely. Arthur.
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. _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

Awesome, thanks! I got used to relying on stack and not installing system-wide GHC. Is it possible to achieve the same with `stack`? ср, 22 сент. 2021 г. в 03:08, Branimir Maksimovic < branimir.maksimovic@gmail.com>:
Seems builds no problem… To start postgresql: brew services start postgresql Or, if you don't want/need a background service you can just run: /opt/homebrew/opt/postgresql/bin/postgres -D /opt/homebrew/var/postgres bmaxa@Branimirs-Air ~ % cabal install persistent-postgresql Warning: The package list for 'hackage.haskell.org' is 69 days old. Run 'cabal update' to get the latest list of available packages. Warning: The package list for 'hackage.haskell.org' is 69 days old. Run 'cabal update' to get the latest list of available packages. Resolving dependencies... Build profile: -w ghc-8.10.7 -O1 In order, the following will be built (use -v for more details): - Only-0.1 (lib) (requires build) - blaze-builder-0.4.2.1 (lib) (requires download & build) - base-compat-0.11.2 (lib) (requires build) - base-orphans-0.8.4 (lib) (requires build) - base64-bytestring-1.2.0.1 (lib) (requires download & build) - bytestring-builder-0.10.8.2.0 (lib) (requires download & build) - dlist-1.0 (lib) (requires build) - data-default-class-0.1.2.0 (lib:data-default-class) (requires build) - hsc2hs-0.68.7 (exe:hsc2hs) (requires build) - hashable-1.3.2.0 (lib) (requires build) - old-locale-1.0.0.7 (lib) (requires download & build) - lift-type-0.1.0.1 (lib) (requires download & build) - monad-loops-0.4.3 (lib) (requires download & build) - indexed-traversable-0.1.1 (lib) (requires build) - unliftio-core-0.2.0.1 (lib) (requires download & build) - integer-logarithms-1.0.3.1 (lib) (requires build) - unix-compat-0.5.3 (lib) (requires download & build) - primitive-0.7.1.0 (lib) (requires build) - path-pieces-0.2.1 (lib) (requires download & build) - silently-1.2.5.1 (lib) (requires download & build) - split-0.2.3.4 (lib) (requires download & build) - splitmix-0.1.0.3 (lib) (requires build) - stm-chans-3.0.0.4 (lib:stm-chans) (requires download & build) - easy-file-0.2.2 (lib:easy-file) (requires download & build) - auto-update-0.1.6 (lib) (requires download & build) - utf8-string-1.0.2 (lib) (requires download & build) - tagged-0.8.6.1 (lib) (requires build) - th-abstraction-0.4.2.0 (lib) (requires build) - transformers-compat-0.6.6 (lib) (requires build) - zlib-0.6.2.3 (lib) (requires download & build) - blaze-markup-0.8.2.8 (lib) (requires download & build) - base-compat-batteries-0.11.2 (lib) (requires build) - cookie-0.4.5 (lib) (requires download & build) - postgresql-libpq-0.9.4.3 (lib:postgresql-libpq) (requires download & build) - network-3.1.2.2 (lib:network) (requires download & build) - time-compat-1.9.6 (lib) (requires build) - async-2.2.3 (lib) (requires build) - unordered-containers-0.2.14.0 (lib) (requires build) - data-fix-0.3.1 (lib) (requires build) - case-insensitive-1.2.1.0 (lib) (requires download & build) - old-time-1.1.0.3 (lib:old-time) (requires download & build) - vector-0.12.3.0 (lib) (requires build) - scientific-0.3.7.0 (lib) (requires build) - resourcet-1.2.4.2 (lib) (requires download & build) - random-1.2.0 (lib) (requires build) - string-conversions-0.4.0.1 (lib) (requires download & build) - distributive-0.6.2.1 (lib) (requires build) - th-lift-0.8.2 (lib) (requires download & build) - transformers-base-0.4.5.2 (lib) (requires download & build) - blaze-html-0.9.1.2 (lib) (requires download & build) - typed-process-0.2.6.0 (lib) (requires download & build) - unliftio-0.2.18 (lib) (requires download & build) - http-types-0.12.3 (lib) (requires download & build) - unix-time-0.4.7 (lib:unix-time) (requires download & build) - vector-algorithms-0.8.0.4 (lib) (requires build) - attoparsec-0.14.1 (lib) (requires build) - streaming-commons-0.2.2.1 (lib) (requires download & build) - uuid-types-1.0.5 (lib) (requires build) - comonad-5.0.8 (lib) (requires build) - th-lift-instances-0.1.18 (lib) (requires download & build) - monad-control-1.0.2.3 (lib:monad-control) (requires download & build) - fast-logger-3.0.5 (lib) (requires download & build) - mono-traversable-1.0.15.1 (lib) (requires download & build) - attoparsec-iso8601-1.0.2.0 (lib) (requires download & build) - bifunctors-5.5.11 (lib) (requires build) - resource-pool-0.2.3.2 (lib) (requires download & build) - lifted-base-0.2.3.12 (lib) (requires download & build) - conduit-1.3.4.1 (lib) (requires download & build) - http-api-data-0.4.3 (lib) (requires download & build) - assoc-1.0.2 (lib) (requires build) - conduit-extra-1.3.5 (lib) (requires download & build) - these-1.1.1.1 (lib) (requires build) - monad-logger-0.3.36 (lib) (requires download & build) - strict-0.4.0.1 (lib) (requires build) - aeson-1.5.6.0 (lib) (requires build) - postgresql-simple-0.6.4 (lib) (requires download & build) - persistent-2.13.1.1 (lib) (requires download & build) - persistent-postgresql-2.13.0.3 (lib) (requires download & build) Downloading old-locale-1.0.0.7 Starting base-orphans-0.8.4 (lib) Starting data-default-class-0.1.2.0 (all, legacy fallback) Starting dlist-1.0 (lib) Starting Only-0.1 (lib) Starting base-compat-0.11.2 (lib) Building dlist-1.0 (lib) Building data-default-class-0.1.2.0 (all, legacy fallback) Building base-compat-0.11.2 (lib) Building base-orphans-0.8.4 (lib) Building Only-0.1 (lib) Downloaded old-locale-1.0.0.7 Downloading old-time-1.1.0.3 Installing data-default-class-0.1.2.0 (all, legacy fallback) Installing Only-0.1 (lib) Completed data-default-class-0.1.2.0 (all, legacy fallback) Starting hsc2hs-0.68.7 (exe:hsc2hs) Downloaded old-time-1.1.0.3 Downloading monad-loops-0.4.3 Completed Only-0.1 (lib) Starting hashable-1.3.2.0 (lib) Downloaded monad-loops-0.4.3 Downloading split-0.2.3.4 Building hsc2hs-0.68.7 (exe:hsc2hs) Building hashable-1.3.2.0 (lib) Downloaded split-0.2.3.4 Downloading auto-update-0.1.6 Downloaded auto-update-0.1.6 Downloading unliftio-core-0.2.0.1 Downloaded unliftio-core-0.2.0.1 Downloading base64-bytestring-1.2.0.1 Installing dlist-1.0 (lib) Completed dlist-1.0 (lib) Starting old-locale-1.0.0.7 (lib) Downloaded base64-bytestring-1.2.0.1 Downloading utf8-string-1.0.2 Starting base64-bytestring-1.2.0.1 (lib) Building old-locale-1.0.0.7 (lib) Downloaded utf8-string-1.0.2 Downloading zlib-0.6.2.3 Building base64-bytestring-1.2.0.1 (lib) Installing base-orphans-0.8.4 (lib) Downloaded zlib-0.6.2.3 Downloading bytestring-builder-0.10.8.2.0 Completed base-orphans-0.8.4 (lib) Installing old-locale-1.0.0.7 (lib) Downloaded bytestring-builder-0.10.8.2.0 Downloading lift-type-0.1.0.1 Starting bytestring-builder-0.10.8.2.0 (lib) Installing hashable-1.3.2.0 (lib) Completed old-locale-1.0.0.7 (lib) Starting monad-loops-0.4.3 (lib) Completed hashable-1.3.2.0 (lib) Starting indexed-traversable-0.1.1 (lib) Downloaded lift-type-0.1.0.1 Downloading th-lift-0.8.2 Building bytestring-builder-0.10.8.2.0 (lib) Starting lift-type-0.1.0.1 (lib) Installing bytestring-builder-0.10.8.2.0 (lib) Building monad-loops-0.4.3 (lib) Completed bytestring-builder-0.10.8.2.0 (lib) Starting unliftio-core-0.2.0.1 (lib) Building indexed-traversable-0.1.1 (lib) Downloaded th-lift-0.8.2 Downloading silently-1.2.5.1 Building lift-type-0.1.0.1 (lib) Installing base64-bytestring-1.2.0.1 (lib) Building unliftio-core-0.2.0.1 (lib) Completed base64-bytestring-1.2.0.1 (lib) Starting integer-logarithms-1.0.3.1 (lib) Downloaded silently-1.2.5.1 Downloading unix-compat-0.5.3 Installing lift-type-0.1.0.1 (lib) Completed lift-type-0.1.0.1 (lib) Downloaded unix-compat-0.5.3 Downloading network-3.1.2.2 Building integer-logarithms-1.0.3.1 (lib) Starting unix-compat-0.5.3 (lib) Installing unliftio-core-0.2.0.1 (lib) Completed unliftio-core-0.2.0.1 (lib) Starting primitive-0.7.1.0 (lib) Downloaded network-3.1.2.2 Downloading unix-time-0.4.7 Building unix-compat-0.5.3 (lib) Installing monad-loops-0.4.3 (lib) Completed monad-loops-0.4.3 (lib) Building primitive-0.7.1.0 (lib) Downloaded unix-time-0.4.7 Downloading easy-file-0.2.2 Downloaded easy-file-0.2.2 Downloading resourcet-1.2.4.2 Downloaded resourcet-1.2.4.2 Downloading transformers-base-0.4.5.2 Installing integer-logarithms-1.0.3.1 (lib) Completed integer-logarithms-1.0.3.1 (lib) Starting silently-1.2.5.1 (lib) Downloaded transformers-base-0.4.5.2 Downloading monad-control-1.0.2.3 Installing unix-compat-0.5.3 (lib) Building silently-1.2.5.1 (lib) Completed unix-compat-0.5.3 (lib) Starting split-0.2.3.4 (lib) Downloaded monad-control-1.0.2.3 Downloading lifted-base-0.2.3.12 Downloaded lifted-base-0.2.3.12 Downloading blaze-builder-0.4.2.1 Installing silently-1.2.5.1 (lib) Building split-0.2.3.4 (lib) Completed silently-1.2.5.1 (lib) Starting splitmix-0.1.0.3 (lib) Installing hsc2hs-0.68.7 (exe:hsc2hs) Downloaded blaze-builder-0.4.2.1 Downloading blaze-markup-0.8.2.8 Completed hsc2hs-0.68.7 (exe:hsc2hs) Starting blaze-builder-0.4.2.1 (lib) Building splitmix-0.1.0.3 (lib) Downloaded blaze-markup-0.8.2.8 Downloading blaze-html-0.9.1.2 Installing indexed-traversable-0.1.1 (lib) Building blaze-builder-0.4.2.1 (lib) Completed indexed-traversable-0.1.1 (lib) Starting easy-file-0.2.2 (all, legacy fallback) Downloaded blaze-html-0.9.1.2 Downloading cookie-0.4.5 Installing split-0.2.3.4 (lib) Completed split-0.2.3.4 (lib) Starting auto-update-0.1.6 (lib) Building easy-file-0.2.2 (all, legacy fallback) Downloaded cookie-0.4.5 Downloading fast-logger-3.0.5 Building auto-update-0.1.6 (lib) Downloaded fast-logger-3.0.5 Downloading case-insensitive-1.2.1.0 Downloaded case-insensitive-1.2.1.0 Downloading resource-pool-0.2.3.2 Installing splitmix-0.1.0.3 (lib) Installing base-compat-0.11.2 (lib) Completed splitmix-0.1.0.3 (lib) Starting utf8-string-1.0.2 (lib) Completed base-compat-0.11.2 (lib) Starting tagged-0.8.6.1 (lib) Installing easy-file-0.2.2 (all, legacy fallback) Downloaded resource-pool-0.2.3.2 Downloading unliftio-0.2.18 Completed easy-file-0.2.2 (all, legacy fallback) Starting th-abstraction-0.4.2.0 (lib) Installing auto-update-0.1.6 (lib) Building utf8-string-1.0.2 (lib) Completed auto-update-0.1.6 (lib) Starting transformers-compat-0.6.6 (lib) Building tagged-0.8.6.1 (lib) Downloaded unliftio-0.2.18 Downloading typed-process-0.2.6.0 Building th-abstraction-0.4.2.0 (lib) Downloaded typed-process-0.2.6.0 Downloading http-types-0.12.3 Building transformers-compat-0.6.6 (lib) Downloaded http-types-0.12.3 Downloading mono-traversable-1.0.15.1 Downloaded mono-traversable-1.0.15.1 Downloading conduit-1.3.4.1 Downloaded conduit-1.3.4.1 Downloading path-pieces-0.2.1 Downloaded path-pieces-0.2.1 Downloading streaming-commons-0.2.2.1 Starting path-pieces-0.2.1 (lib) Installing blaze-builder-0.4.2.1 (lib) Downloaded streaming-commons-0.2.2.1 Downloading string-conversions-0.4.0.1 Completed blaze-builder-0.4.2.1 (lib) Installing tagged-0.8.6.1 (lib) Starting zlib-0.6.2.3 (lib) Completed tagged-0.8.6.1 (lib) Starting cookie-0.4.5 (lib) Building path-pieces-0.2.1 (lib) Downloaded string-conversions-0.4.0.1 Downloading th-lift-instances-0.1.18 Downloaded th-lift-instances-0.1.18 Downloading conduit-extra-1.3.5 Building zlib-0.6.2.3 (lib) Building cookie-0.4.5 (lib) Installing transformers-compat-0.6.6 (lib) Downloaded conduit-extra-1.3.5 Downloading attoparsec-iso8601-1.0.2.0 Completed transformers-compat-0.6.6 (lib) Starting old-time-1.1.0.3 (all, legacy fallback) Downloaded attoparsec-iso8601-1.0.2.0 Downloading http-api-data-0.4.3 Downloaded http-api-data-0.4.3 Downloading postgresql-libpq-0.9.4.3 Downloaded postgresql-libpq-0.9.4.3 Downloading postgresql-simple-0.6.4 Installing path-pieces-0.2.1 (lib) Completed path-pieces-0.2.1 (lib) Starting time-compat-1.9.6 (lib) Downloaded postgresql-simple-0.6.4 Downloading stm-chans-3.0.0.4 Installing cookie-0.4.5 (lib) Downloaded stm-chans-3.0.0.4 Downloading monad-logger-0.3.36 Starting stm-chans-3.0.0.4 (all, legacy fallback) Installing utf8-string-1.0.2 (lib) Completed cookie-0.4.5 (lib) Starting async-2.2.3 (lib) Building time-compat-1.9.6 (lib) Completed utf8-string-1.0.2 (lib) Starting unordered-containers-0.2.14.0 (lib) Downloaded monad-logger-0.3.36 Downloading persistent-2.13.1.1 Downloaded persistent-2.13.1.1 Downloading persistent-postgresql-2.13.0.3 Building async-2.2.3 (lib) Building unordered-containers-0.2.14.0 (lib) Downloaded persistent-postgresql-2.13.0.3 Building old-time-1.1.0.3 (all, legacy fallback) Installing async-2.2.3 (lib) Installing primitive-0.7.1.0 (lib) Completed async-2.2.3 (lib) Starting data-fix-0.3.1 (lib) Completed primitive-0.7.1.0 (lib) Starting case-insensitive-1.2.1.0 (lib) Building data-fix-0.3.1 (lib) Building case-insensitive-1.2.1.0 (lib) Building stm-chans-3.0.0.4 (all, legacy fallback) Installing th-abstraction-0.4.2.0 (lib) Completed th-abstraction-0.4.2.0 (lib) Starting postgresql-libpq-0.9.4.3 (all, legacy fallback) Installing case-insensitive-1.2.1.0 (lib) Installing data-fix-0.3.1 (lib) Completed case-insensitive-1.2.1.0 (lib) Starting network-3.1.2.2 (all, legacy fallback) Completed data-fix-0.3.1 (lib) Starting random-1.2.0 (lib) Installing zlib-0.6.2.3 (lib) Completed zlib-0.6.2.3 (lib) Starting base-compat-batteries-0.11.2 (lib) Building random-1.2.0 (lib) Building base-compat-batteries-0.11.2 (lib) Installing old-time-1.1.0.3 (all, legacy fallback) Installing time-compat-1.9.6 (lib) Installing stm-chans-3.0.0.4 (all, legacy fallback) Completed old-time-1.1.0.3 (all, legacy fallback) Starting blaze-markup-0.8.2.8 (lib) Completed time-compat-1.9.6 (lib) Starting distributive-0.6.2.1 (lib) Completed stm-chans-3.0.0.4 (all, legacy fallback) Building blaze-markup-0.8.2.8 (lib) Starting transformers-base-0.4.5.2 (lib) Building distributive-0.6.2.1 (lib) Building transformers-base-0.4.5.2 (lib) Building postgresql-libpq-0.9.4.3 (all, legacy fallback) Installing distributive-0.6.2.1 (lib) Installing transformers-base-0.4.5.2 (lib) Building network-3.1.2.2 (all, legacy fallback) Completed distributive-0.6.2.1 (lib) Starting string-conversions-0.4.0.1 (lib) Completed transformers-base-0.4.5.2 (lib) Starting typed-process-0.2.6.0 (lib) Building string-conversions-0.4.0.1 (lib) Building typed-process-0.2.6.0 (lib) Installing string-conversions-0.4.0.1 (lib) Completed string-conversions-0.4.0.1 (lib) Starting unliftio-0.2.18 (lib) Building unliftio-0.2.18 (lib) Installing typed-process-0.2.6.0 (lib) Completed typed-process-0.2.6.0 (lib) Starting vector-0.12.3.0 (lib) Building vector-0.12.3.0 (lib) Installing postgresql-libpq-0.9.4.3 (all, legacy fallback) Completed postgresql-libpq-0.9.4.3 (all, legacy fallback) Starting scientific-0.3.7.0 (lib) Building scientific-0.3.7.0 (lib) Installing blaze-markup-0.8.2.8 (lib) Completed blaze-markup-0.8.2.8 (lib) Starting resourcet-1.2.4.2 (lib) Installing random-1.2.0 (lib) Building resourcet-1.2.4.2 (lib) Completed random-1.2.0 (lib) Starting th-lift-0.8.2 (lib) Building th-lift-0.8.2 (lib) Installing unordered-containers-0.2.14.0 (lib) Completed unordered-containers-0.2.14.0 (lib) Starting http-types-0.12.3 (lib) Building http-types-0.12.3 (lib) Installing th-lift-0.8.2 (lib) Completed th-lift-0.8.2 (lib) Starting unix-time-0.4.7 (all, legacy fallback) Installing base-compat-batteries-0.11.2 (lib) Installing resourcet-1.2.4.2 (lib) Completed base-compat-batteries-0.11.2 (lib) Starting comonad-5.0.8 (lib) Completed resourcet-1.2.4.2 (lib) Starting monad-control-1.0.2.3 (all, legacy fallback) Building comonad-5.0.8 (lib) Building monad-control-1.0.2.3 (all, legacy fallback) Installing unliftio-0.2.18 (lib) Installing monad-control-1.0.2.3 (all, legacy fallback) Completed unliftio-0.2.18 (lib) Starting blaze-html-0.9.1.2 (lib) Building unix-time-0.4.7 (all, legacy fallback) Completed monad-control-1.0.2.3 (all, legacy fallback) Starting uuid-types-1.0.5 (lib) Building blaze-html-0.9.1.2 (lib) Building uuid-types-1.0.5 (lib) Installing scientific-0.3.7.0 (lib) Completed scientific-0.3.7.0 (lib) Starting lifted-base-0.2.3.12 (lib) Building lifted-base-0.2.3.12 (lib) Installing network-3.1.2.2 (all, legacy fallback) Completed network-3.1.2.2 (all, legacy fallback) Installing http-types-0.12.3 (lib) Installing unix-time-0.4.7 (all, legacy fallback) Starting attoparsec-0.14.1 (lib) Completed http-types-0.12.3 (lib) Starting streaming-commons-0.2.2.1 (lib) Completed unix-time-0.4.7 (all, legacy fallback) Starting fast-logger-3.0.5 (lib) Building attoparsec-0.14.1 (lib) Building streaming-commons-0.2.2.1 (lib) Building fast-logger-3.0.5 (lib) Installing comonad-5.0.8 (lib) Completed comonad-5.0.8 (lib) Starting bifunctors-5.5.11 (lib) Installing lifted-base-0.2.3.12 (lib) Completed lifted-base-0.2.3.12 (lib) Installing uuid-types-1.0.5 (lib) Completed uuid-types-1.0.5 (lib) Building bifunctors-5.5.11 (lib) Installing fast-logger-3.0.5 (lib) Completed fast-logger-3.0.5 (lib) Installing streaming-commons-0.2.2.1 (lib) Completed streaming-commons-0.2.2.1 (lib) Installing bifunctors-5.5.11 (lib) Completed bifunctors-5.5.11 (lib) Starting assoc-1.0.2 (lib) Building assoc-1.0.2 (lib) Installing assoc-1.0.2 (lib) Completed assoc-1.0.2 (lib) Starting these-1.1.1.1 (lib) Building these-1.1.1.1 (lib) Installing these-1.1.1.1 (lib) Completed these-1.1.1.1 (lib) Starting strict-0.4.0.1 (lib) Building strict-0.4.0.1 (lib) Installing blaze-html-0.9.1.2 (lib) Completed blaze-html-0.9.1.2 (lib) Installing strict-0.4.0.1 (lib) Completed strict-0.4.0.1 (lib) Installing attoparsec-0.14.1 (lib) Completed attoparsec-0.14.1 (lib) Starting attoparsec-iso8601-1.0.2.0 (lib) Building attoparsec-iso8601-1.0.2.0 (lib) Installing attoparsec-iso8601-1.0.2.0 (lib) Completed attoparsec-iso8601-1.0.2.0 (lib) Starting http-api-data-0.4.3 (lib) Building http-api-data-0.4.3 (lib) Installing http-api-data-0.4.3 (lib) Completed http-api-data-0.4.3 (lib) Installing vector-0.12.3.0 (lib) Completed vector-0.12.3.0 (lib) Starting th-lift-instances-0.1.18 (lib) Starting resource-pool-0.2.3.2 (lib) Starting vector-algorithms-0.8.0.4 (lib) Starting aeson-1.5.6.0 (lib) Building vector-algorithms-0.8.0.4 (lib) Building resource-pool-0.2.3.2 (lib) Building th-lift-instances-0.1.18 (lib) Building aeson-1.5.6.0 (lib) Installing th-lift-instances-0.1.18 (lib) Completed th-lift-instances-0.1.18 (lib) Installing resource-pool-0.2.3.2 (lib) Completed resource-pool-0.2.3.2 (lib) Installing vector-algorithms-0.8.0.4 (lib) Completed vector-algorithms-0.8.0.4 (lib) Starting mono-traversable-1.0.15.1 (lib) Building mono-traversable-1.0.15.1 (lib) Installing mono-traversable-1.0.15.1 (lib) Completed mono-traversable-1.0.15.1 (lib) Starting conduit-1.3.4.1 (lib) Building conduit-1.3.4.1 (lib) Installing conduit-1.3.4.1 (lib) Completed conduit-1.3.4.1 (lib) Starting conduit-extra-1.3.5 (lib) Building conduit-extra-1.3.5 (lib) Installing conduit-extra-1.3.5 (lib) Completed conduit-extra-1.3.5 (lib) Starting monad-logger-0.3.36 (lib) Building monad-logger-0.3.36 (lib) Installing monad-logger-0.3.36 (lib) Completed monad-logger-0.3.36 (lib) Installing aeson-1.5.6.0 (lib) Completed aeson-1.5.6.0 (lib) Starting postgresql-simple-0.6.4 (lib) Starting persistent-2.13.1.1 (lib) Building persistent-2.13.1.1 (lib) Building postgresql-simple-0.6.4 (lib) Installing postgresql-simple-0.6.4 (lib) Completed postgresql-simple-0.6.4 (lib) Installing persistent-2.13.1.1 (lib) Completed persistent-2.13.1.1 (lib) Starting persistent-postgresql-2.13.0.3 (lib) Building persistent-postgresql-2.13.0.3 (lib) Installing persistent-postgresql-2.13.0.3 (lib) Completed persistent-postgresql-2.13.0.3 (lib) Warning: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: Installation might not be completed as desired! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ The command "cabal install [TARGETS]" doesn't expose libraries. * You might have wanted to add them as dependencies to your package. In this case add "persistent-postgresql" to the build-depends field(s) of your package's .cabal file. * You might have wanted to add them to a GHC environment. In this case use "cabal install --lib persistent-postgresql". The "--lib" flag is provisional: see https://github.com/haskell/cabal/issues/6481 for more information. bmaxa@Branimirs-Air ~ % cabal install --lib persistent-postgresql Warning: The package list for 'hackage.haskell.org' is 69 days old. Run 'cabal update' to get the latest list of available packages. Warning: The package list for 'hackage.haskell.org' is 69 days old. Run 'cabal update' to get the latest list of available packages. Resolving dependencies... Up to date bmaxa@Branimirs-Air ~ %
Greetings, Branimir.
On 21.09.2021., at 22:59, Geraldus
wrote: Thank you for your response.
I use 13.4:
``` arthurfayzrakhmanov@MacBook-Pro-Arthur ~/L/h/pg001> brew search postgres ==> Formulae check_postgres postgresql@11 postgresql@9.5 qt-postgresql postgresql ✔ postgresql@12 postgresql@9.6 postgis postgresql@10 postgresql@9.4 postgrest ==> Casks navicat-for-postgresql postgrespreferencepane postgres-unofficial sqlpro-for-postgres arthurfayzrakhmanov@MacBook-Pro-Arthur ~/L/h/pg001> psql --version psql (PostgreSQL) 13.4 ```
ср, 22 сент. 2021 г. в 01:55, Branimir Maksimovic < branimir.maksimovic@gmail.com>:
which version of postgresql you are using? bmaxa@Branimirs-Air ~ % brew search postgres ==> Formulae check_postgres postgresql@10 postgresql@12 postgresql@9.5 postgrest postgis postgresql postgresql@11 postgresql@9.4 postgresql@9.6 qt-postgresql ==> Casks navicat-for-postgresql postgres-unofficial postgrespreferencepane sqlpro-for-postgres
?
Greetings, Branimir.
On 21.09.2021., at 22:47, Geraldus
wrote: 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>: dlopen(/Users/arthurfayzrakhmanov/.stack/snapshots/x86_64-osx/36432054bd8d13c1da6134758733286b536c65d34222dcf10ecb29bd437c8117/8.10.7/lib/x86_64-osx-ghc-8.10.7/libHSpostgresql-libpq-0.9.4.3-GrxZELytXmSAOH6lAioiw9-ghc8.10.7.dylib, 5): *Symbol not found: _PQclear* persistent-postgresql> Referenced from: /Users/arthurfayzrakhmanov/.stack/snapshots/x86_64-osx/36432054bd8d13c1da6134758733286b536c65d34222dcf10ecb29bd437c8117/8.10.7/lib/x86_64-osx-ghc-8.10.7/libHSpostgresql-libpq-0.9.4.3-GrxZELytXmSAOH6lAioiw9-ghc8.10.7.dylib persistent-postgresql> *Expected in: flat namespace* persistent-postgresql> in /Users/arthurfayzrakhmanov/.stack/snapshots/x86_64-osx/36432054bd8d13c1da6134758733286b536c65d34222dcf10ecb29bd437c8117/8.10.7/lib/x86_64-osx-ghc-8.10.7/libHSpostgresql-libpq-0.9.4.3-GrxZELytXmSAOH6lAioiw9-ghc8.10.7.dylib ```
The minimal setup to reproduce is following:
``` dependencies: - base >= 4.7 && < 5 - persistent >= 2.13.1.2 && < 3 - persistent-postgresql >= 2.13.1.0 && < 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.
Sincerely. Arthur.
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. _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

seems you are using ghc for different architecture: bmaxa@Branimirs-Air ~ % brew search ghc ==> Formulae ghc ✔ ghc@8.6 ghc@8.8 ghc@9 gh ghq ghi ghz ghr grc gcc ✔ shc If you meant "ghc" specifically: It was migrated from homebrew/cask to homebrew/core. bmaxa@Branimirs-Air ~ % ghc -v Glasgow Haskell Compiler, Version 8.10.7, stage 2 booted by GHC version 8.10.7 *** initializing package database: Using binary package database: /opt/homebrew/Cellar/ghc/8.10.7/lib/ghc-8.10.7/package.conf.d/package.cache package flags [] loading package database /opt/homebrew/Cellar/ghc/8.10.7/lib/ghc-8.10.7/package.conf.d wired-in package ghc-prim mapped to ghc-prim-0.6.1 wired-in package integer-wired-in mapped to integer-gmp-1.0.3.0 wired-in package base mapped to base-4.14.3.0 wired-in package rts mapped to rts wired-in package template-haskell mapped to template-haskell-2.16.0.0 wired-in package ghc mapped to ghc-8.10.7 !!! initializing package database: finished in 10.92 milliseconds, allocated 8.308 megabytes Greetings, Branimir.
On 21.09.2021., at 22:47, Geraldus
wrote: 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>: dlopen(/Users/arthurfayzrakhmanov/.stack/snapshots/x86_64-osx/36432054bd8d13c1da6134758733286b536c65d34222dcf10ecb29bd437c8117/8.10.7/lib/x86_64-osx-ghc-8.10.7/libHSpostgresql-libpq-0.9.4.3-GrxZELytXmSAOH6lAioiw9-ghc8.10.7.dylib, 5): Symbol not found: _PQclear persistent-postgresql> Referenced from: /Users/arthurfayzrakhmanov/.stack/snapshots/x86_64-osx/36432054bd8d13c1da6134758733286b536c65d34222dcf10ecb29bd437c8117/8.10.7/lib/x86_64-osx-ghc-8.10.7/libHSpostgresql-libpq-0.9.4.3-GrxZELytXmSAOH6lAioiw9-ghc8.10.7.dylib persistent-postgresql> Expected in: flat namespace persistent-postgresql> in /Users/arthurfayzrakhmanov/.stack/snapshots/x86_64-osx/36432054bd8d13c1da6134758733286b536c65d34222dcf10ecb29bd437c8117/8.10.7/lib/x86_64-osx-ghc-8.10.7/libHSpostgresql-libpq-0.9.4.3-GrxZELytXmSAOH6lAioiw9-ghc8.10.7.dylib ```
The minimal setup to reproduce is following:
``` dependencies: - base >= 4.7 && < 5 - persistent >= 2.13.1.2 && < 3 - persistent-postgresql >= 2.13.1.0 && < 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.
Sincerely. Arthur.
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. _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
participants (2)
-
Branimir Maksimovic
-
Geraldus