"pg_config --libdir" returns "C:/STRAWB~1/c/lib"
Reported in https://github.com/actions/runner/issues/1178
- 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'
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)):