Bug 2096858 - python-psycopg2: FTBFS in Fedora Rawhide since postgres 14.3
Summary: python-psycopg2: FTBFS in Fedora Rawhide since postgres 14.3
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-psycopg2
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Filip Januš
QA Contact: Fedora Extras Quality Assurance
URL: https://koschei.fedoraproject.org/pac...
Whiteboard:
Depends On:
Blocks: PYTHON3.11 F37FTBFS
TreeView+ depends on / blocked
 
Reported: 2022-06-14 12:47 UTC by Tomáš Hrnčiar
Modified: 2022-06-14 14:17 UTC (History)
8 users (show)

Fixed In Version: python-psycopg2-2.9.3-5.fc37
Clone Of:
Environment:
Last Closed: 2022-06-14 14:17:43 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2022-06-14 12:47:09 UTC
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.

Comment 1 Miro Hrončok 2022-06-14 12:53:30 UTC
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/

Comment 2 Miro Hrončok 2022-06-14 13:09:18 UTC
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.

Comment 3 Filip Januš 2022-06-14 13:13:59 UTC
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.

Comment 4 Miro Hrončok 2022-06-14 13:22:52 UTC
If you fix it, submit the build with --target=f37-python please.

Comment 5 Filip Januš 2022-06-14 13:34:52 UTC
Build passed https://koji.fedoraproject.org/koji/taskinfo?taskID=88263630

Comment 6 Miro Hrončok 2022-06-14 14:17:00 UTC
Thank you!


Note You need to log in before you can comment on or make changes to this bug.