Bug 2021796 - PyPAM fails to build with Python 3.11: error: lvalue required as left operand of assignment
Summary: PyPAM fails to build with Python 3.11: error: lvalue required as left operan...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: PyPAM
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Orphan Owner
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.11
TreeView+ depends on / blocked
 
Reported: 2021-11-10 08:51 UTC by Tomáš Hrnčiar
Modified: 2021-12-23 14:19 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-12-23 14:19:29 UTC
Type: Bug


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2021-11-10 08:51:03 UTC
PyPAM fails to build with Python 3.11.0a2.

PAMmodule.c: In function ‘PyPAM_conv’:
PAMmodule.c:90:5: warning: ‘PyEval_CallObjectWithKeywords’ is deprecated [-Wdeprecated-declarations]
   90 |     respList = PyEval_CallObject(self->callback, args);
      |     ^~~~~~~~
In file included from /usr/include/python3.11/Python.h:93,
                 from PAMmodule.c:14:
/usr/include/python3.11/ceval.h:27:43: note: declared here
   27 | Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords(
      |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PAMmodule.c: In function ‘PyInit_PAM’:
PAMmodule.c:678:32: error: lvalue required as left operand of assignment
  678 |     Py_TYPE(&PyPAMObject_Type) = &PyType_Type;
      |                                ^
At top level:
PAMmodule.c:10:13: warning: ‘revision’ defined but not used [-Wunused-variable]
   10 | static char revision[] = "$Id: PAMmodule.c,v 1.3 2007/04/18 03:55:11 rob Exp $";
      |             ^~~~~~~~
error: command '/usr/bin/gcc' failed with exit code 1

Since Py_TYPE() is changed to a inline static function, Py_TYPE(obj) = new_type must be replaced with Py_SET_TYPE(obj, new_type): see the Py_SET_TYPE() function (available since Python 3.9). For backward compatibility, this macro can be used:

#if PY_VERSION_HEX < 0x030900A4 && !defined(Py_SET_TYPE)
static inline void _Py_SET_TYPE(PyObject *ob, PyTypeObject *type)
{ ob->ob_type = type; }
#define Py_SET_TYPE(ob, type) _Py_SET_TYPE((PyObject*)(ob), type)
#endif

(Contributed by Victor Stinner in bpo-39573.)

https://bugs.python.org/issue39573
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/02939444-PyPAM/

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

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 1 Fedora Admin user for bugzilla script actions 2021-11-11 00:04:24 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 2 Miro Hrončok 2021-12-23 14:19:29 UTC
Automation has figured out the package is retired in rawhide.

If you like it to be unretired, please open a ticket at https://pagure.io/releng/new_issue?template=package_unretirement


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