diff --git a/flake.nix b/flake.nix index 92ceebf99..9ce842d35 100644 --- a/flake.nix +++ b/flake.nix @@ -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 { @@ -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; diff --git a/nix/cargo-pgrx/default.nix b/nix/cargo-pgrx/default.nix index 2d5545927..64e15160b 100644 --- a/nix/cargo-pgrx/default.nix +++ b/nix/cargo-pgrx/default.nix @@ -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; } diff --git a/nix/ext/pg_graphql.nix b/nix/ext/pg_graphql.nix index f54dff46a..54e500924 100644 --- a/nix/ext/pg_graphql.nix +++ b/nix/ext/pg_graphql.nix @@ -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; { @@ -39,4 +45,4 @@ buildPgrxExtension_0_12_6 rec { platforms = postgresql.meta.platforms; license = licenses.postgresql; }; -} +} \ No newline at end of file