Bug 2083982

Summary: omniORBpy fails to build with Python 3.11: error: invalid cast from type 'omniPy::PyRefHolder' to type 'const PyObject*' {aka 'const _object*'}
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: omniORBpyAssignee: Sandro Mani <manisandro>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: manisandro, mhroncok, thrnciar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-06-14 06:30:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2016048    

Description Tomáš Hrnčiar 2022-05-11 07:24:54 UTC
omniORBpy fails to build with Python 3.11.0b1.

/usr/include/python3.11/pyport.h:30:25: error: invalid cast from type 'omniPy::PyRefHolder' to type 'const PyObject*' {aka 'const _object*'}
   30 |        const_cast<type>(reinterpret_cast<const type>(expr))
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/python3.11/tupleobject.h:27:18: note: in expansion of macro 'PyType_FastSubclass'
   27 |                  PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS)
      |                  ^~~~~~~~~~~~~~~~~~~
/usr/include/python3.11/object.h:107:28: note: in expansion of macro '_Py_CAST'
  107 | #define _PyObject_CAST(op) _Py_CAST(PyObject*, (op))
      |                            ^~~~~~~~
/usr/include/python3.11/object.h:136:31: note: in expansion of macro '_PyObject_CAST'
  136 | #  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
      |                               ^~~~~~~~~~~~~~
/usr/include/python3.11/tupleobject.h:27:38: note: in expansion of macro 'Py_TYPE'
   27 |                  PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS)
      |                                      ^~~~~~~
/usr/include/python3.11/cpython/tupleobject.h:18:13: note: in expansion of macro 'PyTuple_Check'
   18 |     (assert(PyTuple_Check(op)), _Py_CAST(PyTupleObject*, (op)))
      |             ^~~~~~~~~~~~~
/usr/include/python3.11/cpython/tupleobject.h:25:47: note: in expansion of macro '_PyTuple_CAST'
   25 | #define PyTuple_GET_SIZE(op) PyTuple_GET_SIZE(_PyTuple_CAST(op))
      |                                               ^~~~~~~~~~~~~
../../modules/omnipy.h:1210:16: note: in expansion of macro 'PyTuple_GET_SIZE'
 1210 |       in_l_  = PyTuple_GET_SIZE(in_d_);
      |                ^~~~~~~~~~~~~~~~
In file included from /usr/include/python3.11/Python.h:38:
/usr/include/python3.11/pyport.h:30:25: error: invalid cast from type 'omniPy::PyRefHolder' to type 'const PyTupleObject*'
   30 |        const_cast<type>(reinterpret_cast<const type>(expr))
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/python3.11/cpython/tupleobject.h:18:33: note: in expansion of macro '_Py_CAST'
   18 |     (assert(PyTuple_Check(op)), _Py_CAST(PyTupleObject*, (op)))
      |                                 ^~~~~~~~
/usr/include/python3.11/cpython/tupleobject.h:25:47: note: in expansion of macro '_PyTuple_CAST'
   25 | #define PyTuple_GET_SIZE(op) PyTuple_GET_SIZE(_PyTuple_CAST(op))
      |                                               ^~~~~~~~~~~~~
../../modules/omnipy.h:1210:16: note: in expansion of macro 'PyTuple_GET_SIZE'
 1210 |       in_l_  = PyTuple_GET_SIZE(in_d_);
      |                ^~~~~~~~~~~~~~~~
/usr/include/python3.11/pyport.h:30:25: error: invalid cast from type 'omniPy::PyRefHolder' to type 'const PyObject*' {aka 'const _object*'}
   30 |        const_cast<type>(reinterpret_cast<const type>(expr))
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/python3.11/tupleobject.h:27:18: note: in expansion of macro 'PyType_FastSubclass'
   27 |                  PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS)
      |                  ^~~~~~~~~~~~~~~~~~~
/usr/include/python3.11/object.h:107:28: note: in expansion of macro '_Py_CAST'
  107 | #define _PyObject_CAST(op) _Py_CAST(PyObject*, (op))
      |                            ^~~~~~~~
/usr/include/python3.11/object.h:136:31: note: in expansion of macro '_PyObject_CAST'
  136 | #  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
      |                               ^~~~~~~~~~~~~~
/usr/include/python3.11/tupleobject.h:27:38: note: in expansion of macro 'Py_TYPE'
   27 |                  PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS)
      |                                      ^~~~~~~
/usr/include/python3.11/cpython/tupleobject.h:18:13: note: in expansion of macro 'PyTuple_Check'
   18 |     (assert(PyTuple_Check(op)), _Py_CAST(PyTupleObject*, (op)))
      |             ^~~~~~~~~~~~~
/usr/include/python3.11/cpython/tupleobject.h:25:47: note: in expansion of macro '_PyTuple_CAST'
   25 | #define PyTuple_GET_SIZE(op) PyTuple_GET_SIZE(_PyTuple_CAST(op))
      |                                               ^~~~~~~~~~~~~
../../modules/omnipy.h:1211:35: note: in expansion of macro 'PyTuple_GET_SIZE'
 1211 |       out_l_ = is_oneway() ? -1 : PyTuple_GET_SIZE(out_d_);
      |                                   ^~~~~~~~~~~~~~~~
/usr/include/python3.11/pyport.h:30:25: error: invalid cast from type 'omniPy::PyRefHolder' to type 'const PyTupleObject*'
   30 |        const_cast<type>(reinterpret_cast<const type>(expr))
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/python3.11/cpython/tupleobject.h:18:33: note: in expansion of macro '_Py_CAST'
   18 |     (assert(PyTuple_Check(op)), _Py_CAST(PyTupleObject*, (op)))
      |                                 ^~~~~~~~
/usr/include/python3.11/cpython/tupleobject.h:25:47: note: in expansion of macro '_PyTuple_CAST'
   25 | #define PyTuple_GET_SIZE(op) PyTuple_GET_SIZE(_PyTuple_CAST(op))
      |                                               ^~~~~~~~~~~~~
../../modules/omnipy.h:1211:35: note: in expansion of macro 'PyTuple_GET_SIZE'
 1211 |       out_l_ = is_oneway() ? -1 : PyTuple_GET_SIZE(out_d_);
      |                                   ^~~~~~~~~~~~~~~~
In file included from /usr/include/python3.11/Python.h:35,
                 from ../../modules/omnipy.h:37,
                 from ../../modules/omnipy.cc:36:
../../modules/omnipy.h: In member function 'void omniPy::Py_omniCallDescriptor::init()':
/usr/include/python3.11/pyport.h:30:25: error: invalid cast from type 'omniPy::PyRefHolder' to type 'const PyObject*' {aka 'const _object*'}
   30 |        const_cast<type>(reinterpret_cast<const type>(expr))
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/python3.11/tupleobject.h:27:18: note: in expansion of macro 'PyType_FastSubclass'
   27 |                  PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS)
      |                  ^~~~~~~~~~~~~~~~~~~
/usr/include/python3.11/object.h:107:28: note: in expansion of macro '_Py_CAST'
  107 | #define _PyObject_CAST(op) _Py_CAST(PyObject*, (op))
      |                            ^~~~~~~~
/usr/include/python3.11/object.h:136:31: note: in expansion of macro '_PyObject_CAST'
  136 | #  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
      |                               ^~~~~~~~~~~~~~
/usr/include/python3.11/tupleobject.h:27:38: note: in expansion of macro 'Py_TYPE'
   27 |                  PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS)
      |                                      ^~~~~~~
/usr/include/python3.11/cpython/tupleobject.h:18:13: note: in expansion of macro 'PyTuple_Check'
   18 |     (assert(PyTuple_Check(op)), _Py_CAST(PyTupleObject*, (op)))
      |             ^~~~~~~~~~~~~
/usr/include/python3.11/cpython/tupleobject.h:25:47: note: in expansion of macro '_PyTuple_CAST'
   25 | #define PyTuple_GET_SIZE(op) PyTuple_GET_SIZE(_PyTuple_CAST(op))
      |                                               ^~~~~~~~~~~~~
../../modules/omnipy.h:1210:16: note: in expansion of macro 'PyTuple_GET_SIZE'
 1210 |       in_l_  = PyTuple_GET_SIZE(in_d_);
      |                ^~~~~~~~~~~~~~~~
In file included from /usr/include/python3.11/Python.h:38:
/usr/include/python3.11/pyport.h:30:25: error: invalid cast from type 'omniPy::PyRefHolder' to type 'const PyTupleObject*'
   30 |        const_cast<type>(reinterpret_cast<const type>(expr))
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/python3.11/cpython/tupleobject.h:18:33: note: in expansion of macro '_Py_CAST'
   18 |     (assert(PyTuple_Check(op)), _Py_CAST(PyTupleObject*, (op)))
      |                                 ^~~~~~~~
/usr/include/python3.11/cpython/tupleobject.h:25:47: note: in expansion of macro '_PyTuple_CAST'
   25 | #define PyTuple_GET_SIZE(op) PyTuple_GET_SIZE(_PyTuple_CAST(op))
      |                                               ^~~~~~~~~~~~~
../../modules/omnipy.h:1210:16: note: in expansion of macro 'PyTuple_GET_SIZE'
 1210 |       in_l_  = PyTuple_GET_SIZE(in_d_);
      |                ^~~~~~~~~~~~~~~~
/usr/include/python3.11/pyport.h:30:25: error: invalid cast from type 'omniPy::PyRefHolder' to type 'const PyObject*' {aka 'const _object*'}
   30 |        const_cast<type>(reinterpret_cast<const type>(expr))
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/python3.11/tupleobject.h:27:18: note: in expansion of macro 'PyType_FastSubclass'
   27 |                  PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS)
      |                  ^~~~~~~~~~~~~~~~~~~
/usr/include/python3.11/object.h:107:28: note: in expansion of macro '_Py_CAST'
  107 | #define _PyObject_CAST(op) _Py_CAST(PyObject*, (op))
      |                            ^~~~~~~~
/usr/include/python3.11/object.h:136:31: note: in expansion of macro '_PyObject_CAST'
  136 | #  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
      |                               ^~~~~~~~~~~~~~
/usr/include/python3.11/tupleobject.h:27:38: note: in expansion of macro 'Py_TYPE'
   27 |                  PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS)
      |                                      ^~~~~~~
/usr/include/python3.11/cpython/tupleobject.h:18:13: note: in expansion of macro 'PyTuple_Check'
   18 |     (assert(PyTuple_Check(op)), _Py_CAST(PyTupleObject*, (op)))
      |             ^~~~~~~~~~~~~
/usr/include/python3.11/cpython/tupleobject.h:25:47: note: in expansion of macro '_PyTuple_CAST'
   25 | #define PyTuple_GET_SIZE(op) PyTuple_GET_SIZE(_PyTuple_CAST(op))
      |                                               ^~~~~~~~~~~~~
../../modules/omnipy.h:1211:35: note: in expansion of macro 'PyTuple_GET_SIZE'
 1211 |       out_l_ = is_oneway() ? -1 : PyTuple_GET_SIZE(out_d_);
      |                                   ^~~~~~~~~~~~~~~~
/usr/include/python3.11/pyport.h:30:25: error: invalid cast from type 'omniPy::PyRefHolder' to type 'const PyTupleObject*'
   30 |        const_cast<type>(reinterpret_cast<const type>(expr))
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/python3.11/cpython/tupleobject.h:18:33: note: in expansion of macro '_Py_CAST'
   18 |     (assert(PyTuple_Check(op)), _Py_CAST(PyTupleObject*, (op)))
      |                                 ^~~~~~~~
/usr/include/python3.11/cpython/tupleobject.h:25:47: note: in expansion of macro '_PyTuple_CAST'
   25 | #define PyTuple_GET_SIZE(op) PyTuple_GET_SIZE(_PyTuple_CAST(op))
      |                                               ^~~~~~~~~~~~~
../../modules/omnipy.h:1211:35: note: in expansion of macro 'PyTuple_GET_SIZE'
 1211 |       out_l_ = is_oneway() ? -1 : PyTuple_GET_SIZE(out_d_);
      |                                   ^~~~~~~~~~~~~~~~
../../modules/pyORBFunc.cc: In static member function 'static PyObject* omniPy::createPyORBObject(CORBA::ORB_ptr)':
/usr/include/python3.11/pyport.h:30:25: error: invalid cast from type 'omniPy::PyRefHolder' to type 'const PyObject*' {aka 'const _object*'}
   30 |        const_cast<type>(reinterpret_cast<const type>(expr))
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/python3.11/tupleobject.h:27:18: note: in expansion of macro 'PyType_FastSubclass'
   27 |                  PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS)
      |                  ^~~~~~~~~~~~~~~~~~~
/usr/include/python3.11/object.h:107:28: note: in expansion of macro '_Py_CAST'
  107 | #define _PyObject_CAST(op) _Py_CAST(PyObject*, (op))
      |                            ^~~~~~~~
/usr/include/python3.11/object.h:136:31: note: in expansion of macro '_PyObject_CAST'
  136 | #  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
      |                               ^~~~~~~~~~~~~~
/usr/include/python3.11/tupleobject.h:27:38: note: in expansion of macro 'Py_TYPE'
   27 |                  PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS)
      |                                      ^~~~~~~
/usr/include/python3.11/cpython/tupleobject.h:18:13: note: in expansion of macro 'PyTuple_Check'
   18 |     (assert(PyTuple_Check(op)), _Py_CAST(PyTupleObject*, (op)))
      |             ^~~~~~~~~~~~~
/usr/include/python3.11/cpython/tupleobject.h:35:22: note: in expansion of macro '_PyTuple_CAST'
   35 |     PyTuple_SET_ITEM(_PyTuple_CAST(op), index, _PyObject_CAST(value))
      |                      ^~~~~~~~~~~~~
../../modules/pyORBFunc.cc:344:3: note: in expansion of macro 'PyTuple_SET_ITEM'
  344 |   PyTuple_SET_ITEM(args, 0, (PyObject*)self);
      |   ^~~~~~~~~~~~~~~~
/usr/include/python3.11/pyport.h:30:25: error: invalid cast from type 'omniPy::PyRefHolder' to type 'const PyTupleObject*'
   30 |        const_cast<type>(reinterpret_cast<const type>(expr))
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/python3.11/cpython/tupleobject.h:18:33: note: in expansion of macro '_Py_CAST'
   18 |     (assert(PyTuple_Check(op)), _Py_CAST(PyTupleObject*, (op)))
      |                                 ^~~~~~~~
/usr/include/python3.11/cpython/tupleobject.h:35:22: note: in expansion of macro '_PyTuple_CAST'
   35 |     PyTuple_SET_ITEM(_PyTuple_CAST(op), index, _PyObject_CAST(value))
      |                      ^~~~~~~~~~~~~
../../modules/pyORBFunc.cc:344:3: note: in expansion of macro 'PyTuple_SET_ITEM'
  344 |   PyTuple_SET_ITEM(args, 0, (PyObject*)self);
      |   ^~~~~~~~~~~~~~~~

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/04392297-omniORBpy/

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

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 Sandro Mani 2022-06-14 06:30:11 UTC
Build seems to have succeeded: https://koji.fedoraproject.org/koji/buildinfo?buildID=1982470