#3537 closed defect (fixed)

RSB and RTEMS Tools Support for python2 and python3

Reported by: Chris Johns Owned by: Chris Johns
Priority: high Milestone: 5.1
Component: tool Version: 5
Severity: blocker Keywords:
Cc: Blocked By:
Blocking:

Description

Upstream python does not create a python command any more and creates python2 and python3. Distributions and operating systems are starting to ship without the python command.

The RSB and RTEMS Tools python commands need to be updated and tested so they run on Python2 and Python3 and support added to use the available commands.

Change History (12)

comment:1 Changed on Oct 4, 2018 at 5:55:01 AM by Sebastian Huber

Do we have a host platform without python3 support? If not, then I would simply use python3 and stop using python/python2.

comment:2 in reply to:  1 Changed on Oct 4, 2018 at 6:30:58 AM by Chris Johns

Replying to Sebastian Huber:

Do we have a host platform without python3 support? If not, then I would simply use python3 and stop using python/python2.

In time we will need to switch to python3 however I am not in a position to go over all the code and do this. I think it also makes things difficult or at least more complicated for users with established environment to get such a hard error. We should consider a softer landing if this is possible.
I am considering moving to a shell script that checks for python2 then python3 and if not found outputs a user friendly error message. The existing code is moved into the python directories run from the python command line. Once we are happy with python3 we can switch the order we check.
A script would let us add an environment variable we could use to force a version to test with without needing symlinks etc.

comment:3 Changed on Oct 4, 2018 at 6:40:08 AM by Sebastian Huber

I think we already have a fairly good Python 3 support, since on a recent msys2 there is no Python 2 available?

One issue is probably the RTEMS Tester. We had some difficulties with the TFTP Server:

https://github.com/msoulier/tftpy/pull/94

The latest tftpy seems to work only with Python 3.5, but not 3.4.

comment:4 in reply to:  3 Changed on Oct 4, 2018 at 7:21:09 AM by Chris Johns

Replying to Sebastian Huber:

I think we already have a fairly good Python 3 support, since on a recent msys2 there is no Python 2 available?

I agree we seem to be in good shape so this is not about our code or even the developer set ups. I am concerned about user set ups and considering the effect on them.

Also, will there be a python4, if so do we go through all this again?

One issue is probably the RTEMS Tester. We had some difficulties with the TFTP Server:

https://github.com/msoulier/tftpy/pull/94

The latest tftpy seems to work only with Python 3.5, but not 3.4.

Hmmm.

comment:5 Changed on Oct 12, 2018 at 4:48:06 PM by Chris Johns

Severity: normalblocker

We need this working for a release.

comment:6 Changed on Oct 19, 2018 at 12:21:47 AM by Chris Johns

Status: assignedaccepted

comment:7 Changed on Oct 21, 2018 at 12:02:49 AM by Chris Johns <chrisj@…>

In 13f4c37/rtems-source-builder:

sb: Add support to search for a suitable version of python.

The command python has been removed from upstream python and python2
and python3 is now used. This patch wraps the commands in a shell
script that locates a suitable python to run.

Updates #3537

comment:8 Changed on Oct 24, 2018 at 10:46:06 AM by Chris Johns <chrisj@…>

In e2209fa/rtems-source-builder:

sb: Fix rtems-build-dep to handle various issues

  • Remove CR characters on Windows.
  • Force the compiler to output English so the pattern matching works.

Updates #3537.

comment:9 Changed on Oct 24, 2018 at 6:42:23 PM by Joel Sherrill <joel@…>

In 0794cc3/rtems-source-builder:

rtems-build-dep: Add support for Cygwin

updates #3537.

comment:10 Changed on Nov 8, 2018 at 10:58:32 PM by Chris Johns <chrisj@…>

Resolution: fixed
Status: acceptedclosed

In e058db0/rtems-tools:

python: Provide support to select a valid python version.

  • Update imports after wrapping the code.
  • Fix python3 issues.
  • Fix config path issues for in repo and install runs.

Closes #3537

comment:11 Changed on Dec 17, 2018 at 11:59:24 PM by Chris Johns

Resolution: fixed
Status: closedreopened

Support for python-config needs to be added. FreeBSD 11.2-RELEASE-p5 has:

$ find /usr/local/ -name Python.h
/usr/local/include/python3.6m/Python.h

Notice the m in the path. The python-config command gives:

$ python3-config --includes
-I/usr/local/include/python3.6m -I/usr/local/include/python3.6m

The RSB should detect and use a suitable the python-config command to find the include paths and to use those paths before looks at default paths.

comment:12 Changed on Dec 25, 2018 at 1:15:53 AM by Chris Johns <chrisj@…>

Resolution: fixed
Status: reopenedclosed

In 257c926/rtems-source-builder:

gdb/python: Use python-config for the configuration if found.

  • Do not assume the installed paths for the header and library. Ask python-config if found.

Close #3537.

Note: See TracTickets for help on using tickets.