From 9869d7f7466d3d4e4c5bca289f6c0e6df74bd0c1 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sun, 2 Jun 2024 16:00:02 +0200 Subject: [PATCH] postgresql: enable tests on darwin The tests were disabled in #62752. The problem is System Integrity Protection on macOS, which resets DYDL_LIBRARY_PATH and thus breaks the temporary installation of PostgreSQL. By running the checks *after* the installPhase, the libraries will already be available in the default locations. --- pkgs/servers/sql/postgresql/generic.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/sql/postgresql/generic.nix b/pkgs/servers/sql/postgresql/generic.nix index 5adb3db67db69..69edb08d49e4f 100644 --- a/pkgs/servers/sql/postgresql/generic.nix +++ b/pkgs/servers/sql/postgresql/generic.nix @@ -218,9 +218,13 @@ let wrapProgram $out/bin/initdb --prefix PATH ":" ${glibc.bin}/bin ''; - doCheck = !stdenv'.hostPlatform.isDarwin; - # autodetection doesn't seem to able to find this, but it's there. - checkTarget = "check-world"; + # Running tests as "install check" to work around SIP issue on macOS: + # https://www.postgresql.org/message-id/flat/4D8E1BC5-BBCF-4B19-8226-359201EA8305%40gmail.com + # Also see /doc/stdenv/platform-notes.chapter.md + doCheck = false; + # Tests just get stuck on macOS 14.x for v13 and v14 + doInstallCheck = !(stdenv'.hostPlatform.isDarwin && olderThan "15"); + installCheckTarget = "check-world"; passthru = let this = self.callPackage generic args;