boost fails to build with Python 3.10.0a2. In file included from /usr/include/python3.10/pytime.h:6, from /usr/include/python3.10/Python.h:85, from ./boost/python/detail/wrap_python.hpp:178, from ./boost/python/detail/prefix.hpp:13, from ./boost/python/object_core.hpp:10, from ./boost/python/object/enum_base.hpp:8, from libs/python/src/object/enum.cpp:6: libs/python/src/object/enum.cpp: In function 'boost::python::api::object boost::python::objects::{anonymous}::new_enum_type(const char*, const char*)': /usr/include/python3.10/object.h:140:29: error: lvalue required as left operand of assignment 140 | #define Py_TYPE(ob) _Py_TYPE(_PyObject_CAST_CONST(ob)) | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ libs/python/src/object/enum.cpp:156:11: note: in expansion of macro 'Py_TYPE' 156 | Py_TYPE(&enum_type_object) = incref(&PyType_Type); | ^~~~~~~ gcc.compile.c++ serial/boost/bin.v2/libs/python/build/gcc-10/release/debug-symbols-on/pch-off/python-3.10/threading-multi/visibility-hidden/object/class.o "g++" -fvisibility-inlines-hidden -fPIC -m64 -pthread -g -fvisibility=hidden -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-strict-aliasing -Wno-unused-local-typedefs -Wno-deprecated-declarations -DBOOST_ALL_NO_LIB=1 -DBOOST_PYTHON_SOURCE -DNDEBUG -I"." -I"/usr/include/python3.10" -c -o "serial/boost/bin.v2/libs/python/build/gcc-10/release/debug-symbols-on/pch-off/python-3.10/threading-multi/visibility-hidden/object/class.o" "libs/python/src/object/class.cpp" In file included from /usr/include/python3.10/pytime.h:6, from /usr/include/python3.10/Python.h:85, from ./boost/python/detail/wrap_python.hpp:178, from ./boost/python/detail/prefix.hpp:13, from libs/python/src/object/class.cpp:6: libs/python/src/object/class.cpp: In function 'PyObject* boost::python::objects::static_data()': /usr/include/python3.10/object.h:140:29: error: lvalue required as left operand of assignment 140 | #define Py_TYPE(ob) _Py_TYPE(_PyObject_CAST_CONST(ob)) | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ libs/python/src/object/class.cpp:211:11: note: in expansion of macro 'Py_TYPE' 211 | Py_TYPE(&static_data_object) = &PyType_Type; | ^~~~~~~ libs/python/src/object/class.cpp: In function 'boost::python::type_handle boost::python::objects::class_metatype()': /usr/include/python3.10/object.h:140:29: error: lvalue required as left operand of assignment 140 | #define Py_TYPE(ob) _Py_TYPE(_PyObject_CAST_CONST(ob)) | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ libs/python/src/object/class.cpp:319:11: note: in expansion of macro 'Py_TYPE' 319 | Py_TYPE(&class_metatype_object) = &PyType_Type; | ^~~~~~~ libs/python/src/object/class.cpp: In function 'PyObject* boost::python::objects::instance_new(PyTypeObject*, PyObject*, PyObject*)': /usr/include/python3.10/object.h:134:29: error: lvalue required as left operand of assignment 134 | #define Py_SIZE(ob) _Py_SIZE(_PyVarObject_CAST_CONST(ob)) | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ libs/python/src/object/class.cpp:378:15: note: in expansion of macro 'Py_SIZE' 378 | Py_SIZE(result) = | ^~~~~~~ libs/python/src/object/class.cpp: In function 'boost::python::type_handle boost::python::objects::class_type()': /usr/include/python3.10/object.h:140:29: error: lvalue required as left operand of assignment 140 | #define Py_TYPE(ob) _Py_TYPE(_PyObject_CAST_CONST(ob)) | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ libs/python/src/object/class.cpp:473:11: note: in expansion of macro 'Py_TYPE' 473 | Py_TYPE(&class_type_object) = incref(class_metatype().get()); | ^~~~~~~ libs/python/src/object/class.cpp: In static member function 'static void* boost::python::instance_holder::allocate(PyObject*, std::size_t, std::size_t)': /usr/include/python3.10/object.h:134:29: error: lvalue required as left operand of assignment 134 | #define Py_SIZE(ob) _Py_SIZE(_PyVarObject_CAST_CONST(ob)) | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ libs/python/src/object/class.cpp:742:9: note: in expansion of macro 'Py_SIZE' 742 | Py_SIZE(self) = holder_offset; | ^~~~~~~ ...failed updating 2 targets... error: Bad exit status from /var/tmp/rpm-tmp.oihGUt (%build) https://docs.python.org/3.10/whatsnew/3.10.html#id2 Since Py_TYPE() is changed to the inline static function, Py_TYPE(obj) = new_type must be replaced with Py_SET_TYPE(obj, new_type): see Py_SET_TYPE() (available since Python 3.9). For backward compatibility, this macro can be used: #if PY_VERSION_HEX < 0x030900A4 # define Py_SET_TYPE(obj, type) ((Py_TYPE(obj) = (type)), (void)0) #endif https://bugs.python.org/issue39573 For the build logs, see: https://copr-be.cloud.fedoraproject.org/results/@python/python3.10/fedora-rawhide-x86_64/01756932-boost/ For all our attempts to build boost with Python 3.10, see: https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/boost/ 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.10: https://copr.fedorainfracloud.org/coprs/g/python/python3.10/ Let us know here if you have any questions. Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10. 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.
I'm boosting (hehe) the severity of this one, since boost is quite needed by other packages.
*** Bug 1897076 has been marked as a duplicate of this bug. ***
There's a scratch build at https://koji.fedoraproject.org/koji/taskinfo?taskID=55558055 with the patch to use Py_SET_TYPE, which builds OK with Python 3.9 I'm also trying the same SRPM in copr with Python 3.10
That version built OK in rawhide, but not in copr using python 3.10 I've pushed a fixed version to rawhide dist-git now, but I haven't started a koji build. Can you pull from rawhide to test it with Python 3.10, or do I need to build it for rawhide too?
Thanks! The package should build automatically in https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/boost/ However, there was come copr outage/error. I'll trigger it manually.
*** Bug 1897494 has been marked as a duplicate of this bug. ***
*** Bug 1897583 has been marked as a duplicate of this bug. ***
*** Bug 1896383 has been marked as a duplicate of this bug. ***
OK, I think I should build it for rawhide now then.
https://bodhi.fedoraproject.org/updates/FEDORA-2020-0befd88d76
JFYI The change was reverted in Python 3.10, because it caused too much trouble (the amount of affected Fedora packages was too big). This comment is mass posted in all relevant bugzillas. If you already worked upstream to fix the problem, you might want to let them know about the revert, but the new way of doing things also works. Sorry for the trouble and thanks again for the fix. https://github.com/python/cpython/commit/0e2ac21dd
*** Bug 1896398 has been marked as a duplicate of this bug. ***