Bug 2023272 - postgresql fails to build with Python 3.11: fatal error: eval.h: No such file or directory
Summary: postgresql fails to build with Python 3.11: fatal error: eval.h: No such fil...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: postgresql
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Filip Januš
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 2092085 (view as bug list)
Depends On:
Blocks: PYTHON3.11
TreeView+ depends on / blocked
 
Reported: 2021-11-15 11:03 UTC by Tomáš Hrnčiar
Modified: 2022-06-07 10:24 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-06-07 10:24:51 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2021-11-15 11:03:36 UTC
postgresql fails to build with Python 3.11.0a2.

plpython.h:98:10: fatal error: eval.h: No such file or directory
   98 | #include <eval.h>
      |          ^~~~~~~~
compilation terminated.

The non-limited API files cellobject.h, classobject.h, context.h, funcobject.h, genobject.h and longintrepr.h have been moved to the Include/cpython directory. Moreover, the eval.h header file was removed. These files must not be included directly, as they are already included in Python.h: Include Files. If they have been included directly, consider including Python.h instead. (Contributed by Victor Stinner in bpo-35134.)

https://bugs.python.org/issue35134
https://docs.python.org/3.11/whatsnew/3.11.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora-rawhide-x86_64/02939397-postgresql/

For all our attempts to build postgresql with Python 3.11, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/postgresql/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.11:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/

Let us know here if you have any questions.

Python 3.11 is planned to be included in Fedora 37. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.11.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 2 Ben Cotton 2022-02-08 21:25:44 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

Comment 3 Miro Hrončok 2022-02-27 00:17:05 UTC
(In reply to Tom Lane from comment #1)
> Repaired upstream at
> 
> https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;
> h=99e4d24a9d77e7bb87e15b318e96dc36651a7da2

Thanks, Tom.

Filip, this fix appears trivial. Any changes you could backport it?

Comment 4 Miro Hrončok 2022-02-27 00:17:25 UTC
s/changes/chance/

Comment 5 Tom Lane 2022-02-27 06:37:17 UTC
FYI, while the compile failure mentioned here is indeed trivial to fix, there's a much less trivial issue that'll be exposed by the regression tests once you get past it.  We're still working on the fix for that:

https://www.postgresql.org/message-id/flat/3375ffd8-d71c-2565-e348-a597d6e739e3@enterprisedb.com

Comment 6 Filip Januš 2022-02-28 08:34:28 UTC
I would prefer to wait for the complete fix that we can backport.

Comment 7 Tom Lane 2022-03-02 17:37:29 UTC
The other fix has now been pushed to HEAD:

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=2e517818f4af4abe93bf56442469944544f10d4b

It doesn't seem to have broken anything, but I'm not yet comfortable enough to back-patch it.  However, if you guys cared to put it into F36 that would provide some more data about how safe it is.

Comment 8 Miro Hrončok 2022-03-02 17:39:21 UTC
We need it in F37, not F36.

Comment 9 Honza Horak 2022-05-31 18:40:27 UTC
This specific issue seems to be fixed with the latest release (postgresql-14.3 currently in rawhide, build on the way). However, the Python 3.11 compatibility seems to be not ready yet anyway, reported separately as bz#2092085. I'm closing this one though.

Comment 10 Honza Horak 2022-05-31 18:52:54 UTC
(In reply to Honza Horak from comment #9)
> This specific issue seems to be fixed with the latest release
> (postgresql-14.3 currently in rawhide, build on the way). However, the
> Python 3.11 compatibility seems to be not ready yet anyway, reported
> separately as bz#2092085. I'm closing this one though.

Hups, I was wrong, the change from comment #7 doesn't seem to be part. Re-opening this one as it was already discussed here and rather closing the new one as duplicit of this. Sorry for confusion.

Comment 11 Honza Horak 2022-05-31 18:54:18 UTC
*** Bug 2092085 has been marked as a duplicate of this bug. ***

Comment 12 Honza Horak 2022-05-31 20:24:04 UTC
Patch from comment #7 prepared in https://src.fedoraproject.org/rpms/postgresql/pull-request/52
It seems to work fine with the Python 3.11 copr.

Comment 13 Honza Horak 2022-06-07 10:24:51 UTC
Built in rawhide.
https://koji.fedoraproject.org/koji/buildinfo?buildID=1977381


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