From f49284a20588d690a50ccf8e9ceaf47b13bf60c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Boros?= Date: Mon, 14 Sep 2026 15:50:25 +0300 Subject: [PATCH 1/3] chore(nix): stop exposing redundant extension jobs in legacyPackages Co-Authored-By: Claude Sonnet 5 --- nix/packages/extension-catalog.nix | 9 +-------- nix/packages/postgres.nix | 14 +++++++++----- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/nix/packages/extension-catalog.nix b/nix/packages/extension-catalog.nix index d8d5591216..547f7baaa7 100644 --- a/nix/packages/extension-catalog.nix +++ b/nix/packages/extension-catalog.nix @@ -116,13 +116,6 @@ '' ) ) perMajor; - - versions = lib.mapAttrs' ( - major: wrappers: - lib.nameValuePair "site-extensions-versions-${major}" ( - lib.recurseIntoAttrs (lib.mapAttrs (_: lib.recurseIntoAttrs) wrappers) - ) - ) perMajor; in { packages = catalogs // { @@ -163,6 +156,6 @@ ''; }; }; - legacyPackages = catalogs // versions; + legacyPackages = catalogs; }; } diff --git a/nix/packages/postgres.nix b/nix/packages/postgres.nix index 87daccdae7..75cd36628d 100644 --- a/nix/packages/postgres.nix +++ b/nix/packages/postgres.nix @@ -216,17 +216,21 @@ # installed, and a receipt.json file containing metadata about the # install. # - exts: an attrset containing all the extensions, mapped to their - # package names. + # package names. Only exposed for the "full" variant. makePostgres = version: { variant ? "full", latestOnly ? false, }: - lib.recurseIntoAttrs { - bin = makePostgresBin version { inherit variant latestOnly; }; - exts = makeOurPostgresPkgsSet version { inherit variant latestOnly; }; - }; + lib.recurseIntoAttrs ( + { + bin = makePostgresBin version { inherit variant latestOnly; }; + } + // lib.optionalAttrs (variant == "full" && !latestOnly) { + exts = makeOurPostgresPkgsSet version { inherit variant latestOnly; }; + } + ); basePackages = { psql_15 = makePostgres "15" { }; psql_17 = makePostgres "17" { }; From 28ecca2899282c3566eb91679d838cc366bf68a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Boros?= Date: Mon, 14 Sep 2026 16:49:13 +0300 Subject: [PATCH 2/3] fix: keep slim exts, checks.nix borrows pgroonga from it nix-eval failed: checks.nix's slim pgTAP harness reads legacyPackages.psql_*_slim.exts.pgroonga directly. Only cli's exts was actually unused. Co-Authored-By: Claude Sonnet 5 --- nix/packages/postgres.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nix/packages/postgres.nix b/nix/packages/postgres.nix index 75cd36628d..b8fe8e3c83 100644 --- a/nix/packages/postgres.nix +++ b/nix/packages/postgres.nix @@ -216,7 +216,9 @@ # installed, and a receipt.json file containing metadata about the # install. # - exts: an attrset containing all the extensions, mapped to their - # package names. Only exposed for the "full" variant. + # package names. Not exposed for the "cli" variant, which nothing + # reads it from (checks.nix's cli check harness borrows pgroonga + # from the full psql_17 instead). makePostgres = version: { @@ -227,7 +229,7 @@ { bin = makePostgresBin version { inherit variant latestOnly; }; } - // lib.optionalAttrs (variant == "full" && !latestOnly) { + // lib.optionalAttrs (variant != "cli") { exts = makeOurPostgresPkgsSet version { inherit variant latestOnly; }; } ); From 530148eb81631a645c087f05606a6bbeaa2c621d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Boros?= Date: Mon, 14 Sep 2026 17:29:53 +0300 Subject: [PATCH 3/3] refactor: expose only pgroonga from slim exts, not the full set checks.nix's slim pgTAP harness only ever reads exts.pgroonga (for MECAB_LIB). Same derivation, just no longer dragging the other ~28 slim extensions along as separate CI jobs. Co-Authored-By: Claude Sonnet 5 --- nix/packages/postgres.nix | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/nix/packages/postgres.nix b/nix/packages/postgres.nix index b8fe8e3c83..2568cc1091 100644 --- a/nix/packages/postgres.nix +++ b/nix/packages/postgres.nix @@ -142,6 +142,22 @@ in map (path: extCallPackage path { }) extensionsToUse; + # Build a single extension package, standalone (not the whole server's set). + makeSingleExt = + version: latestOnly: extPath: + let + postgresql = getPostgresqlPackage version latestOnly; + extCallPackage = pkgs.lib.callPackageWith ( + pkgs + // { + inherit postgresql latestOnly; + switch-ext-version = extCallPackage ./switch-ext-version.nix { }; + overlayfs-on-package = extCallPackage ./overlayfs-on-package.nix { }; + } + ); + in + extCallPackage extPath { }; + # Create an attrset that contains all the extensions included in a server. makeOurPostgresPkgsSet = version: @@ -215,10 +231,12 @@ # - bin: the postgresql package itself, with all the extensions # installed, and a receipt.json file containing metadata about the # install. - # - exts: an attrset containing all the extensions, mapped to their - # package names. Not exposed for the "cli" variant, which nothing - # reads it from (checks.nix's cli check harness borrows pgroonga - # from the full psql_17 instead). + # - exts: an attrset containing extension packages. The "cli" variant + # doesn't expose it (nothing reads it: checks.nix's cli check + # harness borrows pgroonga from the full psql_17 instead). The + # "slim" variants (latestOnly) only expose pgroonga, the one + # extension checks.nix actually needs from them, instead of every + # extension - each of which would otherwise be its own CI job. makePostgres = version: { @@ -230,7 +248,11 @@ bin = makePostgresBin version { inherit variant latestOnly; }; } // lib.optionalAttrs (variant != "cli") { - exts = makeOurPostgresPkgsSet version { inherit variant latestOnly; }; + exts = + if latestOnly then + { pgroonga = makeSingleExt version latestOnly ../ext/pgroonga; } + else + makeOurPostgresPkgsSet version { inherit variant latestOnly; }; } ); basePackages = {