postgresql_18: init at 18beta1 (#411958)

authored by Wolfgang Walther and committed by GitHub aa038806 b96523cb

+78 -15
+4 -2
nixos/modules/services/databases/postgresql.md
··· 251 252 Technically, we'd not want to have EOL'ed packages in a stable NixOS release, which is to be supported until one month after the previous release. Thus, with NixOS' release schedule in May and November, the oldest PostgreSQL version in nixpkgs would have to be supported until December. It could be argued that a soon-to-be-EOL-ed version should thus be removed in May for the .05 release already. But since new security vulnerabilities are first disclosed in February of the following year, we agreed on keeping the oldest PostgreSQL major version around one more cycle in [#310580](https://github.com/NixOS/nixpkgs/pull/310580#discussion_r1597284693). 253 254 - Thus: 255 - - In September/October the new major version will be released and added to nixos-unstable. 256 - In November the last minor version for the oldest major will be released. 257 - Both the current stable .05 release and nixos-unstable should be updated to the latest minor that will usually be released in November. 258 - This is relevant for people who need to use this major for as long as possible. In that case its desirable to be able to pin nixpkgs to a commit that still has it, at the latest minor available.
··· 251 252 Technically, we'd not want to have EOL'ed packages in a stable NixOS release, which is to be supported until one month after the previous release. Thus, with NixOS' release schedule in May and November, the oldest PostgreSQL version in nixpkgs would have to be supported until December. It could be argued that a soon-to-be-EOL-ed version should thus be removed in May for the .05 release already. But since new security vulnerabilities are first disclosed in February of the following year, we agreed on keeping the oldest PostgreSQL major version around one more cycle in [#310580](https://github.com/NixOS/nixpkgs/pull/310580#discussion_r1597284693). 253 254 + Thus, our release workflow is as follows: 255 + 256 + - In May, `nixpkgs` packages the beta release for an upcoming major version. This is packaged for nixos-unstable only and will not be part of any stable NixOS release. 257 + - In September/October the new major version will be released, replacing the beta package in nixos-unstable. 258 - In November the last minor version for the oldest major will be released. 259 - Both the current stable .05 release and nixos-unstable should be updated to the latest minor that will usually be released in November. 260 - This is relevant for people who need to use this major for as long as possible. In that case its desirable to be able to pin nixpkgs to a commit that still has it, at the latest minor available.
+28 -13
nixos/modules/services/databases/postgresql.nix
··· 43 44 cfg = config.services.postgresql; 45 46 - # ensure that 47 - # services.postgresql = { 48 - # enableJIT = true; 49 - # package = pkgs.postgresql_<major>; 50 - # }; 51 - # works. 52 - basePackage = if cfg.enableJIT then cfg.package.withJIT else cfg.package.withoutJIT; 53 - 54 - postgresql = if cfg.extensions == [ ] then basePackage else basePackage.withPackages cfg.extensions; 55 - 56 toStr = 57 value: 58 if true == value then ··· 72 ); 73 74 configFileCheck = pkgs.runCommand "postgresql-configfile-check" { } '' 75 - ${cfg.package}/bin/postgres -D${configFile} -C config_file >/dev/null 76 touch $out 77 ''; 78 79 groupAccessAvailable = versionAtLeast cfg.finalPackage.version "11.0"; 80 81 - extensionNames = map getName postgresql.installedExtensions; 82 extensionInstalled = extension: elem extension extensionNames; 83 in 84 ··· 143 finalPackage = mkOption { 144 type = types.package; 145 readOnly = true; 146 - default = postgresql; 147 defaultText = "with config.services.postgresql; package.withPackages extensions"; 148 description = '' 149 The postgresql package that will effectively be used in the system. ··· 635 ###### implementation 636 637 config = mkIf cfg.enable { 638 639 assertions = map ( 640 { name, ensureDBOwnership, ... }:
··· 43 44 cfg = config.services.postgresql; 45 46 toStr = 47 value: 48 if true == value then ··· 62 ); 63 64 configFileCheck = pkgs.runCommand "postgresql-configfile-check" { } '' 65 + ${cfg.finalPackage}/bin/postgres -D${configFile} -C config_file >/dev/null 66 touch $out 67 ''; 68 69 groupAccessAvailable = versionAtLeast cfg.finalPackage.version "11.0"; 70 71 + extensionNames = map getName cfg.finalPackage.installedExtensions; 72 extensionInstalled = extension: elem extension extensionNames; 73 in 74 ··· 133 finalPackage = mkOption { 134 type = types.package; 135 readOnly = true; 136 + default = 137 + let 138 + # ensure that 139 + # services.postgresql = { 140 + # enableJIT = true; 141 + # package = pkgs.postgresql_<major>; 142 + # }; 143 + # works. 144 + withJit = if cfg.enableJIT then cfg.package.withJIT else cfg.package.withoutJIT; 145 + withJitAndPackages = if cfg.extensions == [ ] then withJit else withJit.withPackages cfg.extensions; 146 + in 147 + withJitAndPackages; 148 defaultText = "with config.services.postgresql; package.withPackages extensions"; 149 description = '' 150 The postgresql package that will effectively be used in the system. ··· 636 ###### implementation 637 638 config = mkIf cfg.enable { 639 + 640 + warnings = ( 641 + let 642 + unstableState = 643 + if lib.hasInfix "beta" cfg.package.version then 644 + "in beta" 645 + else if lib.hasInfix "rc" cfg.package.version then 646 + "a release candidate" 647 + else 648 + null; 649 + in 650 + lib.optional (unstableState != null) 651 + "PostgreSQL ${lib.versions.major cfg.package.version} is currently ${unstableState}, and is not advised for use in production environments." 652 + ); 653 654 assertions = map ( 655 { name, ensureDBOwnership, ... }:
+11
pkgs/servers/sql/postgresql/18.nix
···
··· 1 + import ./generic.nix { 2 + version = "18beta1"; 3 + rev = "refs/tags/REL_18_BETA1"; 4 + hash = "sha256-P86bVYfPzkwK/rcvUInYZew/pKejk58/IcnDGx/BWno="; 5 + muslPatches = { 6 + dont-use-locale-a = { 7 + url = "https://git.alpinelinux.org/aports/plain/main/postgresql17/dont-use-locale-a-on-musl.patch?id=d69ead2c87230118ae7f72cef7d761e761e1f37e"; 8 + hash = "sha256-6zjz3OpMx4qTETdezwZxSJPPdOvhCNu9nXvAaU9SwH8="; 9 + }; 10 + }; 11 + }
+1
pkgs/servers/sql/postgresql/default.nix
··· 14 postgresql_15 = ./15.nix; 15 postgresql_16 = ./16.nix; 16 postgresql_17 = ./17.nix; 17 }; 18 19 mkAttributes =
··· 14 postgresql_15 = ./15.nix; 15 postgresql_16 = ./16.nix; 16 postgresql_17 = ./17.nix; 17 + postgresql_18 = ./18.nix; 18 }; 19 20 mkAttributes =
+31
pkgs/servers/sql/postgresql/generic.nix
··· 58 # bonjour 59 bonjourSupport ? false, 60 61 # GSSAPI 62 gssSupport ? with stdenv.hostPlatform; !isWindows && !isStatic, 63 libkrb5, ··· 88 nlsSupport ? false, 89 gettext, 90 91 # PAM 92 pamSupport ? 93 lib.meta.availableOn stdenv.hostPlatform linux-pam ··· 135 # Systemd 136 systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemdLibs, 137 systemdLibs, 138 }@args: 139 let 140 atLeast = lib.versionAtLeast version; ··· 256 ++ lib.optionals lz4Enabled [ lz4 ] 257 ++ lib.optionals zstdEnabled [ zstd ] 258 ++ lib.optionals systemdSupport [ systemdLibs ] 259 ++ lib.optionals gssSupport [ libkrb5 ] 260 ++ lib.optionals pamSupport [ linux-pam ] 261 ++ lib.optionals perlSupport [ perl ] ··· 328 ++ lib.optionals (withWalBlocksize != null) [ "--with-wal-blocksize=${toString withWalBlocksize}" ] 329 ++ lib.optionals lz4Enabled [ "--with-lz4" ] 330 ++ lib.optionals zstdEnabled [ "--with-zstd" ] 331 ++ lib.optionals gssSupport [ "--with-gssapi" ] 332 ++ lib.optionals pythonSupport [ "--with-python" ] 333 ++ lib.optionals jitSupport [ "--with-llvm" ]
··· 58 # bonjour 59 bonjourSupport ? false, 60 61 + # Curl 62 + curlSupport ? 63 + lib.versionAtLeast version "18" 64 + && lib.meta.availableOn stdenv.hostPlatform curl 65 + # Building statically fails with: 66 + # configure: error: library 'curl' does not provide curl_multi_init 67 + # https://www.postgresql.org/message-id/487dacec-6d8d-46c0-a36f-d5b8c81a56f1%40technowledgy.de 68 + && !stdenv.hostPlatform.isStatic, 69 + curl, 70 + 71 # GSSAPI 72 gssSupport ? with stdenv.hostPlatform; !isWindows && !isStatic, 73 libkrb5, ··· 98 nlsSupport ? false, 99 gettext, 100 101 + # NUMA 102 + numaSupport ? 103 + lib.versionAtLeast version "18" 104 + && lib.meta.availableOn stdenv.hostPlatform numactl 105 + # NUMA can fail in 18beta1 on some hardware with: 106 + # ERROR: invalid NUMA node id outside of allowed range [0, 0]: 1 107 + # https://github.com/NixOS/nixpkgs/pull/411958#issuecomment-3031680123 108 + # https://www.postgresql.org/message-id/flat/E1u1tr8-003BbN-2E%40gemulon.postgresql.org 109 + && version != "18beta1", 110 + numactl, 111 + 112 # PAM 113 pamSupport ? 114 lib.meta.availableOn stdenv.hostPlatform linux-pam ··· 156 # Systemd 157 systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemdLibs, 158 systemdLibs, 159 + 160 + # Uring 161 + uringSupport ? lib.versionAtLeast version "18" && lib.meta.availableOn stdenv.hostPlatform liburing, 162 + liburing, 163 }@args: 164 let 165 atLeast = lib.versionAtLeast version; ··· 281 ++ lib.optionals lz4Enabled [ lz4 ] 282 ++ lib.optionals zstdEnabled [ zstd ] 283 ++ lib.optionals systemdSupport [ systemdLibs ] 284 + ++ lib.optionals uringSupport [ liburing ] 285 + ++ lib.optionals curlSupport [ curl ] 286 + ++ lib.optionals numaSupport [ numactl ] 287 ++ lib.optionals gssSupport [ libkrb5 ] 288 ++ lib.optionals pamSupport [ linux-pam ] 289 ++ lib.optionals perlSupport [ perl ] ··· 356 ++ lib.optionals (withWalBlocksize != null) [ "--with-wal-blocksize=${toString withWalBlocksize}" ] 357 ++ lib.optionals lz4Enabled [ "--with-lz4" ] 358 ++ lib.optionals zstdEnabled [ "--with-zstd" ] 359 + ++ lib.optionals uringSupport [ "--with-liburing" ] 360 + ++ lib.optionals curlSupport [ "--with-libcurl" ] 361 + ++ lib.optionals numaSupport [ "--with-libnuma" ] 362 ++ lib.optionals gssSupport [ "--with-gssapi" ] 363 ++ lib.optionals pythonSupport [ "--with-python" ] 364 ++ lib.optionals jitSupport [ "--with-llvm" ]
+3
pkgs/top-level/all-packages.nix
··· 10581 postgresql_15 10582 postgresql_16 10583 postgresql_17 10584 ; 10585 10586 inherit (postgresqlJitVersions) ··· 10589 postgresql_15_jit 10590 postgresql_16_jit 10591 postgresql_17_jit 10592 ; 10593 postgresql = postgresql_17; 10594 postgresql_jit = postgresql_17_jit; ··· 10598 postgresql15Packages = recurseIntoAttrs postgresql_15.pkgs; 10599 postgresql16Packages = recurseIntoAttrs postgresql_16.pkgs; 10600 postgresql17Packages = recurseIntoAttrs postgresql_17.pkgs; 10601 10602 postgres-websockets = haskellPackages.postgres-websockets.bin; 10603 postgrest = haskellPackages.postgrest.bin;
··· 10581 postgresql_15 10582 postgresql_16 10583 postgresql_17 10584 + postgresql_18 10585 ; 10586 10587 inherit (postgresqlJitVersions) ··· 10590 postgresql_15_jit 10591 postgresql_16_jit 10592 postgresql_17_jit 10593 + postgresql_18_jit 10594 ; 10595 postgresql = postgresql_17; 10596 postgresql_jit = postgresql_17_jit; ··· 10600 postgresql15Packages = recurseIntoAttrs postgresql_15.pkgs; 10601 postgresql16Packages = recurseIntoAttrs postgresql_16.pkgs; 10602 postgresql17Packages = recurseIntoAttrs postgresql_17.pkgs; 10603 + postgresql18Packages = recurseIntoAttrs postgresql_18.pkgs; 10604 10605 postgres-websockets = haskellPackages.postgres-websockets.bin; 10606 postgrest = haskellPackages.postgrest.bin;