Unverified Commit 20b12068 authored by Wolfgang Walther's avatar Wolfgang Walther Committed by GitHub
Browse files

buildPgrxExtension: force pinning cargo-pgrx (#423140)

parents 10a69143 86efb7f6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@

{
  lib,
  cargo-pgrx,
  pkg-config,
  rustPlatform,
  stdenv,
@@ -64,6 +63,8 @@ lib.extendMkDerivation {
      buildFeatures ? [ ],
      cargoBuildFlags ? [ ],
      cargoPgrxFlags ? [ ],
      # pinned dependencies
      cargo-pgrx,
      postgresql,
      # cargo-pgrx calls rustfmt on generated bindings, this is not strictly necessary, so we avoid the
      # dependency here. Set to false and provide rustfmt in nativeBuildInputs, if you need it, e.g.
+16 −15
Original line number Diff line number Diff line
{
  lib,
  darwin,
  fetchCrate,
  lib,
  openssl,
  pkg-config,
  rustPlatform,
  stdenv,
}:

let
@@ -15,16 +13,16 @@ let
      hash,
      cargoHash,
    }:
    rustPlatform.buildRustPackage rec {
    rustPlatform.buildRustPackage {
      pname = "cargo-pgrx";

      inherit version;

      src = fetchCrate {
        inherit version pname hash;
        inherit version hash;
        pname = "cargo-pgrx";
      };

      useFetchCargoVendor = true;
      inherit cargoHash;

      nativeBuildInputs = [
@@ -44,12 +42,12 @@ let
        "--skip=command::schema::tests::test_parse_managed_postmasters"
      ];

      meta = with lib; {
      meta = {
        description = "Build Postgres Extensions with Rust";
        homepage = "https://github.com/pgcentralfoundation/pgrx";
        changelog = "https://github.com/pgcentralfoundation/pgrx/releases/tag/v${version}";
        license = licenses.mit;
        maintainers = with maintainers; [
        license = lib.licenses.mit;
        maintainers = with lib.maintainers; [
          happysalada
          matthiasbeyer
        ];
@@ -64,12 +62,6 @@ in
    cargoHash = "sha256-zYjqE7LZLnTaVxWAPWC1ncEjCMlrhy4THtgecB7wBYY=";
  };

  cargo-pgrx_0_12_5 = generic {
    version = "0.12.5";
    hash = "sha256-U2kF+qjQwMTaocv5f4p5y3qmPUsTzdvAp8mz9cn/COw=";
    cargoHash = "sha256-CycwWvxYrHj7lmTiiNC1WdbFgrdlGr/M3qTN/N+7xQA=";
  };

  cargo-pgrx_0_12_6 = generic {
    version = "0.12.6";
    hash = "sha256-7aQkrApALZe6EoQGVShGBj0UIATnfOy2DytFj9IWdEA=";
@@ -81,4 +73,13 @@ in
    hash = "sha256-oMToAhKkRiCyC8JYS0gmo/XX3QVcVtF5mUV0aQjd+p8=";
    cargoHash = "sha256-RawGAQGtG2QVDCMbwjmUEaH6rDeRiBvvJsGCY8wySw0=";
  };

  # Default version for direct usage.
  # Not to be used with buildPgrxExtension, where it should be pinned.
  # When you make an extension use the latest version, *copy* this to a separate pinned attribute.
  cargo-pgrx = generic {
    version = "0.15.0";
    hash = "sha256-sksRfNV6l8YbdI6fzrEtanpDVV4sh14JXLqYBydHwy0=";
    cargoHash = "sha256-c+n1bJMO9254kT4e6exVNhlIouzkkzrRIOVzR9lZeg4=";
  };
}
+90 −96
Original line number Diff line number Diff line
@@ -23,15 +23,9 @@ let
  };

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.vectorchord.ai/developers/development.html#set-up-development-environment, step 5
  cargo-pgrx = cargo-pgrx_0_12_0_alpha_1;
  rustPlatform = rustPlatform';
})
  (finalAttrs: {
(buildPgrxExtension.override { rustPlatform = rustPlatform'; }) (finalAttrs: {
  inherit postgresql;
  cargo-pgrx = cargo-pgrx_0_12_0_alpha_1;

  pname = "pgvecto-rs";
  version = "0.3.0";
+2 −7
Original line number Diff line number Diff line
@@ -7,13 +7,7 @@
  postgresqlTestExtension,
}:

let
  buildPgrxExtension' = buildPgrxExtension.override {
    # Upstream only works with a fixed minor version of cargo-pgrx for each release.
    cargo-pgrx = cargo-pgrx_0_12_6;
  };
in
buildPgrxExtension' (finalAttrs: {
buildPgrxExtension (finalAttrs: {
  pname = "pgvectorscale";
  version = "0.7.0";

@@ -38,6 +32,7 @@ buildPgrxExtension' (finalAttrs: {
  ];

  inherit postgresql;
  cargo-pgrx = cargo-pgrx_0_12_6;

  passthru.tests.extension = postgresqlTestExtension {
    inherit (finalAttrs) finalPackage;
+2 −7
Original line number Diff line number Diff line
@@ -7,14 +7,9 @@
  postgresql,
  util-linux,
}:
let
  buildPgrxExtension' = buildPgrxExtension.override {
    # Upstream only works with a fixed minor version of cargo-pgrx for each release.
    cargo-pgrx = cargo-pgrx_0_12_6;
  };
in
buildPgrxExtension' (finalAttrs: {
buildPgrxExtension (finalAttrs: {
  inherit postgresql;
  cargo-pgrx = cargo-pgrx_0_12_6;

  pname = "pgx_ulid";
  version = "0.2.0";
Loading