Bug#951752: gcc-python-plugin FTBFS with python3.8
Package: gcc-python-plugin
Version: 0.17-5
Severity: serious
Tags: patch
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu focal ubuntu-patch
Hi Matthias,
gcc-python-plugin ftbfs with python3.8. Attached is the patch I've uploaded
to Ubuntu for this build failure.
Cheers,
--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer https://www.debian.org/
slangasek@ubuntu.com vorlon@debian.org
diff -Nru gcc-python-plugin-0.17/debian/patches/python3.8-compat.patch gcc-python-plugin-0.17/debian/patches/python3.8-compat.patch
--- gcc-python-plugin-0.17/debian/patches/python3.8-compat.patch 1969-12-31 16:00:00.000000000 -0800
+++ gcc-python-plugin-0.17/debian/patches/python3.8-compat.patch 2020-02-20 21:44:49.000000000 -0800
@@ -0,0 +1,40 @@
+Description: fix compatibility with Python 3.8
+ Python 3.8 changes the type of an element of the PyTypeObject struct
+ (https://www.python.org/dev/peps/pep-0590/) leading to compiler errors.
+Author: Steve Langasek <steve.langasek@ubuntu.com>
+Last-Update: 2020-02-20
+Forwarded: no
+
+Index: gcc-python-plugin-0.17/gcc-python-wrapper.c
+===================================================================
+--- gcc-python-plugin-0.17.orig/gcc-python-wrapper.c
++++ gcc-python-plugin-0.17/gcc-python-wrapper.c
+@@ -137,7 +137,11 @@
+ sizeof(PyGccWrapperTypeObject), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ NULL, /* tp_dealloc */
++#if PY_VERSION_HEX >= 0x03080000
++ 0, /* tp_vectorcall_offset */
++#else
+ NULL, /* tp_print */
++#endif
+ NULL, /* tp_getattr */
+ NULL, /* tp_setattr */
+ #if PY_MAJOR_VERSION < 3
+Index: gcc-python-plugin-0.17/cpybuilder.py
+===================================================================
+--- gcc-python-plugin-0.17.orig/cpybuilder.py
++++ gcc-python-plugin-0.17/cpybuilder.py
+@@ -254,7 +254,11 @@
+ result += ' sizeof(%(struct_name)s), /*tp_basicsize*/\n' % self.__dict__
+ result += ' 0, /*tp_itemsize*/\n'
+ result += self.c_ptr_field('tp_dealloc')
+- result += self.c_ptr_field('tp_print')
++ result += '#if PY_VERSION_HEX >= 0x03080000\n' % self.__dict__
++ result += ' 0, /*tp_vectorcall_offset*/\n' % self.__dict__
++ result += '#else\n' % self.__dict__
++ result += ' NULL, /*tp_print*/\n' % self.__dict__
++ result += '#endif\n' % self.__dict__
+ result += self.c_ptr_field('tp_getattr')
+ result += self.c_ptr_field('tp_setattr')
+ result += '#if PY_MAJOR_VERSION < 3\n' % self.__dict__
diff -Nru gcc-python-plugin-0.17/debian/patches/series gcc-python-plugin-0.17/debian/patches/series
--- gcc-python-plugin-0.17/debian/patches/series 2020-02-20 05:15:45.000000000 -0800
+++ gcc-python-plugin-0.17/debian/patches/series 2020-02-20 21:43:59.000000000 -0800
@@ -4,3 +4,4 @@
gcc-8-fix.diff
werror.diff
gcc-10.diff
+python3.8-compat.patch
Reply to: