leinelissen / embedded-postgres

🐘 A Node package that allows you to spawn a Postgresql cluster programatically.
MIT License
55 stars 11 forks source link

PostgreSQL >= 14.6.0 results with "incompatible architecture (have 'x86_64', need 'arm64')" #3

Closed Newbie012 closed 1 year ago

Newbie012 commented 1 year ago

Using a version 14 or higher while executing a query that triggers the JIT compilation, I get this error:

tl;dr - incompatible architecture (have 'x86_64', need 'arm64'))

[subtracted]/@embedded-postgres+darwin-arm64@15.2.0-beta.6/node_modules/@embedded-postgres/darwin-arm64/native/lib/postgresql/llvmjit.so":
  dlopen([subtracted]/@embedded-postgres+darwin-arm64@15.2.0-beta.6/node_modules/@embedded-postgres/darwin-arm64/native/lib/postgresql/llvmjit.so, 0x000A):
  tried: '[subtracted]/@embedded-postgres+darwin-arm64@15.2.0-beta.6/node_modules/@embedded-postgres/darwin-arm64/native/lib/postgresql/llvmjit.so'
  (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')),
  '/System/Volumes/Preboot/Cryptexes/OS[subtracted]/@embedded-postgres+darwin-arm64@15.2.0-beta.6/node_modules/@embedded-postgres/darwin-arm64/native/lib/postgresql/llvmjit.so'
  (no such file), '[subtracted]/@embedded-postgres+darwin-arm64@15.2.0-beta.6/node_modules/@embedded-postgres/darwin-arm64/native/lib/postgresql/llvmjit.so'
  (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

To confirm that, I ran

lipo -info [subtracted]/@embedded-postgres+darwin-arm64@15.1.0-beta.6/node_modules/@embedded-postgres/darwin-arm64/native/lib/postgresql/llvmjit.so

and I got

Non-fat file: node_modules/.pnpm/@embedded-postgres+darwin-arm64@15.1.0-beta.6/node_modules/@embedded-postgres/darwin-arm64/native/lib/postgresql/llvmjit.so
is architecture: x86_64

This area is way out of my knowledge, so if there's some information that I'm missing, please let me know.

leinelissen commented 1 year ago

Hey @Newbie012, thanks for reporting this! This kinda stumped me because there shouldn't even.be an llvmjit.so since I don't think the binaries are built with JIT support. Turns out that I didn't properly clear the binary directories when preparing for a new release, so it may have included files from previous versions and architectures. I am currently releasing the beta.8 line of packages for the latest minor versions that should address this issue. Please let me know if these versions fix the problem for you.

Newbie012 commented 1 year ago

Looks like it's working as expected now. Thanks!

leinelissen commented 1 year ago

Perfect, thank you!