From ef7dc14ab4287c6644c914c3949a9f99a2c41bc6 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Fri, 8 Nov 2024 17:45:25 +0100 Subject: [PATCH] postgresql: drop build-time dependency on GHC This replaces `writeShellApplication` with `writeShellScriptBin` that doesn't perform a shellcheck. This makes it way easier to build postgresql on staging since GHC is super slow to build, even with pretty powerful machines. Also Haskell updates are currently merged straight into master which means that postgresql and all reverse dependencies require a rebuild on master then[1]. [1] https://github.com/NixOS/nixpkgs/pull/354270#issuecomment-2463196665 (cherry picked from commit 4cd083a3cdf25fce6d1c0bb232e241681fad34ca) (cherry picked from commit a40d887561d5f4a6d330181891d78174f82e84e4) --- pkgs/servers/sql/postgresql/generic.nix | 7 ++----- pkgs/servers/sql/postgresql/pg_config.sh | 2 ++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pkgs/servers/sql/postgresql/generic.nix b/pkgs/servers/sql/postgresql/generic.nix index 8a0069764a00..af643c6c0e2b 100644 --- a/pkgs/servers/sql/postgresql/generic.nix +++ b/pkgs/servers/sql/postgresql/generic.nix @@ -7,7 +7,7 @@ let , pkg-config, libxml2, tzdata, libkrb5, substituteAll, darwin , linux-pam, bison, flex, perl, docbook_xml_dtd_45, docbook-xsl-nons, libxslt - , removeReferencesTo, writeShellApplication + , removeReferencesTo, writeShellScriptBin , systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemdLibs , gssSupport ? with stdenv.hostPlatform; !isWindows && !isStatic @@ -49,10 +49,7 @@ let else stdenv; - pg_config = writeShellApplication { - name = "pg_config"; - text = builtins.readFile ./pg_config.sh; - }; + pg_config = writeShellScriptBin "pg_config" (builtins.readFile ./pg_config.sh); in stdenv'.mkDerivation (finalAttrs: { inherit version; pname = pname + lib.optionalString jitSupport "-jit"; diff --git a/pkgs/servers/sql/postgresql/pg_config.sh b/pkgs/servers/sql/postgresql/pg_config.sh index 9538b213fb97..d6293999a12d 100644 --- a/pkgs/servers/sql/postgresql/pg_config.sh +++ b/pkgs/servers/sql/postgresql/pg_config.sh @@ -1,3 +1,5 @@ +set -euo pipefail + # The real pg_config needs to be in the same path as the "postgres" binary # to return proper paths. However, we want it in the -dev output to prevent # cyclic references and to prevent blowing up the runtime closure. Thus, we