aws / pg_tle

Framework for building trusted language extensions for PostgreSQL
Apache License 2.0
337 stars 30 forks source link

Cannot build the extension on macOS #273

Closed pyrocks closed 2 months ago

pyrocks commented 8 months ago

Description

I can't build the extension on macOS, specifically 14.4.1. I did not see anywhere in the documentation that the extension is limited to linux or x86_64.

Steps to reproduce

Followed the installation instructions - cloned the repository and ran make in the cloned folder.

Expected outcome

Extension being built successfully

Actual outcome

ld: warning: ignoring file '/usr/local/Cellar/postgresql@15/15.6_1/bin/postgres': found architecture 'x86_64', required architecture 'arm64'
Undefined symbols for architecture arm64:
  "_AllocSetContextCreateInternal", referenced from:
      _execute_extension_script in tleextension.o
...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [pg_tle.so] Error 1

Analysis

It would also be nice if the extension was installable using pgxn.

anth0nyleung commented 8 months ago

Hi, is the cpu chip of your mac running on apple silicon or intel? it looks like your local installation of postgres is using the x86 architecture but your host is running on the arm64 architecture

pyrocks commented 8 months ago

Hi, my mac is using apple silicon, but I have migrated to it from an intel based mac, which might explain why the local installation is using a x86. With that being said, I didn't have problems installing other extensions (i.e postgresql anonymizer).

anth0nyleung commented 7 months ago

I would suggest reinstalling postgres binaries and retry building pg_tle. Im also running on a apple silicon cpu and it builds without any issue