diff --git a/ansible/postgres_release.yml b/ansible/postgres_release.yml index 66379d530a..061a284cb1 100644 --- a/ansible/postgres_release.yml +++ b/ansible/postgres_release.yml @@ -1,5 +1,5 @@ --- postgres_release: - postgresorioledb-17: "17.11.0.011-orioledb" - postgres17: "17.11.0.011" - postgres15: "15.19.0.011" + postgresorioledb-17: "17.11.0.012-orioledb" + postgres17: "17.11.0.012" + postgres15: "15.19.0.012" diff --git a/nix/ext/patches/supautils-strtol-glibc-compat.patch b/nix/ext/patches/supautils-strtol-glibc-compat.patch index 8c36e613d9..6fefe6e2c6 100644 --- a/nix/ext/patches/supautils-strtol-glibc-compat.patch +++ b/nix/ext/patches/supautils-strtol-glibc-compat.patch @@ -1,32 +1,3 @@ -diff --git a/src/constrained_extensions.c b/src/constrained_extensions.c -index 18e5aee..cdfb63f 100644 ---- a/src/constrained_extensions.c -+++ b/src/constrained_extensions.c -@@ -9,6 +9,24 @@ - #include "constrained_extensions.h" - #include "utils.h" - -+#if defined(__linux__) && defined(__GLIBC__) && (defined(__x86_64__) || defined(__aarch64__)) -+# if defined(__x86_64__) -+# define SUPAUTILS_GLIBC_COMPAT_VER "GLIBC_2.2.5" -+# else -+# define SUPAUTILS_GLIBC_COMPAT_VER "GLIBC_2.17" -+# endif -+extern void *dlvsym(void *handle, const char *symbol, const char *version); -+__asm__(".symver dlvsym,dlvsym@" SUPAUTILS_GLIBC_COMPAT_VER); -+static int -+_supautils_compat_atoi(const char *nptr) -+{ -+ long (*fn)(const char *, char **, int) = -+ (long (*)(const char *, char **, int)) dlvsym((void *) 0, "strtol", SUPAUTILS_GLIBC_COMPAT_VER); -+ return fn ? (int) fn(nptr, NULL, 10) : 0; -+} -+#define atoi(a) _supautils_compat_atoi(a) -+#endif -+ - static JSON_ACTION_RETURN_TYPE json_array_start(void *state) { - json_constrained_extension_parse_state *parse = state; - diff --git a/src/extension_custom_scripts.c b/src/extension_custom_scripts.c index 337bd69..3f285cc 100644 --- a/src/extension_custom_scripts.c diff --git a/nix/ext/supautils.nix b/nix/ext/supautils.nix index fcab1c3fce..600f0833a8 100644 --- a/nix/ext/supautils.nix +++ b/nix/ext/supautils.nix @@ -8,7 +8,7 @@ stdenv.mkDerivation rec { pname = "supautils"; name = pname; - version = "3.4.4"; + version = "4.0.0"; buildInputs = [ postgresql ]; @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { owner = "supabase"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-Wsou5U7/Tuwj2E6aPEmlHg7uz7kGyBOGrb7UkjfEo9U="; + hash = "sha256-2tH34+JdgNqaR5ihtdJJQSIdT7zI4NTRHlYuEEO6/f8="; }; # remove once all Ubuntu 20.04 (glibc 2.31) hosts are decommissioned diff --git a/nix/ext/vault.nix b/nix/ext/vault.nix index 9ab5391b1d..78fb60938d 100644 --- a/nix/ext/vault.nix +++ b/nix/ext/vault.nix @@ -59,6 +59,14 @@ let -e "s|^module_pathname = .*|module_pathname = '\$libdir/${pname}'|" \ ${pname}.control > $out/share/postgresql/extension/${pname}--${version}.control + # Install this version's base install script from its own source. + # Newer sources drop deprecated base scripts (e.g. 0.3.2 removed + # supabase_vault--0.2.8.sql), so the latest version's sql/ alone + # can't install every packaged version. + if [ -f sql/${pname}--${version}.sql ]; then + install -D -t $out/share/postgresql/extension sql/${pname}--${version}.sql + fi + '' # for versions <= 0.2.8, we don't have a library to install + lib.optionalString (builtins.compareVersions "0.2.8" version < 0) '' @@ -73,7 +81,6 @@ let cat $out/share/postgresql/extension/${pname}--${latestVersion}.control } > $out/share/postgresql/extension/${pname}.control fi - ln -sfn ${pname}-${latestVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} ''; meta = with lib; { @@ -94,6 +101,9 @@ pkgs.buildEnv { ]; postBuild = '' + # Point the generic library name at the latest version + ln -sfn ${pname}-${latestVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} + makeWrapper ${lib.getExe switch-ext-version} $out/bin/switch_${pname}_version \ --prefix EXT_WRAPPER : "$out" --prefix EXT_NAME : "${pname}" ''; diff --git a/nix/ext/versions.json b/nix/ext/versions.json index 0c6c5b63a2..d6c4a526ea 100644 --- a/nix/ext/versions.json +++ b/nix/ext/versions.json @@ -573,6 +573,13 @@ "17" ], "hash": "sha256-MC87bqgtynnDhmNZAu96jvfCpsGDCPB0g5TZfRQHd30=" + }, + "0.3.2": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-TH5caaDajqZosEuv50o0ec5vxQI1TkIIprKDCFF4z1k=" } }, "timescaledb": {