Skip to content

Conversation

@jfroche
Copy link
Collaborator

@jfroche jfroche commented Nov 6, 2025

pg_upgrade may generate an update_extensions.sql script to update extensions after a major version upgrade.
This PR modifies the extension tests to check for the presence of this script after upgrading PostgreSQL to version 17.
If the script exists, it is executed to ensure that the extensions are updated correctly.

@jfroche jfroche marked this pull request as ready for review November 6, 2025 17:20
@jfroche jfroche requested review from a team as code owners November 6, 2025 17:20
@jfroche jfroche force-pushed the fix/nixos-test-update-after-pg-upgrade branch 2 times, most recently from 28b6e73 to 1a9394d Compare November 10, 2025 11:04
@yvan-sraka yvan-sraka force-pushed the fix/nixos-test-update-after-pg-upgrade branch from 1a9394d to cecd0ca Compare November 17, 2025 09:46
@yvan-sraka yvan-sraka self-assigned this Nov 17, 2025
@yvan-sraka yvan-sraka requested a review from samrose November 17, 2025 09:46
@yvan-sraka yvan-sraka force-pushed the fix/nixos-test-update-after-pg-upgrade branch 3 times, most recently from dbb2ab9 to 537ceef Compare November 21, 2025 10:37
jfroche and others added 19 commits December 12, 2025 09:33
These overlay packages will be removed once the extensions are updated
to use the new `buildPgrxExtension` function.
The previously used version was failing to build:

/build/source/src/common/get_check_data.c: In function 'pgr_SPI_getText':
/build/source/src/common/get_check_data.c:307:28: error: passing argument 1 of 'DatumGetCString' makes integer from pointer without a cast [-Wint-conversion]
  307 |     return DatumGetCString(SPI_getvalue(*tuple, *tupdesc, info.colNumber));
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                            |
      |                            char *
In file included from /build/source/include/c_common/postgres_connection.h:29,
                 from /build/source/src/common/get_check_data.c:27:
/nix/store/nn6vpjqlsxxmynwcrsib9agb3hpr5cqj-postgresql-17.4/include/server/postgres.h:335:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'char *'
  335 | DatumGetCString(Datum X)
      |                 ~~~~~~^
make[2]: *** [src/common/CMakeFiles/common.dir/build.make:149: src/common/CMakeFiles/common.dir/get_check_data.c.o] Error 1
We cannot use nodejs.libv8 as it is too new for plv8 3.1.
We will be able to use it with plv8 3.2.
dbmate 2.27 is now using a varchar for the version column in the
schema_migrations table.

See amacneil/dbmate#641
yvan-sraka and others added 26 commits December 12, 2025 09:33
Updated postgis.nix to use nixpkgs sfcgal instead of our custom package,
eliminating the need to maintain a separate sfcgal build definition.
pg_net requires an older version of curl (pinned from nixpkgs commit
a76c4553d7e741e17f289224eda135423de0491d) to resolve build compatibility issues.
Updated cargo-pgrx buildPgrxExtension with rustc wrapper to handle empty
postmaster_stub.rs files that cause duplicate symbol errors.
(first two filenames are `` and
`/build/tmp.*/postmaster_stubs/nix/store/*/bin/postmaster_stub.rs`)

pg_jsonschema cargo checks fails on specific versions (0.2.0, 0.3.1, 0.3.3).
Remove deprecated functions that were removed in newer pgrouting versions
(_pgr_betweennesscentrality and _pgr_contractionhierarchies).
Improves reproducibility and avoids evaluation-time network access by
using a proper flake input instead of fetchTarball for the older nixpkgs
needed by pg_net and plv8.
…64-darwin

Version 0.19.5 has a dangling pointer issue in src/core.c:177 that causes
compilation to fail on aarch64-darwin with newer clang versions. This adds
-Wno-error=dangling-assignment to allow compilation to proceed.

The flag is restricted to aarch64-darwin only since GCC on Linux doesn't
recognize this warning option.
Add -headerpad_max_install_names linker flag to prevent 'install_name_tool:
changing install names or rpaths can't be redone' errors on macOS. This
allocates sufficient header space for install_name_tool to modify the
shared library during post-install processing.
… extensions

Test assertions were inconsistent: expecting {version}.so and {extension_name}-{version}.so
patterns while actual libraries use {lib_name}-{version}.so (e.g. pg_partman_bgw-5.3.1.so,
timescaledb-loader-2.16.1.so). Updated PostgresExtensionTest to accept Optional[str] lib_name
parameter and use consistent {lib_name}-{version}.so assertions throughout.

Added missing timescaledb-loader.so symlink creation and updated the switch script to
maintain both symlinks when switching versions.

Fixes 'Expected timescaledb version 2.16.1, but found timescaledb-loader-2.16.1.so' and
'Expected pg_partman version 5.3.1, but found pg_partman_bgw-5.3.1.so' test failures.
Use overlay instead of passing full nixpkgs-oldstable to avoid exposing
entire old nixpkgs attribute set. Now provides specific packages
(curl_8_4, v8_oldstable) through overlay.
Keep revision support that was accidentally simplified during nixpkgs update.
Restores conditional logic to support building orioledb from specific git
revision hashes instead of only tags.
These files were moved to subdirectories and the old .nix files should be
removed since they were moved to new directory structure with default.nix files.
Remove nixpkgs-go124 dependency since current nixpkgs has Go 1.25.4
which is sufficient for packer. Remove nix-fast-build input as unused
and add follows directives to resolve duplicate dependencies.
Run flake-linter to eliminate duplicate dependencies, and remove unused
cargo-pgrx / rustc versions hashes.
Move pgrouting.nix to pgrouting/default.nix and groonga package to
pgroonga/groonga.nix. Update imports and fix relative paths for versions.json
and patch files.
Replace inline bash script generation with writeShellScriptBin for rustc
wrapper that filters empty postmaster_stub.rs arguments. Apply wrapper only
for pgrx < 0.12 since issue was fixed upstream in pgrx#1435 and pgrx#1441.
Move nixpkgs-oldstable import to a let binding to avoid importing it
three times...
Remove supabase-groonga from global flake packages and import it locally
in pgroonga extension instead. Other components access groonga via
pgroonga.passthru.groonga since groonga is only used by pgroonga.
The supabase-groonga package was moved to pgroonga extension in commit 1f0ed1f,
but Ansible was still trying to install it separately causing build failures.
This reverts commit 55474686405394826ad07a032cbcf0e36a924554.
This reverts commit cfa9bcb92219f391469ae743f95c8856b0a99561.
Remove references to darwin.apple_sdk.frameworks.{IOKit,CoreFoundation}
which have been deprecated in nixpkgs. Disable CGO to avoid Darwin
framework dependencies entirely.
…n the extension tests

pg_upgrade may generate an update_extensions.sql script to update extensions after a major version upgrade. 
This commit modifies the extension tests to check for the presence of this script after upgrading PostgreSQL to version 17. 
If the script exists, it is executed to ensure that the extensions are updated correctly.
Thanks to the improvement related to the generated pg_upgrade script, we can now reuse the generic postgres extension test for postgis.
This helps us identify why certain extensions do not use the generic tests.
@yvan-sraka yvan-sraka force-pushed the fix/nixos-test-update-after-pg-upgrade branch from 537ceef to d90c5b4 Compare December 12, 2025 17:43
@yvan-sraka yvan-sraka requested a review from a team as a code owner December 12, 2025 17:43
@yvan-sraka yvan-sraka changed the base branch from develop to update-nixpkgs December 12, 2025 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants