fergusstrange / embedded-postgres

Run a real Postgres database locally on Linux, OSX or Windows as part of another Go application or test
MIT License
854 stars 89 forks source link

Issues with M1 ARM Macs #86

Closed bdoherty-tovala closed 1 year ago

bdoherty-tovala commented 2 years ago

Using version 19.0 which downloads embedded-postgres 14.5.0.

Currently the defaultVersionStrategy overrides detected ARM architectures to use the amd64 architecture download for macs instead.

However this version seems to have some issues when running certain commands: in my case, a create function would always hang. This seems to be a problem specific to the amd binary running on the arm architecture.

For postgres versions 10.20, 11.15, 12.10, 13.6 and then >= 14.2, however, native ARM builds DO exist: https://repo1.maven.org/maven2/io/zonky/test/postgres/embedded-postgres-binaries-darwin-arm64v8/

I found that builds native to the ARM/M1 architecture don't exhibit the same problem: the function is created as expected and the process does not hang.

If the exception in the defaultVersionStrategy for versions >= 14.2 were removed, allowing the darwin/arm64v8 binaries to be used on these architectures, it would unblock users that run M1 macs that are experiencing this problem.

fergusstrange commented 2 years ago

This is a fantastic fix @bdoherty-tovala. Can you confirm your forked code has been working well for the last few weeks?

bdoherty-tovala commented 2 years ago

Been working for me on an M1 mac and my colleagues on their Intel Macs. Hasn't broken anyone as far as I can tell :)

fergusstrange commented 2 years ago

This is fantastic. I'll look to get those changes merged into master soon then. I'll leave this open to reference the work when done! Cheers

bdoherty-tovala commented 1 year ago

@fergusstrange is this working for you yet?

fergusstrange commented 1 year ago

Hey @bdoherty-tovala I've cut the release at v1.20.0 ready for your testing.