On Thu, 8 Mar 2018 16:36:12 +0000
Markos Chandras <[email protected]> wrote:

> Hi Timothy,
> 
> On 08/03/18 16:15, Timothy Redaelli wrote:
> > This patch tries to find Python 2 as "python2", then "python2.7"
> > and finally "python".
> > 
> > This is needed since "/usr/bin/python" is used as Python 3 on some
> > Linux distributions (for example on Arch Linux) and on Fedora 28
> > "/usr/bin/python" will be deprecated [1]:
> >     "All scripts shall explicitly use /usr/bin/python2."
> > 
> > [1] https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
> > 
> > Signed-off-by: Timothy Redaelli <[email protected]>
> > ---  
> 
> So if I understand this correctly, in Fedora 28 and Arch Linux,
> /usr/bin/python will actually be the python3 interp right? Why not
> extend the macro then to also look for python3 and python3.5 python3.4
> if no python2 or python exists? In openSUSE tumbleweed, there is no
> python2, python2.X or python if you only have python3 installed so you
> are only left with /usr/bin/python3 and /usr/bin/python3.X
> 
> Would you be able to amend your patch to look for these additional
> python strings?
> 

Hi,
Arch Linux already have /usr/bin/python => python3.6 and from Fedora
28 /usr/bin/python MUST not be used directly in scripts.
Using /usr/bin/python will emit a big warning in stderr and many tests
will fail due to how autotest works.

In our Fedora spec file I workarounded it by setting the PYTHON
environment variable to /usr/bin/python2 [1], but any time an user wants
to build OVS on Fedora 28+ it must set the PYTHON variable
to /usr/bin/python2 until this commit is approved.

Currently, I'm working on some other patches/patchsets in order to
permit to build OVS when you only have python3 installed.

So this commit is only the first step since, currently, it's not
possible to build (and test) OVS with only python3 installed since the test
after my modification (inside OVS_CHECK_PYTHON) already check that the
python version is >= 2.7 < 3.0 and this is needed since this python
binary is also used launch some Python2 tests (make check).

Python 3 is found in the OVS_CHECK_PYTHON3 function that, currently,
only checks for "python3" and "python3.4" and, I think, we should add
also "python3.6" here. But it'll be another unrelated patchset.

[1]
https://src.fedoraproject.org/rpms/openvswitch/blob/master/f/openvswitch.spec#_325

-- 
Timothy Redaelli
Software Engineer
Red Hat Italia
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to