From d1478e78c0aca20bc231c81e908c1c8fe65f1645 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Fri, 8 Nov 2024 19:48:39 +0100 Subject: [PATCH 1/2] postgresqlPackages.system_stats: fix build on darwin The build was failing with: darwin/io_analysis.c:71:21: error: variable length array used [-Werror,-Wvla] char device_name[kMaxDiskNameSize]; ^~~~~~~~~~~~~~~~ --- pkgs/servers/sql/postgresql/ext/system_stats.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/servers/sql/postgresql/ext/system_stats.nix b/pkgs/servers/sql/postgresql/ext/system_stats.nix index c1700fc0380d..03d3034079a1 100644 --- a/pkgs/servers/sql/postgresql/ext/system_stats.nix +++ b/pkgs/servers/sql/postgresql/ext/system_stats.nix @@ -17,6 +17,8 @@ stdenv.mkDerivation rec { hash = "sha256-/xXnui0S0ZjRw7P8kMAgttHVv8T41aOhM3pM8P0OTig="; }; + buildFlags = [ "PG_CFLAGS=-Wno-error=vla" ]; + installPhase = '' runHook preInstall From 4801d0c2a3a5ad9c85b4fb24433dc6e257bdbcba Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Fri, 8 Nov 2024 19:50:03 +0100 Subject: [PATCH 2/2] postgresql17Packages.{pg_cron,pg_hll}: fix build on x86_64-darwin This fixes the following error: error: comparison of integers of different signs: 'ssize_t' (aka 'long') and 'const size_t' (aka 'const unsigned long') [-Werror,-Wsign-compare] if (part < iov[i].iov_len) ~~~~ ^ ~~~~~~~~~~~~~~ --- pkgs/servers/sql/postgresql/generic.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/servers/sql/postgresql/generic.nix b/pkgs/servers/sql/postgresql/generic.nix index 0badde7a4df3..71bb6e20f3f5 100644 --- a/pkgs/servers/sql/postgresql/generic.nix +++ b/pkgs/servers/sql/postgresql/generic.nix @@ -165,6 +165,12 @@ let src = ./patches/locale-binary-path.patch; locale = "${if stdenv.hostPlatform.isDarwin then darwin.adv_cmds else lib.getBin stdenv.cc.libc}/bin/locale"; }) + ] ++ lib.optionals (stdenv'.hostPlatform.isDarwin && atLeast "17") [ + # TODO: Remove this with the next set of minor releases + (fetchpatch ({ + url = "https://github.com/postgres/postgres/commit/0a883a067bd78f0ff0607afb18c4f783ac764504.patch"; + hash = "sha256-F3zCaar6w6bwQDno7Tkg7ZbPJ+rhgi8/2NSvFakzQek="; + })) ] ++ lib.optionals (olderThan "17") [ # TODO: Remove this with the next set of minor releases (fetchpatch (