File tree Expand file tree Collapse file tree 2 files changed +8
-15
lines changed Expand file tree Collapse file tree 2 files changed +8
-15
lines changed Original file line number Diff line number Diff line change 94
94
export PGRX_HOME=$(mktemp -d)
95
95
export PGDATA="$PGRX_HOME/data-${ pgrxPostgresMajor } /"
96
96
cargo-pgrx pgrx init "--pg${ pgrxPostgresMajor } " ${ lib . getDev postgresql } /bin/pg_config
97
- echo "unix_socket_directories = '$(mktemp -d)'" > "$PGDATA/postgresql.conf"
97
+
98
+ # unix sockets work in sandbox, too.
99
+ export PGHOST="$(mktemp -d)"
100
+ cat > "$PGDATA/postgresql.conf" <<EOF
101
+ listen_addresses = '''
102
+ unix_socket_directories = '$PGHOST'
103
+ EOF
98
104
99
105
# This is primarily for Mac or other Nix systems that don't use the nixbld user.
100
106
export USER="$(whoami)"
Original file line number Diff line number Diff line change 54
54
env = lib . optionalAttrs stdenv . isDarwin {
55
55
POSTGRES_LIB = "${ postgresql } /lib" ;
56
56
RUSTFLAGS = "-C link-arg=-undefined -C link-arg=dynamic_lookup" ;
57
- # Calculate unique port for each PostgreSQL version:
58
- # - Check if version contains underscore (indicating OrioleDB)
59
- # - Add 1 to port if it's OrioleDB
60
- # - Add 2 for each major version above 15
61
- # Examples:
62
- # - PostgreSQL 15.8 → 5435 + 0 + (15-15)*2 = 5435
63
- # - PostgreSQL 17_0 (OrioleDB) → 5435 + 1 + (17-15)*2 = 5440
64
- # - PostgreSQL 17.4 → 5435 + 0 + (17-15)*2 = 5439
65
- PGPORT = toString (
66
- 5534
67
- + ( if builtins . match ".*_.*" postgresql . version != null then 1 else 0 )
68
- # +1 for OrioleDB
69
- + ( ( builtins . fromJSON ( builtins . substring 0 2 postgresql . version ) ) - 15 ) * 2
70
- ) ; # +2 for each major version
71
57
} ;
72
58
73
59
OPENSSL_NO_VENDOR = 1 ;
@@ -176,6 +162,7 @@ buildEnv {
176
162
"/share/postgresql/extension"
177
163
] ;
178
164
postBuild = ''
165
+
179
166
# checks
180
167
(set -x
181
168
test "$(ls -A $out/lib/${ pname } *${ postgresql . dlSuffix } | wc -l)" = "${
You can’t perform that action at this time.
0 commit comments