From 5a50e55ac334cda15efca86cf9d1f703f314e551 Mon Sep 17 00:00:00 2001 From: samrose Date: Wed, 28 Feb 2024 15:58:23 -0500 Subject: [PATCH] Sam/psql 16 (#47) * feat: pg 15, pg 16, cargo pgrx 0.11.2 * fix: versions * fix: version correction * fix: formatting of scripts * chore: cleanup comment * fix: version correction * fix: just appeared to be a typo in the shebang that prevented nix app from running * feat: rm citus and work toward completing 15-16 updates * fix: reference the Cargo.lock that has the data we need to do this build * fix: update CI to build correct versions --- .gitignore | 4 + ...001-build-Allow-using-V8-from-system.patch | 46 ++++++ ext/citus.nix | 8 +- ext/pg_graphql.nix | 8 +- ext/pg_jsonschema.nix | 8 +- ext/pg_stat_monitor.nix | 14 +- ext/pgsql-http.nix | 4 +- ext/plv8.nix | 146 ++++++++++++++++++ ext/wrappers/default.nix | 15 +- flake.lock | 18 +-- flake.nix | 26 ++-- justfile | 2 +- overlays/cargo-pgrx.nix | 12 +- tests/postgresql.conf.in | 4 +- tests/prime.sql | 3 +- tests/smoke/0004-citus.sql | 32 ---- tools/migrate-tool.sh.in | 21 +-- tools/run-client.sh.in | 14 +- tools/run-replica.sh.in | 14 +- tools/run-server.sh.in | 16 +- 20 files changed, 294 insertions(+), 121 deletions(-) create mode 100644 ext/0001-build-Allow-using-V8-from-system.patch create mode 100644 ext/plv8.nix delete mode 100644 tests/smoke/0004-citus.sql diff --git a/.gitignore b/.gitignore index 78db5c1..4de7e20 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,7 @@ result* # shell history .history container.sh +sbom.spdx.json +sbom.cdx.json +sbom.csv +graph*.png diff --git a/ext/0001-build-Allow-using-V8-from-system.patch b/ext/0001-build-Allow-using-V8-from-system.patch new file mode 100644 index 0000000..eb5e296 --- /dev/null +++ b/ext/0001-build-Allow-using-V8-from-system.patch @@ -0,0 +1,46 @@ +diff --git a/Makefile b/Makefile +index 38879cc..6e78eeb 100644 +--- a/Makefile ++++ b/Makefile +@@ -20,6 +20,7 @@ OBJS = $(SRCS:.cc=.o) + MODULE_big = plv8-$(PLV8_VERSION) + EXTENSION = plv8 + PLV8_DATA = plv8.control plv8--$(PLV8_VERSION).sql $(wildcard upgrade/*.sql) ++USE_SYSTEM_V8 = 0 + + + # Platform detection +@@ -41,6 +42,7 @@ PGXS := $(shell $(PG_CONFIG) --pgxs) + PG_VERSION_NUM := $(shell cat `$(PG_CONFIG) --includedir-server`/pg_config*.h \ + | perl -ne 'print $$1 and exit if /PG_VERSION_NUM\s+(\d+)/') + ++ifeq ($(USE_SYSTEM_V8),0) + AUTOV8_DIR = build/v8 + AUTOV8_OUT = build/v8/out.gn/obj + AUTOV8_STATIC_LIBS = -lv8_libplatform -lv8_libbase +@@ -66,6 +68,7 @@ v8: + make -f Makefiles/Makefile.macos v8 + endif + endif ++endif + + # enable direct jsonb conversion by default + CCFLAGS += -DJSONB_DIRECT_CONVERSION +@@ -83,6 +86,7 @@ ifdef BIGINT_GRACEFUL + endif + + ++ifeq ($(USE_SYSTEM_V8),0) + # We're gonna build static link. Rip it out after include Makefile + SHLIB_LINK := $(filter-out -lv8, $(SHLIB_LINK)) + +@@ -101,6 +105,7 @@ else + SHLIB_LINK += -lrt -std=c++14 + endif + endif ++endif + + DATA = $(PLV8_DATA) + ifndef DISABLE_DIALECT +-- +2.37.3 diff --git a/ext/citus.nix b/ext/citus.nix index e9d6362..cc3075f 100644 --- a/ext/citus.nix +++ b/ext/citus.nix @@ -1,8 +1,10 @@ { lib, curl, lz4, zstd, krb5, icu, stdenv, fetchFromGitHub, postgresql }: - +#FIXME we have decided deactivate this for now, as it is not used in production +# if we decide to use it later we may need to look at this documentation +# https://docs.citusdata.com/en/stable/admin_guide/upgrading_citus.html#upgrading-postgresql-version-from-15-to-16 stdenv.mkDerivation rec { pname = "citus"; - version = "12.0.0"; + version = "12.1.2"; buildInputs = [ curl lz4 zstd krb5 icu.dev postgresql]; @@ -10,7 +12,7 @@ stdenv.mkDerivation rec { owner = "citusdata"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-HH9/slsCRe2yIVIqwR8sDyqXFonf8BHhJhLzHNv1CF0="; + hash = "sha256-0uYNMLAYigtGlDRvOEkQeC5i58QfXcdSVjTQwWVFX+8="; }; installPhase = '' diff --git a/ext/pg_graphql.nix b/ext/pg_graphql.nix index 6f9dbe9..f321c75 100644 --- a/ext/pg_graphql.nix +++ b/ext/pg_graphql.nix @@ -2,17 +2,17 @@ buildPgrxExtension rec { pname = "pg_graphql"; - version = "unstable-1.4.0"; + version = "unstable-1.5.0"; inherit postgresql; src = fetchFromGitHub { owner = "supabase"; repo = pname; - rev = "v1.4.0"; - hash = "sha256-vpMNN7xKCFCqCsMHNOpWbeNYfUCREszBLSxPl3iBFLM="; + rev = "v1.5.0"; + hash = "sha256-28ANRZyF22qF2YAxNAAkPfGOM3+xiO6IHdXsTp0CTQE="; }; - cargoHash = "sha256-jB5cV6r4sf3TBlR9Zsrb7hZp25fIc0DcKvIetYut2ZU="; + cargoHash = "sha256-CUiGs0m9aUeqjpdPyOSjz91cP7TT6kjJqnw7ImGnQuo="; # FIXME (aseipp): disable the tests since they try to install .control # files into the wrong spot, aside from that the one main test seems diff --git a/ext/pg_jsonschema.nix b/ext/pg_jsonschema.nix index 6e06571..b7d4ecd 100644 --- a/ext/pg_jsonschema.nix +++ b/ext/pg_jsonschema.nix @@ -2,17 +2,17 @@ buildPgrxExtension rec { pname = "pg_jsonschema"; - version = "unstable-0.2.0"; + version = "unstable-e8c331f106a7970eaa406b844c83c259ff2f0e84"; inherit postgresql; src = fetchFromGitHub { owner = "supabase"; repo = pname; - rev = "v0.2.0"; - hash = "sha256-57gZbUVi8P4EB8T0P19JBVXcetQcr6IxuIx96NNFA/0="; + rev = "e8c331f106a7970eaa406b844c83c259ff2f0e84"; + hash = "sha256-Z88cKMhkCkLKaeP5oFMJNxojIPfrOyPTBfCM0TKOi0E="; }; - cargoHash = "sha256-GXzoAOwDwGbHNWOJvaGdOvkU8L/ei703590ClkrDN+Y="; + cargoHash = "sha256-i05gkqyBIH+xkAognSKouyA08B2kKZ/W94t5QgG/BHA="; # FIXME (aseipp): testsuite tries to write files into /nix/store; we'll have # to fix this a bit later. diff --git a/ext/pg_stat_monitor.nix b/ext/pg_stat_monitor.nix index 4e26c16..95a5e3c 100644 --- a/ext/pg_stat_monitor.nix +++ b/ext/pg_stat_monitor.nix @@ -10,13 +10,13 @@ let # # this seems to all be cleaned up in version 2.0 of the extension, so ideally # we could upgrade to it later on and nuke this. - sqlFilename = if lib.versionOlder postgresql.version "14" - then "pg_stat_monitor--1.0.13.sql.in" - else "pg_stat_monitor--1.0.14.sql.in"; + # sqlFilename = if lib.versionOlder postgresql.version "14" + # then "pg_stat_monitor--1.0.13.sql.in" + # else "pg_stat_monitor--1.0.14.sql.in"; in stdenv.mkDerivation rec { pname = "pg_stat_monitor"; - version = "1.0.1"; + version = "2.0.4"; buildInputs = [ postgresql ]; @@ -24,7 +24,7 @@ in stdenv.mkDerivation rec { owner = "percona"; repo = pname; rev = "refs/tags/${version}"; - hash = "sha256-sQEpIknAFOmvNTX2G23X4BvMdy3Ms7sXx7hLZt8jyUk="; + hash = "sha256-57Ji/KltIHNf81OxT0+4JIDqydST5RKMqrybNBZochg="; }; makeFlags = [ "USE_PGXS=1" ]; @@ -32,7 +32,7 @@ in stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/{lib,share/postgresql/extension} - cp ${sqlFilename} pg_stat_monitor--1.0.sql + cp pg_stat_monitor--2.0.sql pg_stat_monitor--1.0--2.0.sql cp *.so $out/lib cp *.sql $out/share/postgresql/extension @@ -45,6 +45,6 @@ in stdenv.mkDerivation rec { maintainers = with maintainers; [ thoughtpolice ]; platforms = postgresql.meta.platforms; license = licenses.postgresql; - broken = lib.versionOlder postgresql.version "13"; + broken = lib.versionOlder postgresql.version "15"; }; } diff --git a/ext/pgsql-http.nix b/ext/pgsql-http.nix index 734083c..2908027 100644 --- a/ext/pgsql-http.nix +++ b/ext/pgsql-http.nix @@ -2,7 +2,7 @@ stdenv.mkDerivation rec { pname = "pgsql-http"; - version = "1.5.0"; + version = "1.6.0"; buildInputs = [ curl postgresql ]; @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { owner = "pramsey"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-+N/CXm4arRgvhglanfvO0FNOBUWV5RL8mn/9FpNvcjY="; + hash = "sha256-CPHfx7vhWfxkXsoKTzyFuTt47BPMvzi/pi1leGcuD60="; }; installPhase = '' diff --git a/ext/plv8.nix b/ext/plv8.nix new file mode 100644 index 0000000..32586a5 --- /dev/null +++ b/ext/plv8.nix @@ -0,0 +1,146 @@ +{ stdenv +, lib +, fetchFromGitHub +, v8 +, perl +, postgresql +# For test +, runCommand +, coreutils +, gnugrep +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "plv8"; + # plv8 latest is https://github.com/plv8/plv8/releases/tag/v3.2.2 + # FIXME we need to increment this build toward 3.2.2 + # 3.1.7 is the highest version that can be built with pg 16 + version = "3.1.7"; + + src = fetchFromGitHub { + owner = "plv8"; + repo = "plv8"; + rev = "v${finalAttrs.version}"; + hash = "sha256-kTID3Zo3YwNZUno8kdQE7ihtiddsIAZNuBN91IKgaC4="; + }; + + patches = [ + # Allow building with system v8. + # https://github.com/plv8/plv8/pull/505 (rejected) + ./0001-build-Allow-using-V8-from-system.patch + ]; + + nativeBuildInputs = [ + perl + ]; + + buildInputs = [ + v8 + postgresql + ]; + + buildFlags = [ "all" ]; + + makeFlags = [ + # Nixpkgs build a v8 monolith instead of separate v8_libplatform. + "USE_SYSTEM_V8=1" + "SHLIB_LINK=-lv8" + "V8_OUTDIR=${v8}/lib" + ]; + + installFlags = [ + # PGXS only supports installing to postgresql prefix so we need to redirect this + "DESTDIR=${placeholder "out"}" + ]; + + # No configure script. + dontConfigure = true; + + postPatch = '' + patchShebangs ./generate_upgrade.sh + # https://github.com/plv8/plv8/pull/506 + substituteInPlace generate_upgrade.sh \ + --replace " 2.3.10 " " 2.3.10 2.3.11 2.3.12 2.3.13 2.3.14 2.3.15 " + ''; + + postInstall = '' + # Move the redirected to proper directory. + # There appear to be no references to the install directories + # so changing them does not cause issues. + mv "$out/nix/store"/*/* "$out" + rmdir "$out/nix/store"/* "$out/nix/store" "$out/nix" + ''; + + passthru = { + tests = + let + postgresqlWithSelf = postgresql.withPackages (_: [ + finalAttrs.finalPackage + ]); + in { + smoke = runCommand "plv8-smoke-test" {} '' + export PATH=${lib.makeBinPath [ + postgresqlWithSelf + coreutils + gnugrep + ]} + db="$PWD/testdb" + initdb "$db" + postgres -k "$db" -D "$db" & + pid="$!" + + for i in $(seq 1 100); do + if psql -h "$db" -d postgres -c "" 2>/dev/null; then + break + elif ! kill -0 "$pid"; then + exit 1 + else + sleep 0.1 + fi + done + + psql -h "$db" -d postgres -c 'CREATE EXTENSION plv8; DO $$ plv8.elog(NOTICE, plv8.version); $$ LANGUAGE plv8;' 2> "$out" + grep -q "${finalAttrs.version}" "$out" + kill -0 "$pid" + ''; + + regression = stdenv.mkDerivation { + name = "plv8-regression"; + inherit (finalAttrs) src patches nativeBuildInputs buildInputs dontConfigure; + + buildPhase = '' + runHook preBuild + + # The regression tests need to be run in the order specified in the Makefile. + echo -e "include Makefile\nprint_regress_files:\n\t@echo \$(REGRESS)" > Makefile.regress + REGRESS_TESTS=$(make -f Makefile.regress print_regress_files) + + ${postgresql}/lib/pgxs/src/test/regress/pg_regress \ + --bindir='${postgresqlWithSelf}/bin' \ + --temp-instance=regress-instance \ + --dbname=contrib_regression \ + $REGRESS_TESTS + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + touch "$out" + + runHook postInstall + ''; + }; + }; + }; + + meta = with lib; { + description = "V8 Engine Javascript Procedural Language add-on for PostgreSQL"; + homepage = "https://plv8.github.io/"; + maintainers = with maintainers; [ marsam ]; + platforms = [ "x86_64-linux" "aarch64-linux" ]; + license = licenses.postgresql; + broken = postgresql.jitSupport; + }; +}) diff --git a/ext/wrappers/default.nix b/ext/wrappers/default.nix index 304685c..d314944 100644 --- a/ext/wrappers/default.nix +++ b/ext/wrappers/default.nix @@ -1,19 +1,20 @@ { lib, stdenv, fetchFromGitHub, openssl, pkg-config -, postgresql, buildPgrxExtension_0_11_0 +, postgresql, buildPgrxExtension_0_11_2 }: -buildPgrxExtension_0_11_0 rec { +buildPgrxExtension_0_11_2 rec { pname = "supabase-wrappers"; - version = "unstable-2024-02-14"; + version = "unstable-2024-02-26"; inherit postgresql; src = fetchFromGitHub { owner = "supabase"; repo = "wrappers"; - rev = "v0.2.0"; - hash = "sha256-F+S5uyubL3Tb3RTJ08Zf9gN8oLE/WkCWFA8RcKkDqes="; + #rev pinned for now to the HEAD of the main branch to achieve cargo-pgrx 0.11.2 compat + rev = "5b5c2622268c75bec834a38b2ff967f781511188"; + hash = "sha256-VwEFJD0yD+gvXCTzq9NfjCPEkh/lDQdEOPfk8LwK4z4="; }; - + nativeBuildInputs = [ pkg-config ]; buildInputs = [ openssl ]; @@ -21,7 +22,7 @@ buildPgrxExtension_0_11_0 rec { OPENSSL_NO_VENDOR = 1; cargoLock = { - lockFile = "${src}/wrappers/Cargo.lock"; + lockFile = "${src}/Cargo.lock"; outputHashes = { "clickhouse-rs-1.0.0-alpha.1" = "sha256-0zmoUo/GLyCKDLkpBsnLAyGs1xz6cubJhn+eVqMEMaw="; }; diff --git a/flake.lock b/flake.lock index a5e030a..fc201b1 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", "owner": "numtide", "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", "type": "github" }, "original": { @@ -42,11 +42,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1703410130, - "narHash": "sha256-qbJQ8DtdKzFK0fZck7kX64QWkS/3tKefxGjyI+SAQa4=", + "lastModified": 1708764364, + "narHash": "sha256-+pOtDvmuVTg0Gi58hKDUyrNla5NbyUvt3Xs3gLR0Fws=", "owner": "nlewo", "repo": "nix2container", - "rev": "6aa8491e73843ac8bf714a3904a45900f356ea44", + "rev": "c891f90d2e3c48a6b33466c96e4851e0fc0cf455", "type": "github" }, "original": { @@ -72,11 +72,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1696261572, - "narHash": "sha256-s8TtSYJ1LBpuITXjbPLUPyxzAKw35LhETcajJjCS5f0=", + "lastModified": 1708847675, + "narHash": "sha256-RUZ7KEs/a4EzRELYDGnRB6i7M1Izii3JD/LyzH0c6Tg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0c7ffbc66e6d78c50c38e717ec91a2a14e0622fb", + "rev": "2a34566b67bef34c551f204063faeecc444ae9da", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 27e6f95..bb71aee 100644 --- a/flake.nix +++ b/flake.nix @@ -73,7 +73,6 @@ "timescaledb" "wal2json" /* pljava */ - "plv8" "rum" "pg_repack" "pgroonga" @@ -89,7 +88,9 @@ # rollout new versions of these critical things easier without having to # go through the upstream release engineering process. ourExtensions = [ - ./ext/citus.nix + # see comment in ./ext/citus.nix + # for why citus is deactivated + #./ext/citus.nix ./ext/pgsql-http.nix ./ext/pg_plan_filter.nix ./ext/pg_net.nix @@ -104,6 +105,7 @@ ./ext/pg_tle.nix ./ext/wrappers/default.nix ./ext/supautils.nix + ./ext/plv8.nix ]; # Create a 'receipt' file for a given postgresql package. This is a way @@ -159,7 +161,7 @@ # it refers to the *major number only*, which is used to select the # correct version of the package from nixpkgs. This is because we want # to be able to do so in an open ended way. As an example, the version - # "14" passed in will use the nixpkgs package "postgresql_14" as the + # "15" passed in will use the nixpkgs package "postgresql_15" as the # basis for building extensions, etc. makePostgresBin = version: let @@ -318,8 +320,8 @@ # want. basePackages = { # PostgreSQL versions. - psql_14 = makePostgres "14"; psql_15 = makePostgres "15"; + psql_16 = makePostgres "16"; # Start a version of the server. start-server = @@ -332,8 +334,8 @@ substitute ${./tools/run-server.sh.in} $out/bin/start-postgres-server \ --subst-var-by 'PGSQL_DEFAULT_PORT' '${pgsqlDefaultPort}' \ --subst-var-by 'PGSQL_SUPERUSER' '${pgsqlSuperuser}' \ - --subst-var-by 'PSQL14_BINDIR' '${basePackages.psql_14.bin}' \ --subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}' \ + --subst-var-by 'PSQL16_BINDIR' '${basePackages.psql_16.bin}' \ --subst-var-by 'PSQL_CONF_FILE' '${configFile}' \ --subst-var-by 'PGSODIUM_GETKEY' '${getkeyScript}' @@ -346,8 +348,8 @@ substitute ${./tools/run-client.sh.in} $out/bin/start-postgres-client \ --subst-var-by 'PGSQL_DEFAULT_PORT' '${pgsqlDefaultPort}' \ --subst-var-by 'PGSQL_SUPERUSER' '${pgsqlSuperuser}' \ - --subst-var-by 'PSQL14_BINDIR' '${basePackages.psql_14.bin}' \ - --subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}' + --subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}'\ + --subst-var-by 'PSQL16_BINDIR' '${basePackages.psql_16.bin}' chmod +x $out/bin/start-postgres-client ''; @@ -361,8 +363,8 @@ in pkgs.runCommand "migrate-postgres" {} '' mkdir -p $out/bin substitute ${./tools/migrate-tool.sh.in} $out/bin/migrate-postgres \ - --subst-var-by 'PSQL14_BINDIR' '${basePackages.psql_14.bin}' \ --subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}' \ + --subst-var-by 'PSQL16_BINDIR' '${basePackages.psql_16.bin}' \ --subst-var-by 'PSQL_CONF_FILE' '${configFile}' \ --subst-var-by 'PGSODIUM_GETKEY' '${getkeyScript}' \ --subst-var-by 'PRIMING_SCRIPT' '${primingScript}' \ @@ -375,8 +377,8 @@ mkdir -p $out/bin substitute ${./tools/run-replica.sh.in} $out/bin/start-postgres-replica \ --subst-var-by 'PGSQL_SUPERUSER' '${pgsqlSuperuser}' \ - --subst-var-by 'PSQL14_BINDIR' '${basePackages.psql_14.bin}' \ - --subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}' + --subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}'\ + --subst-var-by 'PSQL16_BINDIR' '${basePackages.psql_16.bin}' chmod +x $out/bin/start-postgres-replica ''; }; @@ -416,14 +418,14 @@ # set can go here. inherit (pkgs) # NOTE: comes from our cargo-pgrx.nix overlay - cargo-pgrx_0_11_0; + cargo-pgrx_0_11_2; }; # The list of exported 'checks' that are run with every run of 'nix # flake check'. This is run in the CI system, as well. checks = { - psql_14 = makeCheckHarness basePackages.psql_14.bin; psql_15 = makeCheckHarness basePackages.psql_15.bin; + psql_16 = makeCheckHarness basePackages.psql_16.bin; }; # Apps is a list of names of things that can be executed with 'nix run'; diff --git a/justfile b/justfile index 1b9708e..bd6dd95 100755 --- a/justfile +++ b/justfile @@ -9,8 +9,8 @@ alias b := build-all alias c := check build-all: - nix build .#psql_14/bin .#psql_14/docker nix build .#psql_15/bin .#psql_15/docker + nix build .#psql_16/bin .#psql_16/docker check: nix flake check -L diff --git a/overlays/cargo-pgrx.nix b/overlays/cargo-pgrx.nix index 70d6306..7254d29 100644 --- a/overlays/cargo-pgrx.nix +++ b/overlays/cargo-pgrx.nix @@ -1,11 +1,11 @@ final: prev: { - cargo-pgrx_0_11_0 = prev.cargo-pgrx.overrideAttrs (oldAttrs: rec { + cargo-pgrx_0_11_2 = prev.cargo-pgrx.overrideAttrs (oldAttrs: rec { pname = "cargo-pgrx"; - version = "0.11.0"; + version = "0.11.2"; src = prev.fetchCrate { inherit version pname; - hash = "sha256-GiUjsSqnrUNgiT/d3b8uK9BV7cHFvaDoq6cUGRwPigM="; + hash = "sha256-8NlpMDFaltTIA8G4JioYm8LaPJ2RGKH5o6sd6lBHmmM="; }; # NOTE (aseipp): normally, we would just use 'cargoHash' here, but @@ -17,11 +17,11 @@ final: prev: { cargoDeps = oldAttrs.cargoDeps.overrideAttrs (prev.lib.const { name = "${pname}-vendor.tar.gz"; inherit src; - outputHash = "sha256-DB+MQaTj5HWsIxrk5mJblBeGaI4qOuuV24AdjT3ES3o="; + outputHash = "sha256-qU2r67qI+aWsWr3vMWHb2FItHzwSaqXDnTvRe0rf+JY="; }); }); - buildPgrxExtension_0_11_0 = prev.buildPgrxExtension.override { - cargo-pgrx = final.cargo-pgrx_0_11_0; + buildPgrxExtension_0_11_2 = prev.buildPgrxExtension.override { + cargo-pgrx = final.cargo-pgrx_0_11_2; }; } diff --git a/tests/postgresql.conf.in b/tests/postgresql.conf.in index 5930cca..91ace7d 100644 --- a/tests/postgresql.conf.in +++ b/tests/postgresql.conf.in @@ -717,7 +717,9 @@ default_text_search_config = 'pg_catalog.english' #local_preload_libraries = '' #session_preload_libraries = '' -shared_preload_libraries = 'citus,auto_explain,pgsodium' +#FIXME if we re-activate citus we'll need to add it back in here +#shared_preload_libraries = 'citus,auto_explain,pgsodium' +shared_preload_libraries = 'auto_explain,pgsodium' #jit_provider = 'llvmjit' # JIT library to use # - Other Defaults - diff --git a/tests/prime.sql b/tests/prime.sql index ca62940..ba3e798 100644 --- a/tests/prime.sql +++ b/tests/prime.sql @@ -19,4 +19,5 @@ CREATE EXTENSION IF NOT EXISTS http; CREATE EXTENSION IF NOT EXISTS pg_graphql; CREATE EXTENSION IF NOT EXISTS pg_jsonschema; -CREATE EXTENSION IF NOT EXISTS citus; +-- deactivate citus +-- CREATE EXTENSION IF NOT EXISTS citus; diff --git a/tests/smoke/0004-citus.sql b/tests/smoke/0004-citus.sql deleted file mode 100644 index 14e0670..0000000 --- a/tests/smoke/0004-citus.sql +++ /dev/null @@ -1,32 +0,0 @@ -BEGIN; - -select plan(3); - -SELECT lives_ok($$ - CREATE TABLE events ( - device_id bigint, - event_id bigserial, - event_time timestamptz default now(), - data jsonb not null, - PRIMARY KEY (device_id, event_id) - ); -$$); - --- citus distributed test -SELECT lives_ok($$ - SELECT create_distributed_table('events', 'device_id'); -$$); - --- citus columnar test -SELECT lives_ok($$ - CREATE TABLE events_columnar ( - device_id bigint, - event_id bigserial, - event_time timestamptz default now(), - data jsonb not null - ) - USING columnar; -$$); - -SELECT * FROM finish(); -ROLLBACK; diff --git a/tools/migrate-tool.sh.in b/tools/migrate-tool.sh.in index 716cf8c..94eef85 100644 --- a/tools/migrate-tool.sh.in +++ b/tools/migrate-tool.sh.in @@ -2,39 +2,40 @@ [ ! -z "$DEBUG" ] && set -x -# first argument is the old version; a path, or 14 or 15 +# first argument is the old version; a path 15 or 16 if [[ $1 == /nix/store* ]]; then if [ ! -L "$1/receipt.json" ] || [ ! -e "$1/receipt.json" ]; then echo "ERROR: $1 does not look like a valid Postgres install" exit 1 fi OLDVER="$1" -elif [ "$1" == "14" ]; then - PSQL14=@PSQL14_BINDIR@ - OLDVER="$PSQL14" elif [ "$1" == "15" ]; then PSQL15=@PSQL15_BINDIR@ OLDVER="$PSQL15" +elif [ "$1" == "16" ]; then + PSQL16=@PSQL16_BINDIR@ + OLDVER="$PSQL16" else - echo "Please provide a valid Postgres version (14 or 15), or a /nix/store path" + echo "Please provide a valid Postgres version (15 or 16), or a /nix/store path" exit 1 fi -# second argument is the new version; 14 or 15 +# second argument is the new version; 15 or 16 if [[ $2 == /nix/store* ]]; then if [ ! -L "$2/receipt.json" ] || [ ! -e "$2/receipt.json" ]; then echo "ERROR: $1 does not look like a valid Postgres install" exit 1 fi NEWVER="$2" -elif [ "$2" == "14" ]; then - PSQL14=@PSQL14_BINDIR@ - NEWVER="$PSQL14" elif [ "$2" == "15" ]; then PSQL15=@PSQL15_BINDIR@ NEWVER="$PSQL15" +elif [ "$2" == "16" ]; then + PSQL16=@PSQL16_BINDIR@ + NEWVER="$PSQL16" + echo "NEWVER IS $NEWVER" else - echo "Please provide a valid Postgres version (14 or 15), or a /nix/store path" + echo "Please provide a valid Postgres version (15 or 16), or a /nix/store path" exit 1 fi diff --git a/tools/run-client.sh.in b/tools/run-client.sh.in index f61dda6..14850eb 100644 --- a/tools/run-client.sh.in +++ b/tools/run-client.sh.in @@ -3,17 +3,17 @@ [ ! -z "$DEBUG" ] && set -x -# first argument should be '14' or '15' for the version -if [ "$1" == "14" ]; then - echo "Starting server for PSQL 14" - PSQL14=@PSQL14_BINDIR@ - BINDIR="$PSQL14" -elif [ "$1" == "15" ]; then +# first argument should be '15' or '16' for the version +if [ "$1" == "15" ]; then echo "Starting server for PSQL 15" PSQL15=@PSQL15_BINDIR@ BINDIR="$PSQL15" +elif [ "$1" == "16" ]; then + echo "Starting server for PSQL 16" + PSQL16=@PSQL16_BINDIR@ + BINDIR="$PSQL16" else - echo "Please provide a valid Postgres version (14 or 15)" + echo "Please provide a valid Postgres version (15 or 16)" exit 1 fi diff --git a/tools/run-replica.sh.in b/tools/run-replica.sh.in index 473c430..fc6d666 100644 --- a/tools/run-replica.sh.in +++ b/tools/run-replica.sh.in @@ -3,17 +3,17 @@ [ ! -z "$DEBUG" ] && set -x -# first argument should be '14' or '15' for the version -if [ "$1" == "14" ]; then - echo "Starting server for PSQL 14" - PSQL14=@PSQL14_BINDIR@ - BINDIR="$PSQL14" -elif [ "$1" == "15" ]; then +# first argument should be '15' or '16' for the version +if [ "$1" == "15" ]; then echo "Starting server for PSQL 15" PSQL15=@PSQL15_BINDIR@ BINDIR="$PSQL15" +elif [ "$1" == "16" ]; then + echo "Starting server for PSQL 16" + PSQL16=@PSQL16_BINDIR@ + BINDIR="$PSQL16" else - echo "Please provide a valid Postgres version (14 or 15)" + echo "Please provide a valid Postgres version (15 or 16)" exit 1 fi diff --git a/tools/run-server.sh.in b/tools/run-server.sh.in index 955dce0..126ebd0 100644 --- a/tools/run-server.sh.in +++ b/tools/run-server.sh.in @@ -1,19 +1,19 @@ -l!/usr/bin/env bash +#!/usr/bin/env bash # shellcheck shell=bash [ ! -z "$DEBUG" ] && set -x -# first argument should be '14' or '15' for the version -if [ "$1" == "14" ]; then - echo "Starting server for PSQL 14" - PSQL14=@PSQL14_BINDIR@ - BINDIR="$PSQL14" -elif [ "$1" == "15" ]; then +# first argument should be '15' or '16' for the version +if [ "$1" == "15" ]; then echo "Starting server for PSQL 15" PSQL15=@PSQL15_BINDIR@ BINDIR="$PSQL15" +elif [ "$1" == "16" ]; then + echo "Starting server for PSQL 16" + PSQL16=@PSQL16_BINDIR@ + BINDIR="$PSQL16" else - echo "Please provide a valid Postgres version (14 or 15)" + echo "Please provide a valid Postgres version (15 or 16)" exit 1 fi