Skip to content

Commit

Permalink
Merge: postgresqlPackages.{pgvecto-rs,timescaledb_toolkit}: fix build…
Browse files Browse the repository at this point in the history
… on darwin (#358403)
  • Loading branch information
Ma27 authored Nov 23, 2024
2 parents ee8e3df + 62b175e commit 2ce65e5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
12 changes: 9 additions & 3 deletions pkgs/development/tools/rust/cargo-pgrx/buildPgrxExtension.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
'';

Expand Down
5 changes: 2 additions & 3 deletions pkgs/servers/sql/postgresql/ext/pgvecto-rs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 2ce65e5

Please sign in to comment.