Skip to content

Commit d5f94c0

Browse files
authored
Merge pull request #1 from KBVE/patch-1-kilobase
Patch 1 kilobase
2 parents e5b7293 + bd520f2 commit d5f94c0

File tree

3 files changed

+37
-17
lines changed

3 files changed

+37
-17
lines changed

nix/cargo-pgrx/versions.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,17 @@
5656
"cargoHash": "sha256-Ny7j56pwB+2eEK62X0nWfFKQy5fBz+Q1oyvecivxLkk="
5757
}
5858
}
59+
},
60+
"0.15.0": {
61+
"hash": "sha256-sksRfNV6l8YbdI6fzrEtanpDVV4sh14JXLqYBydHwy0=",
62+
"rust": {
63+
"1.85.0": {
64+
"cargoHash": "sha256-4a7jz8+/HeOmEEWRadbFzEhAoYEd8Oj30vso5KYnDbs="
65+
},
66+
"1.87.0": {
67+
"cargoHash": "sha256-TODO-NEEDS-PROPER-HASH"
68+
}
69+
}
5970
}
6071

6172
}

nix/ext/kilobase.nix

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
{
22
lib,
33
stdenv,
4+
pkgs,
45
fetchFromGitHub,
56
postgresql,
67
buildPgrxExtension_0_15_0,
7-
rust-bin,
88
}:
9-
let
10-
rustVersion = "1.85.0"; # Updated to support edition 2024
11-
cargo = rust-bin.stable.${rustVersion}.default;
12-
in
139
buildPgrxExtension_0_15_0 rec {
1410
pname = "kilobase";
1511
version = "0.1.0";
@@ -19,22 +15,23 @@ buildPgrxExtension_0_15_0 rec {
1915
owner = "KBVE";
2016
repo = "kbve";
2117
rev = "main"; # Use main branch or specific commit hash
22-
hash = "sha256-AKsvBd1UR28/o269Ys3lZzYkCRXXZrIgurE9C9lsW+Y=";
18+
hash = "sha256-VVH9GyKgKgkvi3iI8SffScPl00cIDlvPZbVJLgrzX1o=";
2319
};
2420

25-
# Cargo.toml path if not at root
26-
cargoRoot = "apps/kbve/kilobase";
21+
# Build from workspace root (with Rust 1.85 we support edition 2024)
22+
cargoRoot = ".";
23+
24+
# Build only kilobase package - but don't use --package flag as buildAndTestSubdir handles it
25+
cargoBuildFlags = [ ];
2726

28-
nativeBuildInputs = [ cargo ];
27+
nativeBuildInputs = [ ];
2928
buildInputs = [ postgresql ];
3029

3130
# Update this array when kilobase version is updated
3231
previousVersions = [
3332
# Add previous versions here when updating
3433
];
3534

36-
CARGO = "${cargo}/bin/cargo";
37-
3835
# Darwin env needs PGPORT to be unique for build to not clash with other pgrx extensions
3936
env = lib.optionalAttrs stdenv.isDarwin {
4037
POSTGRES_LIB = "${postgresql}/lib";
@@ -49,13 +46,19 @@ buildPgrxExtension_0_15_0 rec {
4946
cargoLock = {
5047
lockFile = "${src}/Cargo.lock";
5148
allowBuiltinFetchGit = true;
52-
outputHashes = {
53-
"jedi-0.2.0" = "sha256-23u6jB89ok7UUQMcHOcYA/4Lwq59JMEXbVx3gGPGOks=";
54-
};
5549
};
5650

51+
# Add pg17 feature
52+
buildFeatures = [ "pg17" ];
53+
5754
# Disable tests for now
5855
doCheck = false;
56+
57+
# Disable cargo-auditable to avoid issues
58+
auditable = false;
59+
60+
# Tell cargo pgrx package which package to build
61+
buildAndTestSubdir = "apps/kbve/kilobase";
5962

6063
meta = with lib; {
6164
description = "Kilobase PostgreSQL extension";

nix/overlays/default.nix

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,14 @@
5252
cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_14_3;
5353
};
5454

55-
buildPgrxExtension_0_15_0 = prev.buildPgrxExtension.override {
56-
cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_15_0;
57-
};
55+
buildPgrxExtension_0_15_0 =
56+
let
57+
rustVersion = "1.85.0";
58+
pgrxVersion = "0.15.0";
59+
mkPgrxExtension = final.callPackages ../cargo-pgrx/mkPgrxExtension.nix {
60+
inherit rustVersion pgrxVersion;
61+
};
62+
in
63+
mkPgrxExtension;
5864
};
5965
}

0 commit comments

Comments
 (0)