Fedora Account System
Red Hat Associate
Red Hat Customer
Description of problem: Package python-psycopg2 fails to build from source in Fedora Rawhide. Version-Release number of selected component (if applicable): 2.9.3-3.fc37 Steps to Reproduce: koji build --scratch f37 python-psycopg2-2.9.3-3.fc37.src.rpm Additional info: This package is tracked by Koschei. See: https://koschei.fedoraproject.org/package/python-psycopg2 This blocks Python 3.11 mass rebuild, thus urgent severity. The error is the same also for Python 3.10 in rawhide. Error: pg_config executable not found.
According to Koschei, this started happening with postgres 14.2 -> 14.3 update. This is what it looks like: + python3 setup.py build running build running build_py creating build creating build/lib.linux-x86_64-3.10 creating build/lib.linux-x86_64-3.10/psycopg2 copying lib/__init__.py -> build/lib.linux-x86_64-3.10/psycopg2 copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.10/psycopg2 copying lib/_json.py -> build/lib.linux-x86_64-3.10/psycopg2 copying lib/_range.py -> build/lib.linux-x86_64-3.10/psycopg2 copying lib/errorcodes.py -> build/lib.linux-x86_64-3.10/psycopg2 copying lib/errors.py -> build/lib.linux-x86_64-3.10/psycopg2 copying lib/extensions.py -> build/lib.linux-x86_64-3.10/psycopg2 copying lib/extras.py -> build/lib.linux-x86_64-3.10/psycopg2 copying lib/pool.py -> build/lib.linux-x86_64-3.10/psycopg2 copying lib/sql.py -> build/lib.linux-x86_64-3.10/psycopg2 copying lib/tz.py -> build/lib.linux-x86_64-3.10/psycopg2 running build_ext Error: pg_config executable not found. pg_config is required to build psycopg2 from source. Please add the directory containing pg_config to the $PATH or specify the full executable path with the option: python setup.py build_ext --pg-config /path/to/pg_config build ... Adding BuildRequires: /usr/bin/pg_config does not make any difference, the file is already BuildRequired. Using (as the error suggests): %build ... for python in %{python_runtimes} ; do $python setup.py build_ext --pg-config /usr/bin/pg_config build done Results in: + python3 setup.py build_ext --pg-config /usr/bin/pg_config build running build_ext Error: Unable to find 'pg_config' file in '/usr/bin/pg_config' The same when using just --pg-config /usr/bin/
I believe we can build Django without psycopg2 temporarily, hence lowering the urgency a bit, sorry if this spooked you. This is still quite a vital package though.
Hi, It's ok, I am slightly surprised by such an issue. I need to investigate it, but I think building with libpq-devel instead of postgresql-private-devel should fix it.
If you fix it, submit the build with --target=f37-python please.
Build passed https://koji.fedoraproject.org/koji/taskinfo?taskID=88263630
Thank you!