[PATCH] gdb: prefere python3 if it is installed

Chris Johns chrisj at rtems.org
Fri Aug 20 01:49:47 UTC 2021


On 20/8/21 3:16 am, Joel Sherrill wrote:
> 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.

There will come a time when a change made cannot be easily tested by us on
python2 and that will in effect end our support. We are not there yet.

>> 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.

I have just built the latest RSB master GDB on a fully updated MacOS (Big Sur):

config: tools/rtems-gdb-10.cfg
package: arm-rtems6-gdb-7ab567f-x86_64-apple-darwin20.1.0-1
building: arm-rtems6-gdb-7ab567f-x86_64-apple-darwin20.1.0-1
sizes: arm-rtems6-gdb-7ab567f-x86_64-apple-darwin20.1.0-1: 629.086MB (installed:
19.586MB)
cleaning: arm-rtems6-gdb-7ab567f-x86_64-apple-darwin20.1.0-1
reporting: tools/rtems-gdb-10.cfg ->
arm-rtems6-gdb-7ab567f-x86_64-apple-darwin20.1.0-1.txt
reporting: tools/rtems-gdb-10.cfg ->
arm-rtems6-gdb-7ab567f-x86_64-apple-darwin20.1.0-1.xml

I support the latest MacOS with Xcode and have a dedicated Mac machine that
tracks the current RSB. It had wedged itself and I have cleared that so it is
now building the latest.

>>>> Homebrew - which could be used earlier on MacOS to install the
>>>> necessary headers - dropped the python at 2 packet. 

Homebrew and MacPorts are a personal choice and I am fine with users heading
down this path however it is beyond this project's scope to support those
frameworks. I have posted the reasons in the past and the MacPorts maintainers
are aware of those reasons.

>>>> So it seems that on a
>>>> modern MacOS there is no possibility to get python2 headers.

As I have just built GDB this does not appear to be true. I would prefer we do
not overreach until we all agree there is a problem. If there is an issue I
would raise the problem in Apple'd developer bug system. I have raised a number
of issues over the years and to Apple's credit they have dealt with them all.

>>>> 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.

The change seems sensible.

>>>> 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

I am looking forward to their hardware being shipped.

Chris


More information about the devel mailing list