[PATCH] gdb: prefere python3 if it is installed

Joel Sherrill joel at rtems.org
Thu Aug 19 17:16:19 UTC 2021


On Thu, Aug 19, 2021 at 11:51 AM Gedare Bloom <gedare at rtems.org> wrote:
>
> I have no problem with this. I think it is sensible to look for
> python3 before python2. At some point we'll have to stop looking for
> python2 :)

That is further in the future than I would have thought based on the
CentOS project changes. I still see user organizations with no plans
to move off CentOS 7. It will receive maintenance updates through
2024-06-30.

But on CentOS 7, I can load a Python 3.6, newer GCC, etc. so it isn't
that bad. I had to test something on a true 32-bit distribution this week
and even CentOS 7 (i386) wasn't as painful as I expected to setup.

--joel

> On Thu, Aug 19, 2021 at 3:24 AM Christian MAUDERER
> <christian.mauderer at embedded-brains.de> wrote:
> >
> > PS: I had the problem on the 5 branch of RTEMS source builder. I think
> > we should apply a patch to both: master and the 5 branch.
> >
> > Am 19.08.21 um 10:34 schrieb Christian Mauderer:
> > > More and more systems stop shipping python2. So we should start to
> > > prefer python3 over python2. For building gdb it is not only necessary
> > > to have a python binary installed, but also the matching python-devel
> > > packet. On a lot of hosts that will now be more often python3-devel
> > > and not python2-devel.
> > > ---
> > >
> > > Note: Please see that patch more as an suggestion / base for
> > > discussion. I'm open to better solutions.
> > >
> > > My problem that triggered this patch was a build of a toolchain on a
> > > github CI/CD system that has been originally set up by one of our
> > > users (see [1] for the log). It seems that on the "macos-latest"
> > > machines a python2 is installed but no python2 headers are found.
> > > Homebrew - which could be used earlier on MacOS to install the
> > > necessary headers - dropped the python at 2 packet. So it seems that on a
> > > modern MacOS there is no possibility to get python2 headers. If
> > > python2 is still installed on the machine (for whatever reason), it is
> > > not possible to successfully use RTEMS source builder to build a gdb.
> > > If python3 is preferred instead, that should solve the problem.
> > >
> > > Note that at the moment I only tried it on my OpenSUSE-Linux machine.
> > > For that I made sure that I have python2 and python3 installed but no
> > > python-devel (which is python2 on OpenSUSE). Earlier I know that I
> > > needed python-devel to build gdb. With this patch, I can build with
> > > only python3-devel.
> > >
> > > I'll try to add that patch to the CI too to see whether it works on
> > > MacOS. But I'm a bit unsure what other problems this patch could
> > > trigger and therefore I want to start a discussion early.
> > >
> > > Best regards
> > >
> > > Christian
> > >
> > > [1] https://github.com/grisp/grisp2-rtems-toolchain/runs/3362717606
> > >      Note: The "Get Errorinfo" step prints the rsb-report-*.txt
> > >
> > >
> > >   source-builder/config/gdb-common-1.cfg | 6 +++---
> > >   1 file changed, 3 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/source-builder/config/gdb-common-1.cfg b/source-builder/config/gdb-common-1.cfg
> > > index 397d44d..42fe263 100644
> > > --- a/source-builder/config/gdb-common-1.cfg
> > > +++ b/source-builder/config/gdb-common-1.cfg
> > > @@ -42,7 +42,7 @@
> > >   # 2. Does the version of gdb specify a version of python that must be
> > >   #    used. Override with '%define gdb-python-version python2'.
> > >   #
> > > -# 3. Search for 'python2' and if not found search for 'python3'.
> > > +# 3. Search for 'python3' and if not found search for 'python2'.
> > >   #
> > >   %if %{defined gdb-python2}
> > >     %define gdb-enable-python %{gdb_python2}
> > > @@ -53,9 +53,9 @@
> > >       %if %{defined gdb-python-version}
> > >         %define gdb-enable-python %(command -v %{gdb-python-version} || true)
> > >       %else
> > > -      %define gdb-enable-python %(command -v python2 || true)
> > > +      %define gdb-enable-python %(command -v python3 || true)
> > >         %if %{gdb-enable-python} == %{nil}
> > > -        %define gdb-enable-python %(command -v python3 || true)
> > > +        %define gdb-enable-python %(command -v python2 || true)
> > >         %endif
> > >         %if %{gdb-enable-python} == %{nil}
> > >             %define gdb-enable-python %(command -v python || true})
> > >
> >
> > --
> > --------------------------------------------
> > embedded brains GmbH
> > Herr Christian MAUDERER
> > Dornierstr. 4
> > 82178 Puchheim
> > Germany
> > email: christian.mauderer at embedded-brains.de
> > phone: +49-89-18 94 741 - 18
> > fax:   +49-89-18 94 741 - 08
> >
> > Registergericht: Amtsgericht München
> > Registernummer: HRB 157899
> > Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
> > Unsere Datenschutzerklärung finden Sie hier:
> > https://embedded-brains.de/datenschutzerklaerung/
> > _______________________________________________
> > devel mailing list
> > devel at rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list