Bug 2176164 - zbar fails to build with Python 3.12: error: 'PyLongObject' {aka 'struct _longobject'} has no member named 'ob_digit'
Summary: zbar fails to build with Python 3.12: error: 'PyLongObject' {aka 'struct _lon...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: zbar
Version: 39
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Gwyn Ciesla
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.12
TreeView+ depends on / blocked
 
Reported: 2023-03-07 14:37 UTC by Tomáš Hrnčiar
Modified: 2023-08-16 07:11 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2023-03-07 14:37:00 UTC
zbar fails to build with Python 3.12.0a5.

In file included from /usr/include/python3.12/Python.h:44,
                 from python/zbarmodule.h:24,
                 from python/enum.c:24:
python/enum.c: In function 'enumitem_new':
/usr/include/python3.12/object.h:179:68: warning: passing argument 2 of 'Py_SET_SIZE' makes integer from pointer without a cast [-Wint-conversion]
  179 | #  define Py_SET_SIZE(ob, size) Py_SET_SIZE(_PyVarObject_CAST(ob), (size))
      |                                                                    ^~~~~~
      |                                                                    |
      |                                                                    PyLongObject * {aka struct _longobject *}
python/enum.c:61:5: note: in expansion of macro 'Py_SET_SIZE'
   61 |     Py_SET_SIZE(&self->val, longval);
      |     ^~~~~~~~~~~
/usr/include/python3.12/object.h:175:60: note: expected 'Py_ssize_t' {aka 'long int'} but argument is of type 'PyLongObject *' {aka 'struct _longobject *'}
  175 | static inline void Py_SET_SIZE(PyVarObject *ob, Py_ssize_t size) {
      |                                                 ~~~~~~~~~~~^~~~
python/enum.c:62:14: error: 'PyLongObject' {aka 'struct _longobject'} has no member named 'ob_digit'
   62 |     self->val.ob_digit[0] = longval->ob_digit[0];
      |              ^
python/enum.c:62:36: error: 'PyLongObject' {aka 'struct _longobject'} has no member named 'ob_digit'
   62 |     self->val.ob_digit[0] = longval->ob_digit[0];
      |                                    ^~
python/enum.c: In function 'zbarEnumItem_New':
/usr/include/python3.12/object.h:179:68: warning: passing argument 2 of 'Py_SET_SIZE' makes integer from pointer without a cast [-Wint-conversion]
  179 | #  define Py_SET_SIZE(ob, size) Py_SET_SIZE(_PyVarObject_CAST(ob), (size))
      |                                                                    ^~~~~~
      |                                                                    |
      |                                                                    PyLongObject * {aka struct _longobject *}
python/enum.c:152:5: note: in expansion of macro 'Py_SET_SIZE'
  152 |     Py_SET_SIZE(&self->val, longval);
      |     ^~~~~~~~~~~
/usr/include/python3.12/object.h:175:60: note: expected 'Py_ssize_t' {aka 'long int'} but argument is of type 'PyLongObject *' {aka 'struct _longobject *'}
  175 | static inline void Py_SET_SIZE(PyVarObject *ob, Py_ssize_t size) {
      |                                                 ~~~~~~~~~~~^~~~
python/enum.c:153:14: error: 'PyLongObject' {aka 'struct _longobject'} has no member named 'ob_digit'
  153 |     self->val.ob_digit[0] = longval->ob_digit[0];
      |              ^
python/enum.c:153:36: error: 'PyLongObject' {aka 'struct _longobject'} has no member named 'ob_digit'
  153 |     self->val.ob_digit[0] = longval->ob_digit[0];
      |                                    ^~

GH-101291: Refactor the PyLongObject struct #101292
https://github.com/python/cpython/pull/101292
https://docs.python.org/3.12/whatsnew/3.12.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.12/fedora-rawhide-x86_64/05583836-zbar/

For all our attempts to build zbar with Python 3.12, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/package/zbar/

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.12:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/

Let us know here if you have any questions.

Python 3.12 is planned to be included in Fedora 39. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.12.
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 Release Engineering 2023-08-16 07:11:06 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.


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