supabase / nix-postgres

Experimental port of supabase/postgres to Nix
47 stars 7 forks source link

Citus extension #24

Closed olirice closed 1 year ago

olirice commented 1 year ago

What kind of change does this PR introduce?

Adds citus extension (install phase currently failing on cp command)

steve-chavez commented 1 year ago

Getting a failure locally.. something about pg_send_cancellation:

Note: pg_send_cancellation is removed on master https://github.com/citusdata/citus/blob/main/CHANGELOG.md

Removes pg_send_cancellation (#7135)

[1/3/13 built, 12 copied (8.6/8.6 MiB), 2.3 MiB DL] building citus-12.0.0 (buildPhase): gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels
[1/3/13 built, 12 copied (8.6/8.6 MiB), 2.3 MiB DL] building citus-12.0.0 (buildPhase): cd /build/source/src/backend/distributed && cpp -undef -w -P -MMD -MP -MF.deps/sql/citus--9.3-1--9.2-4.
error: builder for '/nix/store/f99q3fbbxyrp5ap842xyjzn6cywxx7s5-citus-12.0.0.drv' failed with exit code 1;
       last 10 log lines:
       > make[1]: Leaving directory '/build/source/src/backend/distributed'
       > make -C src/bin/pg_send_cancellation/ all
       > make[1]: Entering directory '/build/source/src/bin/pg_send_cancellation'
       > gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wform
at-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -O2 -std=gnu99 -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wn
o-missing-field-initializers -Wno-clobbered -Wno-declaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wmissing-declarations -Wmissing-prototypes -Wshadow -Werror=vla -Werror=
implicit-int -Werror=implicit-function-declaration -Werror=return-type -fstack-clash-protection -fno-lto -I '/build/source/src/include' -I'../../../src/include' -I/nix/store/34bcl4nf3ssi5p312r
h7k2mkvlqwxmdm-postgresql-14.8/include -I. -I./ -I/nix/store/34bcl4nf3ssi5p312rh7k2mkvlqwxmdm-postgresql-14.8/include/server -I/nix/store/34bcl4nf3ssi5p312rh7k2mkvlqwxmdm-postgresql-14.8/inclu
de/internal -I/nix/store/111xkqxyjv4dqap3fj2d745idccgg1fh-icu4c-73.2-dev/include -D_GNU_SOURCE -I/nix/store/8xl8nwa8iizcclmxi4zdh5jipr4gijzv-libxml2-2.11.4-dev/include/libxml2 -I/nix/store/16p
1lya6a8gqzbqwrm9fan14m0idadcp-lz4-1.9.4-dev/include   -c -o /build/source//src/bin/pg_send_cancellation/pg_send_cancellation.o /build/source//src/bin/pg_send_cancellation/pg_send_cancellation.
c
       > gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wform
at-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -O2 -std=gnu99 -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wn
o-missing-field-initializers -Wno-clobbered -Wno-declaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wmissing-declarations -Wmissing-prototypes -Wshadow -Werror=vla -Werror=
implicit-int -Werror=implicit-function-declaration -Werror=return-type -fstack-clash-protection -fno-lto /build/source//src/bin/pg_send_cancellation/pg_send_cancellation.o -L/nix/store/cjfg4ip
ax94fxdhb31180rqs0b2vvfp7-postgresql-14.8-lib/lib -lpgcommon -lpgport -L/nix/store/cjfg4ipax94fxdhb31180rqs0b2vvfp7-postgresql-14.8-lib/lib -lpq -L/nix/store/cjfg4ipax94fxdhb31180rqs0b2vvfp7-p
ostgresql-14.8-lib/lib  -L/nix/store/s9fs1xciw3m79d9qhg0zdglb4qji5i8l-libxml2-2.11.4/lib -L/nix/store/1wa96smh0m8qfc9az79j6yavc9m4vzh4-lz4-1.9.4/lib  -Wl,--as-needed -Wl,-rpath,'/nix/store/cjf
g4ipax94fxdhb31180rqs0b2vvfp7-postgresql-14.8-lib/lib',--enable-new-dtags -L/nix/store/cjfg4ipax94fxdhb31180rqs0b2vvfp7-postgresql-14.8-lib/lib  -L/nix/store/s9fs1xciw3m79d9qhg0zdglb4qji5i8l-l
ibxml2-2.11.4/lib -L/nix/store/1wa96smh0m8qfc9az79j6yavc9m4vzh4-lz4-1.9.4/lib  -Wl,--as-needed -Wl,-rpath,'/nix/store/cjfg4ipax94fxdhb31180rqs0b2vvfp7-postgresql-14.8-lib/lib',--enable-new-dta
gs -lzstd -llz4 -lcurl     -lpgcommon -lpgport -llz4 -lxml2 -lssl -lcrypto -lgssapi_krb5 -lm -o pg_send_cancellation
       > make[1]: Leaving directory '/build/source/src/bin/pg_send_cancellation'
       > buildPhase completed in 1 minutes 3 seconds
       > installing
       > cp: missing destination file operand after '/nix/store/k4n5cy2i5q0ndg65vibca19bn88s17w7-citus-12.0.0/lib'
       > Try 'cp --help' for more information.
       For full logs, run 'nix log /nix/store/f99q3fbbxyrp5ap842xyjzn6cywxx7s5-citus-12.0.0.drv'.
error: 1 dependencies of derivation '/nix/store/2sggx45wjya69kaxxll9cq5gzqr1w2wk-postgresql-and-plugins-14.8.drv' failed to build
error: 1 dependencies of derivation '/nix/store/csgfbgy5q244dmhv3z4xf8bzgiigik2d-postgresql-and-plugins-14.8.drv' failed to build
error: 1 dependencies of derivation '/nix/store/wjh6ddwir4k0iyqb89ga7m1nvj69i9bx-migrate-postgres.drv' failed to build
error: 1 dependencies of derivation '/nix/store/qyk3n5l71jh20wpx2n5b3abrgjj3pl44-nix-shell-env.drv' failed to build
steve-chavez commented 1 year ago

@olirice Done!

I've also added some smoke tests for citus distributed and columnar. CI is being slow now (will fix this on another PR) Somehow CI is now fast again. You can also do this locally:

$ nix flake check -L

# will show
#...

postgres> CREATE EXTENSION IF NOT EXISTS citus;
postgres> CREATE EXTENSION

postgres> /nix/store/mw10w6i9cb1sm66rqvsnraj1qgh77c1j-smoke/0004-citus.sql ........... ok
postgres> All tests successful.
postgres> Files=5, Tests=10,  0 wallclock secs ( 0.01 usr  0.00 sys +  0.01 cusr  0.01 csys =  0.03 CPU)
postgres> Result: PASS