Repository navigation
Conversation
5e02170 to
60223f0
Compare
|
Sounds like currently supautils would be incompatible with the rocky8 packaged glibc. IMO this is definitely a problem. I think that we would want at least one CI task that runs on a non bleeding edge glibc. Not sure if the best way of doing that is using an old nixpkgs or just running CI on rocky 8/9 kind of like my PR below in vault. > podman run -it rockylinux/rockylinux:8.10 dnf list installed glibc
Installed Packages
glibc.aarch64 2.28-251.el8_10.2 @System
> podman run -it rockylinux/rockylinux:9.7 dnf list installed glibc
Installed Packages
glibc.aarch64 2.34-231.el9_7.2 @1d2487d6c976430ead2aae97b9731ea5 |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
60223f0 to
89c3da9
Compare
|
Was scoping this out a little bit, like the pg_net libcurl backcompat PR, we will need CI testing over older libc in this PR. It is more complicated than adding testing over 2 different versions of libcurl though. I think that we will need to update xpg in order to accommodate multiple postgres builds in different libc's. Just updating libc here without updating it in xpg leads to compile errors because it sources its CFLAGS from pg_config. This can be overridden for just this extension but I feel like it does not make sense in any real life context to use an extension compiled with a different libc version than the postgres server so I think we just need to support multiple libc compilation in xpg. Also, while on the topic, I think that xpg should provide the build environment (clang, gcc, etc) to the extension instead of just rely on the end user to bring their own build toolchain. edit: @brainrake btw not saying that you need to do any of the above, just notes for myself and others on the postgres extensions team. |
| /* Link against __xstat so the module loads on glibc older than 2.33. */ | ||
| #if defined(__linux__) && defined(__GLIBC__) && \ | ||
| (defined(__x86_64__) || defined(__aarch64__)) | ||
| # if defined(__x86_64__) | ||
| # define SUPAUTILS_STAT_COMPAT_VER "GLIBC_2.2.5" | ||
| # define SUPAUTILS_STAT_VER 1 | ||
| # else | ||
| # define SUPAUTILS_STAT_COMPAT_VER "GLIBC_2.17" | ||
| # define SUPAUTILS_STAT_VER 0 | ||
| # endif | ||
| extern int __xstat(int ver, const char *path, struct stat *buf); | ||
| __asm__(".symver __xstat,__xstat@" SUPAUTILS_STAT_COMPAT_VER); | ||
| # undef stat | ||
| # define stat(path, buf) __xstat(SUPAUTILS_STAT_VER, path, buf) | ||
| # undef stat64 | ||
| # define stat64(path, buf) __xstat(SUPAUTILS_STAT_VER, path, buf) | ||
| #endif |
There was a problem hiding this comment.
This is quite strange. @AndrewJackson2020 Have you seen any other extensions that do this? Is this something that has to be fixed in xpg in some other way maybe?
There was a problem hiding this comment.
I don't know. I think first step is that we should get XPG to do postgres builds with non bleeding edge libc so we can experiment with this reproducibly. In the long term I would like to see one CI job for an old libc on all of the supabase extension repos.
There was a problem hiding this comment.
This is only required for supautils because it needs to run on Ubuntu 20.04 but build against latest glibc. Currently we patch it in postgres repo, this PR is to upstream the patch.
There was a problem hiding this comment.
This root cause is the way we ship supautils to prod via Salt. We build a single version (one per architecture) which we ship across the fleet. Ideally we should have different versions build for different ubuntu versions requiring appropriate glibc versions.
This is ugly because it depends on glibc internals and the patch would probably grow in size if we start using more symbols from glibc. I'm not sure why it's needed to build supautils in the postgres repo though.
There was a problem hiding this comment.
I have another PR where im trying to implement testing in rockylinux 8, 9, and 10 for the sake of testing our code against various glitch's. I have not been able to get all tests passing in supautils though I think this s because of differential behavior of extension versions used in tests. Either way all generations of rockylinux are able to compile without issues.
There was a problem hiding this comment.
This depends on glibc internals but is forward compatible forever.
We need to maintain this for about a year, until pg 15 is EOL. By that time Ubuntu 20.04 is EOL and Rocky 9 is End of Active Support and we retire all hosts from that era.
There was a problem hiding this comment.
This is just a symptom of the bigger problem. We might remove this specific patch but that doesn't fix the underlying cause. We might have to create another similar patch in future as long as we continue to ship supautils as today.
Links
stat()against__xstatso the module loads on glibc older than 2.33.Ported patch from supabase/postgres#2523