Skip to content

Conversation

@jfroche
Copy link
Collaborator

@jfroche jfroche commented Jul 21, 2025

Use one recent version of nixpkgs in the flake inputs.

a76c4553d7e741e17f289224eda135423de0491d -> f61125a668a320878494449750330ca58b78c557

Summary by CodeRabbit

  • New Features

    • Tests and extension packages now expose installed-extension metadata and JIT on/off toggles; host-platform resolution improved.
  • Bug Fixes

    • PostgreSQL 17 compatibility fixes and improved build robustness for older toolchains.
  • Updates

    • Postgres runtime artifacts bumped to new patch releases; many dependency inputs and build hashes reorganized/updated; macOS-specific conditionals simplified.
  • Database

    • Removed length constraint on migration version column for greater flexibility.

✏️ Tip: You can customize this high-level summary in your review settings.

@jfroche jfroche force-pushed the update-nixpkgs branch 2 times, most recently from a3275e8 to 98633c4 Compare July 21, 2025 22:29
@jfroche jfroche marked this pull request as ready for review July 22, 2025 13:39
@jfroche jfroche requested review from a team as code owners July 22, 2025 13:39
@samrose
Copy link
Collaborator

samrose commented Aug 8, 2025

rebased on develop, and will e2e test ami for each major version

@samrose samrose force-pushed the update-nixpkgs branch 2 times, most recently from c061085 to 07fb5e2 Compare September 2, 2025 13:28
@samrose samrose force-pushed the update-nixpkgs branch 2 times, most recently from 6b51806 to a33cf5d Compare September 10, 2025 17:58
@samrose samrose force-pushed the update-nixpkgs branch 2 times, most recently from 37962e0 to 52722b1 Compare November 18, 2025 15:45
@yvan-sraka yvan-sraka self-assigned this Nov 19, 2025
@yvan-sraka yvan-sraka marked this pull request as draft November 19, 2025 21:13
Copy link
Collaborator

@samrose samrose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding request changes just to stop merge until fully tested

@yvan-sraka yvan-sraka force-pushed the update-nixpkgs branch 3 times, most recently from f470b85 to dc596ec Compare November 25, 2025 15:57
yvan-sraka and others added 15 commits January 16, 2026 05:40
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.
With this new nixpkgs update come gcc 15, which introduced stricter C standard compliance. plpgsql-check fails to build due to this.
To fix the build, we explicitly set the C standard to gnu17.
nix 2.29 doesn't exist in the updated nixpkgs anymore
Replace deprecated system attribute accesses throughout the codebase with
stdenv.hostPlatform.system to resolve Nix deprecation warnings.

Changes:
- Replace inherit (stdenv) system with system = stdenv.hostPlatform.system
- Replace pkgs.system with pkgs.stdenv.hostPlatform.system (55 occurrences)
- Replace system function parameters with stdenv to avoid auto-injection
- Replace final.system in overlay with final.stdenv.hostPlatform.system

Affected files:
- nix/postgresql/generic.nix
- nix/packages/default.nix
- nix/ext/tests/*.nix (16 files)
- nix/packages/lib.nix
- nix/packages/dbmate-tool.nix
- nix/packages/show-commands.nix
- nix/cargo-pgrx/mkPgrxExtension.nix
- nix/overlays/default.nix
@samrose samrose enabled auto-merge January 15, 2026 22:44
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@nix/ext/tests/pgmq.nix`:
- Around line 47-48: The test invocation uses
self.inputs.nixpkgs.lib.nixos.runTest with a hardcoded name = "timescaledb"
which is incorrect for this file; change the name value to "pgmq" so the test
name matches the extension under test (locate the name = "timescaledb" within
the runTest call and replace it with name = "pgmq").
♻️ Duplicate comments (5)
testinfra/test_ami_nix.py (1)

790-792: Replace assert False with raise AssertionError(...).

At Line 790–792, assert False can be removed by Python’s -O optimization, which would silently skip this failure path. Use an explicit exception instead.

🔧 Proposed fix
-            assert False, (
-                "PostgREST logs contain 'session is not read-only' errors even though PostgreSQL is configured for read-only mode"
-            )
+            raise AssertionError(
+                "PostgREST logs contain 'session is not read-only' errors even though PostgreSQL is configured for read-only mode"
+            )
nix/ext/pgrouting/default.nix (1)

61-69: CMAKE_POLICY_VERSION_MINIMUM still needs justification.

Same concern as before for Line 63; please document why 3.5 is required or remove it.

nix/postgresql/generic.nix (1)

197-199: Use stdenv' instead of bare stdenv for consistency.

This code uses stdenv.isDarwin and stdenv.cc.libc while the rest of the file uses stdenv' (the JIT-aware stdenv defined at line 85). All other platform checks use stdenv' for consistency.

♻️ Suggested fix
       (replaceVars ./patches/locale-binary-path.patch {
-        locale = "${if stdenv.isDarwin then darwin.adv_cmds else lib.getBin stdenv.cc.libc}/bin/locale";
+        locale = "${if stdenv'.isDarwin then darwin.adv_cmds else lib.getBin stdenv'.cc.libc}/bin/locale";
       })
nix/ext/tests/lib.py (1)

169-189: Error messages still reference extension_name instead of lib_name.
This matches the earlier review note; keeping as a reminder.

nix/ext/plv8/default.nix (1)

38-48: Ensure the selected V8 variant is used consistently in flags and rpaths.

The derivation now computes a per-version V8, but makeFlags/NIX_LDFLAGS/patchelf still reference the outer v8_oldstable. If versions > 3.1.10 are added, buildInputs will switch to nodejs_20.libv8 while those flags still point to v8_oldstable. Align these to the derivation’s selected V8 to avoid mismatched link paths.

🔧 Suggested fix (wire flags/rpaths to the selected V8)
-      v8 = (if (builtins.compareVersions "3.1.10" version >= 0) then v8 else nodejs_20.libv8);
+      v8 = if (builtins.compareVersions "3.1.10" version >= 0) then v8_oldstable else nodejs_20.libv8;

-      buildInputs = [
-        (if (builtins.compareVersions "3.1.10" version >= 0) then v8 else nodejs_20.libv8)
-        postgresql
-      ];
+      buildInputs = [
+        finalAttrs.v8
+        postgresql
+      ];

-        "V8_OUTDIR=${v8}/lib"
+        "V8_OUTDIR=${finalAttrs.v8}/lib"
...
-        "-L${v8}/lib"
+        "-L${finalAttrs.v8}/lib"
...
-            ${patchelf}/bin/patchelf --set-rpath "${v8}/lib:${postgresql}/lib:${libcxx}/lib" $out/lib/$LIB_NAME
+            ${patchelf}/bin/patchelf --set-rpath "${finalAttrs.v8}/lib:${postgresql}/lib:${libcxx}/lib" $out/lib/$LIB_NAME

Verification (check whether any plv8 versions > 3.1.10 are currently configured):

#!/bin/bash
# List configured plv8 versions and flag any > 3.1.10
python - <<'PY'
import json
from distutils.version import LooseVersion
with open("nix/ext/versions.json") as f:
    data = json.load(f)
versions = list(data.get("plv8", {}).keys())
print("plv8 versions:", versions)
print("versions > 3.1.10:", [v for v in versions if LooseVersion(v) > LooseVersion("3.1.10")])
PY

Also applies to: 75-94, 95-110, 144-157

🧹 Nitpick comments (3)
nix/packages/lib.nix (1)

118-131: Consider a small helper for the copy/perm boilerplate.

The repeated cp … || exit + chmod 644 blocks are verbose; a tiny helper using install -Dm644 keeps the script shorter and makes future edits less error‑prone.

♻️ Possible refactor
+        copy_conf() {
+          local src="$1" dst="$2"
+          install -Dm644 "$src" "$dst" || {
+            echo "Failed to copy $(basename "$src")"
+            exit 1
+          }
+        }
+
-        cp ${paths.supautilsConfigFile} $out/etc/postgresql-custom/supautils.conf || { echo "Failed to copy supautils.conf"; exit 1; }
-        cp ${paths.pgconfigFile} $out/etc/postgresql/postgresql.conf || { echo "Failed to copy postgresql.conf"; exit 1; }
-        cp ${paths.loggingConfigFile} $out/etc/postgresql-custom/logging.conf || { echo "Failed to copy logging.conf"; exit 1; }
-        cp ${paths.pgHbaConfigFile} $out/etc/postgresql/pg_hba.conf || { echo "Failed to copy pg_hba.conf"; exit 1; }
-        cp ${paths.pgIdentConfigFile} $out/etc/postgresql/pg_ident.conf || { echo "Failed to copy pg_ident.conf"; exit 1; }
+        copy_conf ${paths.supautilsConfigFile} $out/etc/postgresql-custom/supautils.conf
+        copy_conf ${paths.pgconfigFile} $out/etc/postgresql/postgresql.conf
+        copy_conf ${paths.loggingConfigFile} $out/etc/postgresql-custom/logging.conf
+        copy_conf ${paths.pgHbaConfigFile} $out/etc/postgresql/pg_hba.conf
+        copy_conf ${paths.pgIdentConfigFile} $out/etc/postgresql/pg_ident.conf
-
-        chmod 644 $out/etc/postgresql-custom/supautils.conf
-        chmod 644 $out/etc/postgresql/postgresql.conf
-        chmod 644 $out/etc/postgresql-custom/logging.conf
-        chmod 644 $out/etc/postgresql/pg_hba.conf
nix/postgresql/generic.nix (1)

345-345: Empty teams list added to meta.

The teams = [ ] addition appears to be for forward compatibility with nixpkgs metadata changes. Consider adding a comment if this is a placeholder for future team assignments.

nix/ext/tests/pg_plan_filter.nix (1)

55-56: Double wrapping detected.

psql_15 is already the result of postgresqlWithExtension, so wrapping it again with postgresqlWithExtension psql_15 appears redundant. This likely works but creates unnecessary indirection.

Suggested fix
       services.postgresql = {
         enable = true;
-        package = (postgresqlWithExtension psql_15);
+        package = psql_15;
         settings = (installedExtension "15").defaultSettings or { };
       };
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fa26b67 and aabe8bf.

⛔ Files ignored due to path filters (1)
  • flake.lock is excluded by !**/*.lock
📒 Files selected for processing (57)
  • ansible/vars.yml
  • flake.nix
  • migrations/schema-15.sql
  • migrations/schema-17.sql
  • migrations/schema-orioledb-17.sql
  • nix/cargo-pgrx/buildPgrxExtension.nix
  • nix/cargo-pgrx/default.nix
  • nix/cargo-pgrx/mkPgrxExtension.nix
  • nix/cargo-pgrx/versions.json
  • nix/checks.nix
  • nix/ext/gdal.nix
  • nix/ext/pg_jsonschema/default.nix
  • nix/ext/pg_net.nix
  • nix/ext/pgaudit.nix
  • nix/ext/pgroonga/default.nix
  • nix/ext/pgroonga/groonga.nix
  • nix/ext/pgrouting/default.nix
  • nix/ext/pgrouting/pgrouting-3.4.1-pg17.patch
  • nix/ext/plpgsql-check.nix
  • nix/ext/plv8/default.nix
  • nix/ext/postgis.nix
  • nix/ext/tests/default.nix
  • nix/ext/tests/http.nix
  • nix/ext/tests/lib.py
  • nix/ext/tests/orioledb.nix
  • nix/ext/tests/pg_plan_filter.nix
  • nix/ext/tests/pg_repack.nix
  • nix/ext/tests/pg_safeupdate.nix
  • nix/ext/tests/pgjwt.nix
  • nix/ext/tests/pgmq.nix
  • nix/ext/tests/pgroonga.nix
  • nix/ext/tests/pgrouting.nix
  • nix/ext/tests/pgsodium.nix
  • nix/ext/tests/plpgsql_check.nix
  • nix/ext/tests/plv8.nix
  • nix/ext/tests/postgis.nix
  • nix/ext/tests/timescaledb.nix
  • nix/ext/tests/vault.nix
  • nix/ext/timescaledb.nix
  • nix/ext/vault.nix
  • nix/ext/wal2json.nix
  • nix/ext/wrappers/default.nix
  • nix/nixpkgs.nix
  • nix/overlays/default.nix
  • nix/packages/dbmate-tool.nix
  • nix/packages/default.nix
  • nix/packages/groonga/do-not-use-vendored-libraries.patch
  • nix/packages/groonga/fix-cmake-install-path.patch
  • nix/packages/lib.nix
  • nix/packages/packer.nix
  • nix/packages/postgres.nix
  • nix/packages/sfcgal.nix
  • nix/packages/show-commands.nix
  • nix/packages/supascan.nix
  • nix/packages/sync-exts-versions.nix
  • nix/postgresql/generic.nix
  • testinfra/test_ami_nix.py
💤 Files with no reviewable changes (3)
  • nix/packages/groonga/do-not-use-vendored-libraries.patch
  • nix/packages/sfcgal.nix
  • nix/packages/groonga/fix-cmake-install-path.patch
🚧 Files skipped from review as they are similar to previous changes (19)
  • nix/ext/pgaudit.nix
  • nix/packages/show-commands.nix
  • nix/cargo-pgrx/buildPgrxExtension.nix
  • nix/ext/pgroonga/default.nix
  • nix/ext/pgroonga/groonga.nix
  • nix/ext/tests/pgsodium.nix
  • nix/cargo-pgrx/default.nix
  • nix/ext/timescaledb.nix
  • nix/packages/sync-exts-versions.nix
  • nix/ext/gdal.nix
  • nix/ext/postgis.nix
  • nix/checks.nix
  • nix/ext/plpgsql-check.nix
  • ansible/vars.yml
  • migrations/schema-15.sql
  • nix/ext/tests/plv8.nix
  • migrations/schema-orioledb-17.sql
  • nix/packages/supascan.nix
  • nix/ext/vault.nix
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2026-01-06T01:52:31.331Z
Learnt from: soedirgo
Repo: supabase/postgres PR: 1987
File: migrations/db/migrations/20251215120934_supabase_superuser.sql:10-10
Timestamp: 2026-01-06T01:52:31.331Z
Learning: In the supabase/postgres repository, do not flag or require down migrations for SQL migrations, and do not treat empty down migrations as issues. This guideline applies to all SQL migration files under migrations directories in this repository.

Applied to files:

  • migrations/schema-17.sql
📚 Learning: 2026-01-06T01:52:38.498Z
Learnt from: soedirgo
Repo: supabase/postgres PR: 1987
File: migrations/db/migrations/20251215120934_supabase_superuser.sql:10-10
Timestamp: 2026-01-06T01:52:38.498Z
Learning: For the supabase/postgres repository, do not recommend adding down migrations or flag empty down migrations as issues.

Applied to files:

  • nix/postgresql/generic.nix
🪛 Ruff (0.14.11)
testinfra/test_ami_nix.py

790-790: Do not assert False (python -O removes these calls), raise AssertionError()

Replace assert False

(B011)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: run-check-harness-psql-17 (x86_64-linux)
  • GitHub Check: run-check-harness-psql-15 (x86_64-linux)
  • GitHub Check: run-check-harness-psql-orioledb-17 (x86_64-linux)
  • GitHub Check: nix-shell (x86_64-linux)
  • GitHub Check: vm-test-run-pg_repack (aarch64-linux)
  • GitHub Check: vm-test-run-pg_net (aarch64-linux)
  • GitHub Check: vm-test-run-plan_filter (aarch64-linux)
  • GitHub Check: vm-test-run-pg_graphql (aarch64-linux)
  • GitHub Check: vm-test-run-pg_jsonschema (aarch64-linux)
🔇 Additional comments (68)
migrations/schema-17.sql (1)

640-642: LGTM - Relaxing version column length constraint.

Removing the (128) length limit from character varying is a safe widening change. Migration version strings are typically short, and this change is consistently applied across all schema files (schema-15, schema-17, schema-orioledb-17) per the PR context.

nix/ext/wal2json.nix (1)

12-13: LGTM!

Good use of the _rev prefix to indicate an unused parameter per Nix conventions. The actual rev is correctly computed from the version string on line 20 (as wal2json_X_Y_Z tag format), making the passed value unnecessary for the build itself.

nix/ext/pgrouting/pgrouting-3.4.1-pg17.patch (1)

1-38: LGTM! Correct fix for PostgreSQL 17 compatibility.

The patch correctly removes the unnecessary DatumGetCString wrapper around SPI_getvalue calls. SPI_getvalue has always returned char*, so wrapping it in DatumGetCString (which expects a Datum) was technically incorrect but happened to work due to pointer/Datum size equivalence. PostgreSQL 17's stricter type checking now catches this at compile time.

Both changes are consistent and type-correct:

  • pgr_SPI_getText returns char* directly from SPI_getvalue
  • char *str assignment receives char* directly from SPI_getvalue
nix/ext/pg_net.nix (3)

10-15: Clean approach for pinning the curl version.

This addresses the prior feedback about declaring a specific versioned curl dependency. The pattern of passing curl_8_6 as an input and aliasing it locally keeps the internal code clean while making the version dependency explicit at the interface level.


26-27: Formatting change only.

No functional impact—just reformatting the buildInputs list.


52-59: Verify the aarch64-darwin flag is only needed for version 0.19.5.

The logic correctly handles the dangling-assignment warning for version 0.19.5 on aarch64-darwin. However, if this warning stems from "newer clang" as the comment suggests, consider whether versions after 0.19.5 might also encounter this issue—or confirm the upstream code was fixed in subsequent releases.

If newer versions (e.g., 0.19.6+) also exhibit this warning on aarch64-darwin, the condition would need adjustment:

-        else if (version == "0.19.5" && stdenv.isDarwin && stdenv.isAarch64) then
+        else if (lib.versionAtLeast version "0.19.5" && stdenv.isDarwin && stdenv.isAarch64) then
nix/packages/packer.nix (1)

9-9: Verify Go toolchain + macOS build after dropping overrides.

Switching to the default pkgs.buildGoModule (and removing Darwin-specific inputs per this PR) can change the Go toolchain and macOS linkage behavior. Please confirm Packer 1.14.1 still builds on both Linux and macOS with the updated nixpkgs pin.

nix/cargo-pgrx/versions.json (12)

2-8: Cargo hash update looks fine.


10-17: Cargo hash update looks fine.


18-25: Cargo hash update looks fine.


26-33: Cargo hash update looks fine.


34-43: Cargo hash update looks fine.


45-58: Cargo hash update looks fine.


59-68: Cargo hash update looks fine.


70-79: Cargo hash update looks fine.


81-94: Cargo hash update looks fine.


95-102: Cargo hash update looks fine.


103-110: Cargo hash update looks fine.


111-118: Cargo hash update looks fine.

nix/ext/pg_jsonschema/default.nix (2)

83-93: Well-documented test exclusion.

The comments clearly explain the sandbox limitation with pgrx tests and provide a source reference. The version-specific exclusion is preferable to blanket disabling.

Note that 0.3.3 (currently the latest version based on previousVersions) has tests disabled, meaning the most current release builds without test coverage in the nix sandbox. This is an accepted trade-off given the pgrx limitation.


45-45: Verify that darwin builds work without SystemConfiguration framework.

The darwin input darwin.apple_sdk.frameworks.SystemConfiguration was added in commit e67b478 as a fix for macOS builds but was removed in commit aabe8bf. While the buildPgrxExtension.nix provides darwin-specific linker flags (-undefined dynamic_lookup), framework dependencies are separate from dynamic linking and may still be required. Confirm that darwin builds pass without this framework dependency.

nix/packages/lib.nix (1)

7-8: Host-platform substitution looks consistent.

Line 7 / Line 102 aligns CURRENT_SYSTEM with stdenv.hostPlatform.system; just ensure callers now pass stdenv to makePostgresDevSetup.

Also applies to: 102-104

nix/packages/dbmate-tool.nix (1)

2-4: Host-platform substitution aligns with the rest of the nix changes.

Line 31’s stdenv.hostPlatform.system looks consistent; just make sure call sites now pass stdenv into this module.

Also applies to: 31-32

nix/cargo-pgrx/mkPgrxExtension.nix (1)

41-46: Host-platform passed to the nixos-22.11 tarball is a good consistency fix.

nix/ext/pgrouting/default.nix (2)

52-54: Patch file ./pgrouting-3.4.1-pg17.patch is present and correctly wired. The patch addresses PostgreSQL 17 compatibility in SPI_getvalue calls and applies conditionally when version == "3.4.1" and postgresql.version >= "17" as intended.


15-15: Versions.json relocation confirmed with pgrouting key present.

The pgrouting key exists in nix/ext/versions.json at line 396 with version 3.4.1 supporting PostgreSQL 15 and 17. Line 15 correctly reads from ../versions.json and properly accesses the pgrouting configuration via ${pname}. The module is in sync.

nix/ext/wrappers/default.nix (1)

39-42: The Darwin build setup is already correct. Direct native dependencies (openssl, postgresql) are in buildInputs, and Rust crate dependencies (including security-framework) are properly handled through Cargo. The Darwin-specific environment configuration at lines 46–50 with appropriate RUSTFLAGS for dynamic linking is the correct approach for macOS builds.

Likely an incorrect or invalid review comment.

nix/postgresql/generic.nix (5)

15-15: LGTM: ICU 75 pinning for collation stability.

Pinning ICU to version 75 to maintain collation version 153.120 is well-documented and prevents collation mismatch warnings during nixpkgs upgrades. The comment at lines 123-125 clearly explains the rationale.

Also applies to: 118-126


109-110: LGTM: PIE hardening flag removal is well-explained.

The comment correctly notes that the pie hardening flag is now enabled by default in modern compilers and is no longer needed explicitly.


323-337: LGTM: Test definitions use hostPlatform.system consistently.

The tests now correctly use stdenv.hostPlatform.system instead of the generic system, aligning with the broader PR pattern for host-platform awareness.


159-159: __structuredAttrs = true enables structured attribute handling.

This is a Nix feature that changes how derivation attributes are passed to the builder (as JSON instead of environment variables). This can improve handling of complex attributes but may affect compatibility with some build scripts.


69-69: The OrioleDB version pattern is correctly implemented.

The pattern [0-9][0-9]_.* accurately distinguishes OrioleDB versions (which use underscores like 17_15) from standard PostgreSQL versions (which use dots like 17.6 and 15.14). No false positives occur, as the underscore separator is unique to OrioleDB naming conventions in this repository.

nix/nixpkgs.nix (1)

13-25: LGTM: Oldstable overlay for extension compatibility.

The overlay cleanly exposes older package versions (curl_8_6, v8_oldstable) required by certain extensions. The let binding keeps the oldstable import scoped to the overlay, avoiding pollution of the outer scope.

nix/ext/tests/pgmq.nix (2)

5-9: LGTM: Consistent hostPlatform.system usage.

The changes from pkgs.system to pkgs.stdenv.hostPlatform.system align with the PR-wide refactor for proper host-platform awareness in cross-compilation scenarios.

Also applies to: 44-45


22-29: LGTM: Passthru attributes for interface consistency.

The added installedExtensions, withJIT, and withoutJIT passthru attributes provide a consistent interface matching the main PostgreSQL package. Note that withJIT/withoutJIT both point to the same pkg (acting as stubs), which is acceptable for test environments where JIT toggling isn't needed.

nix/ext/tests/postgis.nix (2)

5-9: LGTM: Consistent hostPlatform.system usage across all package references.

All PostgreSQL package references have been updated to use pkgs.stdenv.hostPlatform.system, providing proper host-platform awareness throughout the test configuration, migration script, and specialisation.

Also applies to: 66-66, 71-73, 87-92


22-29: LGTM: Passthru attributes for interface consistency.

The installedExtensions, withJIT, and withoutJIT passthru attributes follow the same pattern as other extension tests, ensuring a consistent interface.

nix/packages/postgres.nix (1)

28-28: Valid directory-based import for pgrouting.

The change from ../ext/pgrouting.nix to ../ext/pgrouting is correct—the directory contains a default.nix file and follows the directory-based import pattern used by a few other extensions like pgmq and pg_cron. Note that most other extensions in the same file still use file-based .nix imports, indicating a gradual migration rather than a uniform established pattern.

Likely an incorrect or invalid review comment.

nix/ext/tests/pg_plan_filter.nix (3)

7-9: LGTM on platform resolution update.

The switch from pkgs.system to pkgs.stdenv.hostPlatform.system is the correct approach for proper cross-compilation support and aligns with Nix best practices.

Also applies to: 44-45


22-29: LGTM on passthru additions.

The installedExtensions, withJIT, and withoutJIT attributes provide a consistent interface for downstream consumers.


62-62: Verify intended version for defaultSettings.

In the postgresql17 specialisation, defaultSettings references version "15" but the package is psql_17. Should this be (installedExtension "17").defaultSettings or { }?

nix/overlays/default.nix (2)

9-16: LGTM on platform resolution update.

Consistent with the broader PR changes to use hostPlatform.system for proper cross-compilation support.


20-28: No action needed—darwin was not used by cargo-pgrx.

The cargo-pgrx derivation does not reference or depend on darwin. The only platform-specific dependencies are for Linux (pkg-config and openssl in nativeBuildInputs/buildInputs). Removing inherit (final) darwin; from the callPackage has no impact on macOS builds.

Likely an incorrect or invalid review comment.

nix/ext/tests/vault.nix (2)

7-9: LGTM on platform resolution updates.

All references correctly updated to use pkgs.stdenv.hostPlatform.system, including the pgsodium dependency path.

Also applies to: 21-21, 50-51


23-30: LGTM on passthru additions.

The passthru interface is consistent with other test files in this PR.

nix/packages/default.nix (3)

51-51: LGTM on pg-backrest consolidation.

Using the main nixpkgs input instead of a separate nixpkgs-pgbackrest input simplifies the flake inputs while adopting hostPlatform.system for consistency.


44-44: groonga.nix path is correctly referenced. The file exists at ../ext/pgroonga/groonga.nix as specified in line 44. Note: sfcgal was never a standalone package in default.nix—it remains an active dependency in the postgis build configuration.


34-93: sfcgal removal is safe; postgis gets sfcgal from nixpkgs.

PostGIS depends on sfcgal, but since sfcgal is packaged in nixpkgs (version 2.2.0), it will be automatically available to postgis through the standard package context. The removal from this packages set doesn't break the build—postgis will correctly resolve its sfcgal dependency from nixpkgs rather than requiring a local override.

nix/ext/tests/pg_repack.nix (3)

7-9: LGTM on platform resolution update.

Consistent use of pkgs.stdenv.hostPlatform.system for extension lookup.


22-29: LGTM on passthru additions.

The passthru interface matches the pattern established across other test files in this PR.


66-66: LGTM on package reference updates.

All PostgreSQL package references correctly updated to use hostPlatform.system, including the migration script's old/new version references.

Also applies to: 88-90, 104-109

nix/ext/tests/http.nix (1)

7-9: LGTM — host-platform resolution and passthru additions are consistent.
The hostPlatform.system switch and new passthru attributes fit the broader cross-platform test setup.

Also applies to: 24-28, 66-73, 87-92

nix/ext/tests/orioledb.nix (1)

14-20: LGTM — host-platform pathing and passthru exposure look solid.

Also applies to: 23-24, 40-42

nix/ext/tests/plpgsql_check.nix (1)

7-9: LGTM — aligns with host-platform selection and passthru surface.

Also applies to: 24-28, 44-45

nix/ext/tests/default.nix (1)

15-17: LGTM — updated constructor usage and host-platform resolution look correct.

Also applies to: 34-37, 52-53, 173-173

nix/ext/tests/lib.py (1)

8-43: LGTM — lib_name plumbing is clean and constructor update is correct.

Also applies to: 99-101

nix/ext/tests/pgjwt.nix (2)

7-9: Host-platform package resolution looks correct.

Using pkgs.stdenv.hostPlatform.system consistently for extension lookups and psql_* packages should align the test VM with the host platform in cross builds.

Also applies to: 44-45


24-28: Passthru additions are useful for downstream tests.

Exposing installedExtensions, withJIT, and withoutJIT keeps parity with other extension tests.

nix/ext/tests/pgroonga.nix (2)

7-9: Host-platform wiring for extension and runtime deps looks good.

Using host platform variants for the extension lookup, psql_* packages, and MeCab/Groonga runtime paths is consistent and should avoid cross-platform mismatches.

Also applies to: 44-45, 85-91


24-28: Passthru additions look good.

The added installedExtensions, withJIT, and withoutJIT match the pattern across other extension tests.

nix/ext/tests/pg_safeupdate.nix (2)

7-9: Host-platform resolution looks correct.

Switching to pkgs.stdenv.hostPlatform.system for extension lookups and psql_* packages aligns with host platform evaluation.

Also applies to: 44-45


24-28: Passthru additions are consistent with the test suite.

installedExtensions, withJIT, and withoutJIT passthru values look appropriate here.

nix/ext/tests/pgrouting.nix (2)

7-25: Host-platform package wiring is consistent across build and migrations.

The host platform switch is applied coherently to extension paths, pg_regress, and upgrade/specialisation package references.

Also applies to: 49-103, 126-128, 156-158


28-32: Passthru surface expansion looks good.

Adding installedExtensions, withJIT, and withoutJIT matches the broader test-suite pattern.

nix/ext/plv8/default.nix (1)

16-16: Input and patch/build-input structure is clear.

The new v8_oldstable input and explicit patch/nativeBuildInputs blocks improve readability.

Also applies to: 57-73

nix/ext/tests/timescaledb.nix (2)

5-29: Host-platform selection and passthru additions look good.

These updates align with the broader hostPlatform-based packaging pattern and keep passthru consistent with other extensions.

Also applies to: 44-44


93-99: Constructor and method signatures verified—no action needed.

The PostgresExtensionTest constructor correctly accepts the lib_name parameter as the 7th argument, and check_switch_extension_with_background_worker properly handles the Path and version arguments. The implementation uses self.lib_name in assertions to check the resolved symlink, which aligns with passing "timescaledb-loader". The psql_15 environment is correctly built with the extension included via buildEnv, and /lib paths are linked, so the loader artifact should be available at the expected path.

flake.nix (1)

10-29: Inputs update and lock file are in sync. All inputs from flake.nix (including the pinned nixpkgs-oldstable at revision a76c4553d7e741e17f289224eda135423de0491d) are properly locked in flake.lock with their respective hashes and revisions.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment on lines 47 to 48
self.inputs.nixpkgs.lib.nixos.runTest {
name = "timescaledb";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Test name mismatch: "timescaledb" should be "pgmq".

The test name is hardcoded as "timescaledb" but this file tests the pgmq extension. This appears to be a copy-paste error that should be corrected for clarity in test reports.

🐛 Suggested fix
 self.inputs.nixpkgs.lib.nixos.runTest {
-  name = "timescaledb";
+  name = pname;
   hostPkgs = pkgs;
🤖 Prompt for AI Agents
In `@nix/ext/tests/pgmq.nix` around lines 47 - 48, The test invocation uses
self.inputs.nixpkgs.lib.nixos.runTest with a hardcoded name = "timescaledb"
which is incorrect for this file; change the name value to "pgmq" so the test
name matches the extension under test (locate the name = "timescaledb" within
the runTest call and replace it with name = "pgmq").

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.

6 participants