Merge: postgresqlPackages.{pgvecto-rs,timescaledb_toolkit}: fix build on darwin (#358403)

This commit is contained in:
Maximilian Bosch 2024-11-23 18:37:23 +01:00 committed by GitHub
commit 2ce65e56b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 6 deletions

View File

@ -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" <<EOF
listen_addresses = ''\''
unix_socket_directories = '$PGHOST'
EOF
# This is primarily for Mac or other Nix systems that don't use the nixbld user.
export USER="$(whoami)"
pg_ctl start
createuser -h localhost --superuser --createdb "$USER" || true
createuser --superuser --createdb "$USER" || true
pg_ctl stop
'';

View File

@ -92,10 +92,9 @@ in
};
meta = with lib; {
# Upstream removed support for PostgreSQL 12 and 13 on 0.3.0: https://github.com/tensorchord/pgvecto.rs/issues/343
# Upstream removed support for PostgreSQL 13 on 0.3.0: https://github.com/tensorchord/pgvecto.rs/issues/343
broken =
stdenv.hostPlatform.isDarwin
|| (versionOlder postgresql.version "14")
(versionOlder postgresql.version "14")
||
# PostgreSQL 17 support issue upstream: https://github.com/tensorchord/pgvecto.rs/issues/607
# Check after next package update.