zonkyio / embedded-postgres

Java embedded PostgreSQL component for testing
Apache License 2.0
341 stars 41 forks source link

run and compile postgres natively on Apple Silicon M1(arm64) #86

Closed pskrbasu closed 2 years ago

pskrbasu commented 2 years ago

Hello,

I have downloaded the Embedded Postgres Binary Darwin Arm64v8(12.10.0) from https://mvnrepository.com/artifact/io.zonky.test.postgres/embedded-postgres-binaries-darwin-arm64v8/12.10.0 and I'm using it on my M1 SoC which has arm64 architecture.

I see that the binary does not run natively on M1:

file postgres-darwin-arm_64/bin/postgres 
postgres-darwin-arm_64/bin/postgres: Mach-O 64-bit executable x86_64

I want it to run and compile natively on arm64. Is there something I'm missing or is it designed this way?

tomix26 commented 2 years ago

Hi @pskrbasu, thank you for letting me know. Yes, you are right. I thought that all new versions of EnterpriseDB binaries already include support for M1 architecture. But I just realized that only the latest major version supports this new instruction set. So to run it natively on M1 processors you need to upgrade to PostgreSQL 14. It's my fault and I'm really sorry, but it's already published and can't be changed.

tomix26 commented 2 years ago

It has been fixed for next versions in https://github.com/zonkyio/embedded-postgres-binaries/commit/e1dd5c63c97fc2d7df20421146f34c8887a4eaa1