From 21a874802e3958315df9bfbae113951e0f02ad5f Mon Sep 17 00:00:00 2001 From: Diogo Correia Date: Sun, 11 Aug 2024 21:28:57 +0100 Subject: [PATCH] buildPgrxExtension: avoid empty RUSTFLAGS Setting RUSTFLAGS to an empty strings causes the linux pgvecto-rs build to fail. Therefore, it should only be set when it is non-empty. Build failure introduced by commit 2a13929e1f191b3690dd2f2db13098b04adb9043 --- pkgs/development/tools/rust/cargo-pgrx/buildPgrxExtension.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/tools/rust/cargo-pgrx/buildPgrxExtension.nix b/pkgs/development/tools/rust/cargo-pgrx/buildPgrxExtension.nix index b4cbb95150a7..7138ae8ecfef 100644 --- a/pkgs/development/tools/rust/cargo-pgrx/buildPgrxExtension.nix +++ b/pkgs/development/tools/rust/cargo-pgrx/buildPgrxExtension.nix @@ -119,7 +119,7 @@ let NIX_PGLIBDIR="${postgresql}/lib" \ PGRX_BUILD_FLAGS="--frozen -j $NIX_BUILD_CORES ${builtins.concatStringsSep " " cargoBuildFlags}" \ - RUSTFLAGS="${lib.optionalString stdenv.isDarwin "-Clink-args=-Wl,-undefined,dynamic_lookup"}" \ + ${lib.optionalString stdenv.isDarwin ''RUSTFLAGS="''${RUSTFLAGS:+''${RUSTFLAGS} }-Clink-args=-Wl,-undefined,dynamic_lookup"''} \ cargo pgrx package \ --pg-config ${postgresql}/bin/pg_config \ ${maybeDebugFlag} \