|
606 | 606 | sqlTests = ./nix/tests/smoke;
|
607 | 607 | pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP;
|
608 | 608 | pg_regress = basePackages.pg_regress;
|
609 |
| - getkey-script = pkgs.writeScriptBin "pgsodium-getkey" '' |
610 |
| - #!${pkgs.bash}/bin/bash |
611 |
| - set -euo pipefail |
612 |
| - |
613 |
| - TMPDIR_BASE=$(mktemp -d) |
614 |
| - |
615 |
| - if [[ "$(uname)" == "Darwin" ]]; then |
616 |
| - KEY_DIR="/private/tmp/pgsodium" |
617 |
| - else |
618 |
| - KEY_DIR="''${PGSODIUM_KEY_DIR:-$TMPDIR_BASE/pgsodium}" |
619 |
| - fi |
620 |
| - KEY_FILE="$KEY_DIR/pgsodium.key" |
621 |
| - |
622 |
| - if ! mkdir -p "$KEY_DIR" 2>/dev/null; then |
623 |
| - echo "Error: Could not create key directory $KEY_DIR" >&2 |
624 |
| - exit 1 |
625 |
| - fi |
626 |
| - chmod 1777 "$KEY_DIR" |
627 |
| - |
628 |
| - if [[ ! -f "$KEY_FILE" ]]; then |
629 |
| - if ! (dd if=/dev/urandom bs=32 count=1 2>/dev/null | od -A n -t x1 | tr -d ' \n' > "$KEY_FILE"); then |
630 |
| - if ! (openssl rand -hex 32 > "$KEY_FILE"); then |
631 |
| - echo "00000000000000000000000000000000" > "$KEY_FILE" |
632 |
| - echo "Warning: Using fallback key" >&2 |
| 609 | + getkey-script = pkgs.stdenv.mkDerivation { |
| 610 | + name = "pgsodium-getkey"; |
| 611 | + buildCommand = '' |
| 612 | + mkdir -p $out/bin |
| 613 | + cat > $out/bin/pgsodium-getkey << 'EOF' |
| 614 | + #!${pkgs.bash}/bin/bash |
| 615 | + set -euo pipefail |
| 616 | + |
| 617 | + TMPDIR_BASE=$(mktemp -d) |
| 618 | + |
| 619 | + if [[ "$(uname)" == "Darwin" ]]; then |
| 620 | + KEY_DIR="/private/tmp/pgsodium" |
| 621 | + else |
| 622 | + KEY_DIR="''${PGSODIUM_KEY_DIR:-$TMPDIR_BASE/pgsodium}" |
| 623 | + fi |
| 624 | + KEY_FILE="$KEY_DIR/pgsodium.key" |
| 625 | + |
| 626 | + if ! mkdir -p "$KEY_DIR" 2>/dev/null; then |
| 627 | + echo "Error: Could not create key directory $KEY_DIR" >&2 |
| 628 | + exit 1 |
| 629 | + fi |
| 630 | + chmod 1777 "$KEY_DIR" |
| 631 | + |
| 632 | + if [[ ! -f "$KEY_FILE" ]]; then |
| 633 | + if ! (dd if=/dev/urandom bs=32 count=1 2>/dev/null | od -A n -t x1 | tr -d ' \n' > "$KEY_FILE"); then |
| 634 | + if ! (openssl rand -hex 32 > "$KEY_FILE"); then |
| 635 | + echo "00000000000000000000000000000000" > "$KEY_FILE" |
| 636 | + echo "Warning: Using fallback key" >&2 |
| 637 | + fi |
633 | 638 | fi
|
| 639 | + chmod 644 "$KEY_FILE" |
634 | 640 | fi
|
635 |
| - chmod 644 "$KEY_FILE" |
636 |
| - fi |
637 |
| - |
638 |
| - if [[ -f "$KEY_FILE" && -r "$KEY_FILE" ]]; then |
639 |
| - cat "$KEY_FILE" |
640 |
| - else |
641 |
| - echo "Error: Cannot read key file $KEY_FILE" >&2 |
642 |
| - exit 1 |
643 |
| - fi |
644 |
| - ''; |
| 641 | + |
| 642 | + if [[ -f "$KEY_FILE" && -r "$KEY_FILE" ]]; then |
| 643 | + cat "$KEY_FILE" |
| 644 | + else |
| 645 | + echo "Error: Cannot read key file $KEY_FILE" >&2 |
| 646 | + exit 1 |
| 647 | + fi |
| 648 | + EOF |
| 649 | + chmod +x $out/bin/pgsodium-getkey |
| 650 | + ''; |
| 651 | + }; |
645 | 652 |
|
646 | 653 | # Use the shared setup but with a test-specific name
|
647 | 654 | start-postgres-server-bin = makePostgresDevSetup {
|
|
710 | 717 | echo "listen_addresses = '*'" >> "$PGTAP_CLUSTER"/postgresql.conf
|
711 | 718 | echo "port = 5435" >> "$PGTAP_CLUSTER"/postgresql.conf
|
712 | 719 | echo "host all all 127.0.0.1/32 trust" >> $PGTAP_CLUSTER/pg_hba.conf
|
| 720 | + echo "Checking shared_preload_libraries setting:" |
| 721 | + grep -rn "shared_preload_libraries" "$PGTAP_CLUSTER"/postgresql.conf |
713 | 722 | # Remove timescaledb if running orioledb-17 check
|
714 | 723 | echo "I AM ${pgpkg.version}===================================================="
|
715 | 724 | if [[ "${pgpkg.version}" == *"17"* ]]; then
|
|
808 | 817 | --user=supabase_admin \
|
809 | 818 | ${builtins.concatStringsSep " " sortedTestList}; then
|
810 | 819 | echo "pg_regress tests failed"
|
| 820 | + cat $out/regression_output/regression.diffs |
811 | 821 | exit 1
|
812 | 822 | fi
|
813 | 823 |
|
|
0 commit comments