postgresqlPackages.pgvecto-rs: use useFetchCargoVendor (#392734)

This commit is contained in:
Wolfgang Walther
2025-03-24 18:16:55 +00:00
committed by GitHub
3 changed files with 5 additions and 3385 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
let
inherit (pkgs) lib;
# Test cases from https://docs.pgvecto.rs/use-cases/hybrid-search.html
# Test cases from https://docs.vectorchord.ai/use-case/hybrid-search.html
test-sql = pkgs.writeText "postgresql-test" ''
CREATE EXTENSION vectors;
File diff suppressed because it is too large Load Diff
@@ -11,13 +11,12 @@
postgresql,
replaceVars,
rustPlatform,
stdenv,
}:
let
# Upstream only works with clang 16, so we're pinning it here to
# avoid future incompatibility.
# See https://docs.pgvecto.rs/developers/development.html#environment, step 4
# See https://docs.vectorchord.ai/developers/development.html#set-up-development-environment, step 2
clang = clang_16;
rustPlatform' = rustPlatform // {
bindgenHook = rustPlatform.bindgenHook.override { inherit clang; };
@@ -27,7 +26,7 @@ in
(buildPgrxExtension.override {
# Upstream only works with a fixed version of cargo-pgrx for each release,
# so we're pinning it here to avoid future incompatibility.
# See https://docs.pgvecto.rs/developers/development.html#environment, step 6
# See https://docs.vectorchord.ai/developers/development.html#set-up-development-environment, step 5
cargo-pgrx = cargo-pgrx_0_12_0_alpha_1;
rustPlatform = rustPlatform';
})
@@ -54,14 +53,8 @@ in
hash = "sha256-X7BY2Exv0xQNhsS/GA7GNvj9OeVDqVCd/k3lUkXtfgE=";
};
# Package has git dependencies on Cargo.lock (instead of just crate.io dependencies),
# so cargoHash does not work, therefore we have to include Cargo.lock in nixpkgs.
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"pgrx-0.12.0-alpha.1" = "sha256-HSQrAR9DFJsi4ZF4hLiJ1sIy+M9Ygva2+WxeUzflOLk=";
};
};
useFetchCargoVendor = true;
cargoHash = "sha256-8otJ1uqGrCmlxAqvfAL3OjhBI4I6dAu6EoajstO46Sw=";
# Set appropriate version on vectors.control, otherwise it won't show up on PostgreSQL
postPatch = ''