From: Daniele Varrazzo Date: Tue, 29 Jun 2021 10:32:50 +0000 (+0100) Subject: Pass the correct libdir to the window builder X-Git-Tag: 3.0.dev0~4^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5ced8d917a1e3722107cae78ec3ed8d44823b2f3;p=thirdparty%2Fpsycopg.git Pass the correct libdir to the window builder "pg_config --libdir" returns "C:/STRAWB~1/c/lib" Reported in https://github.com/actions/runner/issues/1178 --- diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d79e03a8d..d2fee6b5d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -153,3 +153,7 @@ jobs: - name: Run tests (C implementation) run: tox -c psycopg_c -e ${{ matrix.python }} -- --color yes if: ${{ matrix.impl == 'c' }} + env: + # the pg_config returns the wrong path + # Note: this env var name must be in the tox.ini passenv + PG_LIBPATH: 'C:\Program Files\PostgreSQL\13\lib' diff --git a/psycopg_c/setup.py b/psycopg_c/setup.py index ffe8163d1..fed83b2bd 100644 --- a/psycopg_c/setup.py +++ b/psycopg_c/setup.py @@ -58,6 +58,12 @@ class psycopg_build_ext(build_ext): ext.include_dirs.append(includedir) ext.library_dirs.append(libdir) + # hack to build on GH Actions (pg_config --libdir broken) + # https://github.com/actions/runner/issues/1178 + for path in os.environ.get("PG_LIBPATH", "").split(os.pathsep): + if path: + ext.library_dirs.append(path) + if cythonize is not None: for ext in self.distribution.ext_modules: for i in range(len(ext.sources)):