Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@
buildPgrxExtension_0_12_6 = prev.buildPgrxExtension.override {
cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_12_6;
};

buildPgrxExtension_0_12_9 = prev.buildPgrxExtension.override {
cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_12_9;
};

})
(final: prev: {
postgresql = final.callPackage ./nix/postgresql/default.nix {
Expand Down Expand Up @@ -394,6 +399,7 @@
supabase-groonga = supabase-groonga;
cargo-pgrx_0_11_3 = pkgs.cargo-pgrx.cargo-pgrx_0_11_3;
cargo-pgrx_0_12_6 = pkgs.cargo-pgrx.cargo-pgrx_0_12_6;
cargo-pgrx_0_12_9 = pkgs.cargo-pgrx.cargo-pgrx_0_12_9;
# PostgreSQL versions.
psql_15 = postgresVersions.psql_15;
psql_orioledb-17 = postgresVersions.psql_orioledb-17;
Expand Down
5 changes: 5 additions & 0 deletions nix/cargo-pgrx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,10 @@ in
hash = "sha256-7aQkrApALZe6EoQGVShGBj0UIATnfOy2DytFj9IWdEA=";
cargoHash = "sha256-Di4UldQwAt3xVyvgQT1gUhdvYUVp7n/a72pnX45kP0w=";
};
cargo-pgrx_0_12_9 = generic {
version = "0.12.9";
hash = "sha256-aR3DZAjeEEAjLQfZ0ZxkjLqTVMIEbU0UiZ62T4BkQq8=";
cargoHash = "sha256-53HKhvsKLTa2JCByLEcK3UzWXoM+LTatd98zvS1C9no=";
};
inherit rustPlatform;
}
34 changes: 20 additions & 14 deletions nix/ext/pg_graphql.nix
Original file line number Diff line number Diff line change
@@ -1,35 +1,41 @@
{ lib, stdenv, fetchFromGitHub, postgresql, buildPgrxExtension_0_12_6, cargo, rust-bin }:
{ lib, stdenv, fetchFromGitHub, postgresql, buildPgrxExtension_0_12_9, cargo, rust-bin }:

let
rustVersion = "1.80.0";
cargo = rust-bin.stable.${rustVersion}.default;
rustVersion = "nightly";
cargo = rust-bin.nightly.latest.default;
in
buildPgrxExtension_0_12_6 rec {
buildPgrxExtension_0_12_9 rec {
pname = "pg_graphql";
version = "1.5.9";
version = "1.5.11";
inherit postgresql;

src = fetchFromGitHub {
owner = "supabase";
repo = pname;
rev = "v${version}";
hash = "sha256-YpLN43FtLhp2cb7cyM+4gEx8GTwsRiKTfxaMq0b8hk0=";
hash = "sha256-BMZc9ui+2J3U24HzZZVCU5+KWhz+5qeUsRGeptiqbek=";
};

nativeBuildInputs = [ cargo ];
buildInputs = [ postgresql ];

CARGO="${cargo}/bin/cargo";
#darwin env needs PGPORT to be unique for build to not clash with other pgrx extensions
CARGO = "${cargo}/bin/cargo";

cargoLock = {
lockFile = "${src}/Cargo.lock";
};
# Setting RUSTFLAGS in env to ensure it's available for all phases
env = lib.optionalAttrs stdenv.isDarwin {
POSTGRES_LIB = "${postgresql}/lib";
RUSTFLAGS = "-C link-arg=-undefined -C link-arg=dynamic_lookup";
PGPORT = "5434";
RUSTFLAGS = "-C link-arg=-undefined -C link-arg=dynamic_lookup";
NIX_BUILD_CORES = "4"; # Limit parallel jobs
CARGO_BUILD_JOBS = "4"; # Limit cargo parallelism
};
cargoHash = "sha256-d2RSHtJgbYlOvArjOTaeYoca01UyWPUEO5vhktxxB6U=";
CARGO_BUILD_RUSTFLAGS = "--cfg tokio_unstable -C debuginfo=0";
CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG = true;

# FIXME (aseipp): disable the tests since they try to install .control
# files into the wrong spot, aside from that the one main test seems
# to work, though

doCheck = false;

meta = with lib; {
Expand All @@ -39,4 +45,4 @@ buildPgrxExtension_0_12_6 rec {
platforms = postgresql.meta.platforms;
license = licenses.postgresql;
};
}
}