Skip to content

Commit 68d6ca9

Browse files
authored
fix: pkg changes for wrappers using cargo-pgrx 0.12.6 (#1288)
* fix: pkg changes for wrappers using cargo-pgrx 0.12.6 * chore: cleanup --------- Co-authored-by: Sam Rose <[email protected]>
1 parent acd5c40 commit 68d6ca9

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

nix/ext/wrappers/default.nix

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
, rust-bin
1212
}:
1313
let
14-
rustVersion = "1.76.0";
14+
rustVersion = "1.80.0";
1515
cargo = rust-bin.stable.${rustVersion}.default;
1616
in
1717
buildPgrxExtension_0_12_6 rec {
@@ -27,23 +27,33 @@ buildPgrxExtension_0_12_6 rec {
2727
rev = "v${version}";
2828
hash = "sha256-CkoNMoh40zbQL4V49ZNYgv3JjoNWjODtTpHn+L8DdZA=";
2929
};
30+
3031
nativeBuildInputs = [ pkg-config cargo ];
31-
buildInputs = [ openssl ] ++ lib.optionals (stdenv.isDarwin) [
32+
buildInputs = [ openssl postgresql ] ++ lib.optionals (stdenv.isDarwin) [
3233
darwin.apple_sdk.frameworks.CoreFoundation
3334
darwin.apple_sdk.frameworks.Security
3435
darwin.apple_sdk.frameworks.SystemConfiguration
3536
];
37+
38+
NIX_LDFLAGS = "-L${postgresql}/lib -lpq";
39+
40+
# Set necessary environment variables for pgrx
41+
env = lib.optionalAttrs stdenv.isDarwin {
42+
POSTGRES_LIB = "${postgresql}/lib";
43+
RUSTFLAGS = "-C link-arg=-undefined -C link-arg=dynamic_lookup";
44+
PGPORT = "5435";
45+
};
46+
3647
OPENSSL_NO_VENDOR = 1;
3748
#need to set this to 2 to avoid cpu starvation
3849
CARGO_BUILD_JOBS = "2";
3950
CARGO="${cargo}/bin/cargo";
51+
4052
cargoLock = {
4153
lockFile = "${src}/Cargo.lock";
42-
outputHashes = {
43-
"clickhouse-rs-1.0.0-alpha.1" = "sha256-0zmoUo/GLyCKDLkpBsnLAyGs1xz6cubJhn+eVqMEMaw=";
44-
};
54+
allowBuiltinFetchGit = true;
4555
};
46-
postPatch = "cp ${cargoLock.lockFile} Cargo.lock";
56+
4757
buildAndTestSubdir = "wrappers";
4858
buildFeatures = [
4959
"helloworld_fdw"

0 commit comments

Comments
 (0)