Consider dropping support for python 2

Issue #17 new
Botond Ballo repo owner created an issue

Having to interoperate between python 2 and python 3 is somewhat annoying.

Also, python 3 supports type hints (https://docs.python.org/3/library/typing.html) which python 2 doesn't.

It would be nice if we could drop support for python 2 and require python 3. Then we wouldn't have to worry about the interop, and could use type hints.

Comments (2)

  1. Botond Ballo reporter

    A few things I discovered while looking into this:

    • The python interpreter used by gdb is linked into the gdb executable (as opposed to calling out to a separate installation of python on the system).
      • That means the python version is baked in at the time gdb is built. It can't be modified at runtime by passing an argument to gdb.
    • rr replay is not actually a fork of gdb. It uses the gdb that's installed on your system. So, how rr itself is built does not matter.
    • When gdb is built with default flags, it seems to bundle the default python interpreter present on the system.
      • On recent Debian versions (8, 9), the default python interpreter is still python 2.
      • However, the version of gdb provided in the package repositories of these Debian versions bundles python 3 (evidently, the Debian gdb package is not built with default flags).
      • The reason I was using a version of gdb that came with python 2 on some of my machines, is that I was using a version of gdb that I built myself, with - you guessed it - the default flags.

    So, if we only cared about Debian, and we are willing to assume people don't build their own gdb (which they generally shouldn't need to), we could drop python 2 support without problems.

    Of course, I don't only care about Debian; I'd like to check the python versions of the gdb packages shipping in other major Linux distributions (and, once issue #4 is fixed, in macOS), before proceeding.

  2. Log in to comment