zonkyio / embedded-postgres-binaries

Lightweight bundles of PostgreSQL binaries with reduced size intended for testing purposes.
Apache License 2.0
138 stars 29 forks source link

Missing llvmjit_types.bc file #26

Closed blekit closed 3 years ago

blekit commented 3 years ago

In our project we were trying to upgrade the binaries to the 12.1.0 version (the later ones don't work well on MacOS, I've seen this issue is already reported). Unfortunately we've encountered an error when running tests saying that llvmjit_types.bc file is missing:

Caused by: org.postgresql.util.PSQLException: ERROR: LLVMCreateMemoryBufferWithContentsOfFile(/private/var/folders/md/3xl8q9351yv675vqkxxz0jdrjmgpd2/T/embedded-pg/PG-abc4d7798f0045b30e0a18facc5799d0/lib/postgresql/llvmjit_types.bc) failed: No such file or directory at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2553)

The error is present only on MacOS. When we run the build on Linux (both locally and on CI) it doesn't happen. When we use the default version of the binaries from embedded-database-spring-test everything works just fine on all operating systems.

Our other dependencies are as following:

tomix26 commented 3 years ago

Thanks for the report. I'll take a look at it as soon as possible.

tomix26 commented 3 years ago

Sorry for the late response. I prepared a fix that includes the missing files, but it is applicable only for postgres 12 and below. That's because llvmjit.so library in postgres 13 is compiled with a newer version of xcode, which is compatible only with newer versions of mac os. However, simultaneously, there is another issue that makes it impossible to run binaries on newer versions of mac os (#21). So we are in a hopeless situation.

So for now, I recommend turning off just in time compilation by jit = off setting. And in the future I will try to change the source of the binaries from EnterpriseDB to HomeBrew. I have already tested the proof of concept and it seemed to work.