From 7c36e1c027470e68ce22451430f33bbb2de2cd45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Mon, 23 Feb 2026 12:50:31 +0100 Subject: [PATCH 1/4] feat: limit nix-eval-jobs max memory to 3 GiB per worker --- nix/packages/github-matrix/github_matrix.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/nix/packages/github-matrix/github_matrix.py b/nix/packages/github-matrix/github_matrix.py index 81385c2151..e5cacbeb0d 100755 --- a/nix/packages/github-matrix/github_matrix.py +++ b/nix/packages/github-matrix/github_matrix.py @@ -89,7 +89,9 @@ class NixEvalError(TypedDict): } -def build_nix_eval_command(max_workers: int, flake_outputs: List[str]) -> List[str]: +def build_nix_eval_command( + max_workers: int, max_memory_size: int, flake_outputs: List[str] +) -> List[str]: """Build the nix-eval-jobs command with appropriate flags.""" nix_eval_cmd = [ "nix-eval-jobs", @@ -104,6 +106,8 @@ def build_nix_eval_command(max_workers: int, flake_outputs: List[str]) -> List[s "--option", "accept-flake-config", "true", + "--max-memory-size", + str(max_memory_size), "--workers", str(max_workers), "--select", @@ -280,6 +284,12 @@ def main() -> None: parser = argparse.ArgumentParser( description="Generate GitHub Actions matrix for Nix builds" ) + parser.add_argument( + "--max-memory-size", + default=3072, + type=int, + help="Maximum memory per eval worker in MiB. Defaults to 3072 (3 GiB).", + ) parser.add_argument( "flake_outputs", nargs="+", help="Nix flake outputs to evaluate" ) @@ -288,7 +298,7 @@ def main() -> None: max_workers: int = os.cpu_count() or 1 - cmd = build_nix_eval_command(max_workers, args.flake_outputs) + cmd = build_nix_eval_command(max_workers, args.max_memory_size, args.flake_outputs) # Run evaluation and collect packages, warnings, and errors packages, warnings_list, errors_list = run_nix_eval_jobs(cmd) From ef04f08fe5f400ec8381204276712a1e34b3277b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Mon, 23 Feb 2026 12:53:51 +0100 Subject: [PATCH 2/4] feat: log nix-eval-jobs command to stderr --- nix/packages/github-matrix/github_matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/packages/github-matrix/github_matrix.py b/nix/packages/github-matrix/github_matrix.py index e5cacbeb0d..7c1e32d755 100755 --- a/nix/packages/github-matrix/github_matrix.py +++ b/nix/packages/github-matrix/github_matrix.py @@ -172,7 +172,7 @@ def run_nix_eval_jobs( Returns: Tuple of (packages, warnings_list, errors_list) """ - debug(f"Running command: {' '.join(cmd)}") + print(f"Running: {' '.join(cmd)}", file=sys.stderr) # Disable colors in nix output env = os.environ.copy() From 9d03774cbd394a0c67875b809d6c0e04e33818f3 Mon Sep 17 00:00:00 2001 From: Yvan Sraka Date: Wed, 18 Feb 2026 22:42:23 +0100 Subject: [PATCH 3/4] fix(pg-safeupdate): configure missing control and sql files for pg_safeupdate extension The install was failing on orioledb 17 because pg_safeupdate extension was missing control and sql files. This adds the necessary control and sql files, as well as upgrade paths between versions, ensuring the extension can be properly installed and upgraded across PostgreSQL versions. --- nix/ext/pg-safeupdate.nix | 17 +++++++++++++++++ nix/tests/expected/z_15_ext_interface.out | 3 ++- nix/tests/expected/z_17_ext_interface.out | 3 ++- .../expected/z_orioledb-17_ext_interface.out | 3 ++- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/nix/ext/pg-safeupdate.nix b/nix/ext/pg-safeupdate.nix index 97921c9c6c..b68e0f1ff2 100644 --- a/nix/ext/pg-safeupdate.nix +++ b/nix/ext/pg-safeupdate.nix @@ -32,6 +32,8 @@ let # Install versioned library install -Dm755 ${pname}${postgresql.dlSuffix} $out/lib/${pname}-${version}${postgresql.dlSuffix} + touch $out/share/postgresql/extension/${pname}--${version}.control + touch $out/share/postgresql/extension/${pname}--${version}.sql runHook postInstall ''; @@ -76,6 +78,21 @@ pkgs.buildEnv { toString (numberOfVersionsBuilt + 1) }" ) + + # Create empty upgrade files between consecutive versions + # plpgsql_check ships without upgrade scripts - extensions are backward-compatible + previous_version="" + for ver in ${lib.concatStringsSep " " versions}; do + if [[ -n "$previous_version" ]]; then + touch $out/share/postgresql/extension/${pname}--''${previous_version}--''${ver}.sql + fi + previous_version=$ver + done + + { + echo "default_version = '${latestVersion}'" + cat $out/share/postgresql/extension/${pname}--${latestVersion}.control + } > $out/share/postgresql/extension/${pname}.control ''; passthru = { diff --git a/nix/tests/expected/z_15_ext_interface.out b/nix/tests/expected/z_15_ext_interface.out index b456af76cc..51d50f6657 100644 --- a/nix/tests/expected/z_15_ext_interface.out +++ b/nix/tests/expected/z_15_ext_interface.out @@ -31,9 +31,10 @@ order by ----------------- pg_cron pgjwt + safeupdate tsm_system_time wal2json -(4 rows) +(5 rows) /* diff --git a/nix/tests/expected/z_17_ext_interface.out b/nix/tests/expected/z_17_ext_interface.out index 40eb5a7298..75bd97dbd9 100644 --- a/nix/tests/expected/z_17_ext_interface.out +++ b/nix/tests/expected/z_17_ext_interface.out @@ -25,9 +25,10 @@ order by pg_cron pgjwt postgis_tiger_geocoder + safeupdate tsm_system_time wal2json -(5 rows) +(6 rows) /* diff --git a/nix/tests/expected/z_orioledb-17_ext_interface.out b/nix/tests/expected/z_orioledb-17_ext_interface.out index 050e81bd66..dea8e85d5e 100644 --- a/nix/tests/expected/z_orioledb-17_ext_interface.out +++ b/nix/tests/expected/z_orioledb-17_ext_interface.out @@ -25,9 +25,10 @@ order by pg_cron pgjwt postgis_tiger_geocoder + safeupdate tsm_system_time wal2json -(5 rows) +(6 rows) /* From 8e845afb84d783cf0e7f950c0314161db4bca7cd Mon Sep 17 00:00:00 2001 From: Yvan Sraka Date: Wed, 18 Feb 2026 10:45:31 +0100 Subject: [PATCH 4/4] (wip) experiment with a reduced number of workers --- nix/packages/github-matrix/github_matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/packages/github-matrix/github_matrix.py b/nix/packages/github-matrix/github_matrix.py index 7c1e32d755..9cbb4b8e89 100755 --- a/nix/packages/github-matrix/github_matrix.py +++ b/nix/packages/github-matrix/github_matrix.py @@ -296,7 +296,7 @@ def main() -> None: args = parser.parse_args() - max_workers: int = os.cpu_count() or 1 + max_workers: int = int(os.cpu_count() / 2) or 1 cmd = build_nix_eval_command(max_workers, args.max_memory_size, args.flake_outputs)