You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some difficulties recently presented with migrating PGRX extensions to Postgres 16. Here I will attempt to answer these questions as they may arise.
Q. My build is failing with some sort of bindgen error, something about <emmintrin.h>?
A. You may have too many clangs. Basically, with rustup, rust-bindgen, and a system's clang packages, there can be a situation where there are "too many clangs" on the system. Essentially:
rust-bindgen tries to use a clang of version M
rust-bindgen attempts to build against the indicated postgres, dragging in its headers
the postgres you want to build against is also bound against clang N's SIMD intrinsic headers (there is all of <[aeinpstw-z]mmintrin.h>).
those SIMD headers are written in a way that may depend on specific internal details of the compiler in order to compile at all, thus any given clang M cannot be expected to compile clang N's headers, and clang N might not even be able to compile clang M's headers! They are more "compiler implementation details" than they are "regular" C code, which is why they are included using the same syntax as "system headers".
thus the build fails when it uses clang M, but it will succeed if it uses clang N, but due to the vagaries of certain PATH lookups, rust-bindgen may default to clang M
This may not be something PGRX can solve (this is still unclear), but it is something that can be easily resolved as a configuration issue. It is usually sufficient to remove all but one clang package on the system, preferably using a more recent one (as this was initially discovered when using clang 11 and compile-erroring on clang 14's intrinsic headers).
Q. cargo pgrx install (or other commands) on macOS doesn't work? A. Oops. Try pgrx v0.10.2! It should be patched now.
The text was updated successfully, but these errors were encountered:
My current hypothesis is that the Postgres 16 build errors might be induced by our conditional setting of detect_include_paths. This is possible to disable by setting PGRX_BINDGEN_NO_DETECT_INCLUDES=please.
There are some difficulties recently presented with migrating PGRX extensions to Postgres 16. Here I will attempt to answer these questions as they may arise.
Q. My build is failing with some sort of bindgen error, something about
<emmintrin.h>
?A. You may have too many clangs. Basically, with rustup, rust-bindgen, and a system's clang packages, there can be a situation where there are "too many clangs" on the system. Essentially:
<[aeinpstw-z]mmintrin.h>
).This may not be something PGRX can solve (this is still unclear), but it is something that can be easily resolved as a configuration issue. It is usually sufficient to remove all but one clang package on the system, preferably using a more recent one (as this was initially discovered when using clang 11 and compile-erroring on clang 14's intrinsic headers).
Q.
cargo pgrx install
(or other commands) on macOS doesn't work?A. Oops. Try pgrx v0.10.2! It should be patched now.
The text was updated successfully, but these errors were encountered: