From 11be816d8765b1ab2f9d417b927e6c4527a722d2 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Thu, 10 Oct 2024 14:26:55 -0500 Subject: [PATCH] ci: test on macos Also remove unused pg_config.sh --- .github/workflows/main.yml | 17 +++++++++++++++++ nix/postgresql/pg_config.sh | 35 ----------------------------------- 2 files changed, 17 insertions(+), 35 deletions(-) delete mode 100644 nix/postgresql/pg_config.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3c14f5e..d9e0824 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,3 +23,20 @@ jobs: run: nix-shell --run "supautils-with-pg-${{ matrix.pg-version }} make installcheck" - if: ${{ failure() }} run: cat regression.diffs + + test-on-macos: + runs-on: macos-13 + + strategy: + matrix: + pg-version: ['17'] + + steps: + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v30 + with: + nix_path: nixpkgs=channel:nixos-unstable + - name: Run tests + run: nix-shell --run "supautils-with-pg-${{ matrix.pg-version }} make installcheck" + - if: ${{ failure() }} + run: cat regression.diffs diff --git a/nix/postgresql/pg_config.sh b/nix/postgresql/pg_config.sh deleted file mode 100644 index 9538b21..0000000 --- a/nix/postgresql/pg_config.sh +++ /dev/null @@ -1,35 +0,0 @@ -# The real pg_config needs to be in the same path as the "postgres" binary -# to return proper paths. However, we want it in the -dev output to prevent -# cyclic references and to prevent blowing up the runtime closure. Thus, we -# have wrapped -dev/bin/pg_config to fake its argv0 to be in the default -# output. Unfortunately, pg_config tries to be smart and tries to find itself - -# which will then fail with: -# pg_config: could not find own program executable -# To counter this, we're creating *this* fake pg_config script and put it into -# the default output. The real pg_config is happy. -# Some extensions, e.g. timescaledb, use the reverse logic and look for pg_config -# in the same path as the "postgres" binary to support multi-version-installs. -# Thus, they will end up calling this script during build, even though the real -# pg_config would be available on PATH, provided by nativeBuildInputs. To help -# this case, we're redirecting the call to pg_config to the one found in PATH, -# iff we can be convinced that it belongs to our -dev output. - -# Avoid infinite recursion -if [[ ! -v PG_CONFIG_CALLED ]]; then - # compares "path of *this* script" with "path, which pg_config on PATH believes it is in" - if [[ "$(readlink -f -- "$0")" == "$(PG_CONFIG_CALLED=1 pg_config --bindir)/pg_config" ]]; then - # The pg_config in PATH returns the same bindir that we're actually called from. - # This means that the pg_config in PATH is the one from "our" -dev output. - # This happens when the -dev output has been put in native build - # inputs and allows us to call the real pg_config without referencing - # the -dev output itself. - exec pg_config "$@" - fi -fi - -# This will happen in one of these cases: -# - *this* script is the first on PATH -# - np pg_config on PATH -# - some other pg_config on PATH, not from our -dev output -echo The real pg_config can be found in the -dev output. -exit 1