diff --git a/nix/cargo-pgrx/versions.json b/nix/cargo-pgrx/versions.json index 2a4e24192..c78ba8bc2 100644 --- a/nix/cargo-pgrx/versions.json +++ b/nix/cargo-pgrx/versions.json @@ -56,6 +56,17 @@ "cargoHash": "sha256-Ny7j56pwB+2eEK62X0nWfFKQy5fBz+Q1oyvecivxLkk=" } } + }, + "0.15.0": { + "hash": "sha256-sksRfNV6l8YbdI6fzrEtanpDVV4sh14JXLqYBydHwy0=", + "rust": { + "1.85.0": { + "cargoHash": "sha256-4a7jz8+/HeOmEEWRadbFzEhAoYEd8Oj30vso5KYnDbs=" + }, + "1.87.0": { + "cargoHash": "sha256-TODO-NEEDS-PROPER-HASH" + } + } } } diff --git a/nix/ext/kilobase.nix b/nix/ext/kilobase.nix index 5cdd0d63d..b61450f3a 100644 --- a/nix/ext/kilobase.nix +++ b/nix/ext/kilobase.nix @@ -1,15 +1,11 @@ { lib, stdenv, + pkgs, fetchFromGitHub, postgresql, buildPgrxExtension_0_15_0, - rust-bin, }: -let - rustVersion = "1.85.0"; # Updated to support edition 2024 - cargo = rust-bin.stable.${rustVersion}.default; -in buildPgrxExtension_0_15_0 rec { pname = "kilobase"; version = "0.1.0"; @@ -19,13 +15,16 @@ buildPgrxExtension_0_15_0 rec { owner = "KBVE"; repo = "kbve"; rev = "main"; # Use main branch or specific commit hash - hash = "sha256-AKsvBd1UR28/o269Ys3lZzYkCRXXZrIgurE9C9lsW+Y="; + hash = "sha256-VVH9GyKgKgkvi3iI8SffScPl00cIDlvPZbVJLgrzX1o="; }; - # Cargo.toml path if not at root - cargoRoot = "apps/kbve/kilobase"; + # Build from workspace root (with Rust 1.85 we support edition 2024) + cargoRoot = "."; + + # Build only kilobase package - but don't use --package flag as buildAndTestSubdir handles it + cargoBuildFlags = [ ]; - nativeBuildInputs = [ cargo ]; + nativeBuildInputs = [ ]; buildInputs = [ postgresql ]; # Update this array when kilobase version is updated @@ -33,8 +32,6 @@ buildPgrxExtension_0_15_0 rec { # Add previous versions here when updating ]; - CARGO = "${cargo}/bin/cargo"; - # Darwin env needs PGPORT to be unique for build to not clash with other pgrx extensions env = lib.optionalAttrs stdenv.isDarwin { POSTGRES_LIB = "${postgresql}/lib"; @@ -49,13 +46,19 @@ buildPgrxExtension_0_15_0 rec { cargoLock = { lockFile = "${src}/Cargo.lock"; allowBuiltinFetchGit = true; - outputHashes = { - "jedi-0.2.0" = "sha256-23u6jB89ok7UUQMcHOcYA/4Lwq59JMEXbVx3gGPGOks="; - }; }; + # Add pg17 feature + buildFeatures = [ "pg17" ]; + # Disable tests for now doCheck = false; + + # Disable cargo-auditable to avoid issues + auditable = false; + + # Tell cargo pgrx package which package to build + buildAndTestSubdir = "apps/kbve/kilobase"; meta = with lib; { description = "Kilobase PostgreSQL extension"; diff --git a/nix/overlays/default.nix b/nix/overlays/default.nix index 90e5d25f1..7d761c1e6 100644 --- a/nix/overlays/default.nix +++ b/nix/overlays/default.nix @@ -52,8 +52,14 @@ cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_14_3; }; - buildPgrxExtension_0_15_0 = prev.buildPgrxExtension.override { - cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_15_0; - }; + buildPgrxExtension_0_15_0 = + let + rustVersion = "1.85.0"; + pgrxVersion = "0.15.0"; + mkPgrxExtension = final.callPackages ../cargo-pgrx/mkPgrxExtension.nix { + inherit rustVersion pgrxVersion; + }; + in + mkPgrxExtension; }; }