From 62b175ed21902437539a1903d95cd299a4af1c51 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sat, 23 Nov 2024 12:24:33 +0100 Subject: [PATCH] postgresqlPackages.{pgvecto-rs,timescaledb_toolkit}: fix build on darwin cargo-pgrx runs a temporary PostgreSQL cluster when building. This needs to run with unix sockets only, otherwise it breaks in the darwin sandbox. --- .../tools/rust/cargo-pgrx/buildPgrxExtension.nix | 12 +++++++++--- .../sql/postgresql/ext/pgvecto-rs/default.nix | 5 ++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/pkgs/development/tools/rust/cargo-pgrx/buildPgrxExtension.nix b/pkgs/development/tools/rust/cargo-pgrx/buildPgrxExtension.nix index 89293ab62ef8..785a500c3917 100644 --- a/pkgs/development/tools/rust/cargo-pgrx/buildPgrxExtension.nix +++ b/pkgs/development/tools/rust/cargo-pgrx/buildPgrxExtension.nix @@ -85,15 +85,21 @@ let pgrxPostgresMajor = lib.versions.major postgresql.version; preBuildAndTest = '' - export PGRX_HOME=$(mktemp -d) + export PGRX_HOME="$(mktemp -d)" export PGDATA="$PGRX_HOME/data-${pgrxPostgresMajor}/" cargo-pgrx pgrx init "--pg${pgrxPostgresMajor}" ${lib.getDev postgresql}/bin/pg_config - echo "unix_socket_directories = '$(mktemp -d)'" > "$PGDATA/postgresql.conf" + + # unix sockets work in sandbox, too. + export PGHOST="$(mktemp -d)" + cat > "$PGDATA/postgresql.conf" <