Wireshark-dev: Re: [Wireshark-dev] Wireshark seems to require Python 3.4 or better now ...
From: Richard Sharpe <realrichardsharpe@xxxxxxxxx>
Date: Sat, 10 Nov 2018 14:05:22 -0800
On Sat, Nov 10, 2018 at 1:42 PM Peter Wu <peter@xxxxxxxxxxxxx> wrote:
>
> On Sat, Nov 10, 2018 at 01:17:22PM -0800, Richard Sharpe wrote:
> > > > Like Pascal said, clearing PYTHON_EXECUTABLE from your CMakeCache.txt
> > > > was sufficient (you do not have to wipe the full build directory). The
> > > > default /usr/bin/python interpreter is Python 2.7, but CMake will now
> > > > search for python3 first and use that if it is new enough.
> > >
> > > Well, I tried doing that also, but no luck. It insists that python
> > > 2.7.5 is unsuitable ...
> >
> > The correct instructions seem to be to modify the PYTHON_EXECUTABLE
> > line in CMakeCache.txt to the following (or whatever version you have
> > on the system):
> >
> > PYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3.6
>
> Looks like the find_package(PythonInterp) call is only looking for
> 'python3' which is included with the python34 package:
> https://centos.pkgs.org/7/epel-x86_64/python34-3.4.9-1.el7.x86_64.rpm.html
>
> Using find_package(Python3) instead will correctly identify python3.6,
> but this package is not available with older CMake versions...

When you say older CMake versions do you mean older than cmake3? I
already have to use cmake3 (3.12.2) on CentOS.

Curiously, as well, on the Ubuntu VM I just tested things on:

  Linux version 4.15.0-33-generic (buildd@lcy01-amd64-024) (gcc
version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #36-Ubuntu SMP Wed Aug 15
16:00:05 UTC 2018

but which also calls itself Buster/Sid (/etc/debian-release), the
change I suggested works but it did not find /usr/bin/python3.6
despite that binary being there. It found /usr/bin/python which calls
itself 2.7.15rc1.

I also notice that the setup file for Mac OS X requires Python 3.7.1
and wonder if that will be found with my change. Not sure I want to
bother testing the Mac.

> As for why Python 2.7 is unsuitable, Python 3 has been around for a
> while and reduces maintenance costs for development, see
> https://www.wireshark.org/lists/wireshark-dev/201810/msg00067.html

Sure. I don't have a problem with the requirement to use Python 3.
It's just that some/many systems have both Python2 and Python3
installed (Python2 for legacy reasons) and I would like the Wireshark
build to find the correct version. It wasn't doing that on CentOS 7.x.

I also have a RHEL7.2 VM with Python3.4.x in /usr/local. I wonder if
it would find that.

-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)(传说杜康是酒的发明者)