This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: GDB fails to build with Python 3.7
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Phil Muldoon <pmuldoon at redhat dot com>, Paul Koning <pkoning at equallogic dot com>
- Cc: "gdb at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Wed, 30 May 2018 15:26:29 -0700
- Subject: Re: GDB fails to build with Python 3.7
- References: <5e55cd3c-7ccd-4cce-5297-ddddadf91975@redhat.com>
Hi Paul,
> Currently GDB fails to build with Python 3.7
>
> https://bugs.python.org/issue33470
>
> This is because we use an internal Python API:
>
> #ifdef IS_PY3K
> gdb_module = PyModule_Create (&python_GdbModuleDef);
> /* Add _gdb module to the list of known built-in modules. */
> _PyImport_FixupBuiltin (gdb_module, "_gdb");
> #else
> gdb_module = Py_InitModule ("_gdb", python_GdbMethods);
> #endif
>
> (the _PyImport_FixupBuiltin in python.c).
>
> This internal API has been changed. According to the advice of the Python
> maintainers we should never have used it in the first place. I didn't
> add this (at least I don't think I did!), so I'm asking whomever
> authored that code to please change it to be 3.7 compatible. I'm not
> sure what the code achieves so I'm reluctant to touch it in case of
> breakages on platforms I don't have easily access to.
>From what I can tell, this was was introduced when you added
Python 3.x support, back in 2012:
commit 9a27f2c60d760a95a27e336750f26f69f91dd156
Date: Wed Dec 12 16:47:30 2012 +0000
Subject: Add support for Python 3
Do you remember why you added that _PyImport_FixupBuiltin call?
If not, I suggest we just remove it and re-run the testsuite.
If we find regressions, then we'll have our answer. If we don't,
let's just remove the code, and see whether anyone finds something.
--
Joel