Samba and Python2

Andrew Bartlett abartlet at samba.org
Thu Feb 14 08:15:40 UTC 2019


On Thu, 2019-02-14 at 08:59 +0100, Stefan Metzmacher via samba-
technical wrote:
> Am 14.02.19 um 05:13 schrieb Tim Beale via samba-technical:
> > 
> > I've attached an updated patch-set to drop the py2 jobs from CI
> > (.gitlab-ci.yml just got substantially reworked in master).
> > 
> > New CI link: https://gitlab.com/samba-team/devel/samba/pipelines/47
> > 451100
> > 
> > On 13/02/19 4:31 PM, Tim Beale via samba-technical wrote:
> > > 
> > > Hi,
> > > 
> > > Just following up on this. How about something like the
> > > following? It
> > > tries to merge what was discussed with what was already in the
> > > WHATSNEW.
> > > 
> > > python3 support
> > > ---------------
> > > This is the first release of Samba which has full support for
> > > Python 3.
> > > Samba 4.10 still has support for Python 2, however, Python 3 will
> > > be used by
> > > default, i.e. 'configure' & 'make' will execute using python3.
> > > 
> > > To build Samba with python2 you *must* set the 'PYTHON'
> > > environment variable
> > > for both the 'configure' and 'make' steps, i.e.
> > >    'PYTHON=python2 ./configure'
> > >    'PYTHON=python2 make'
> > > This will override the python3 default.
> > > 
> > > Alternatively, it is possible to produce Samba Python bindings
> > > for both
> > > Python 2 and Python 3. To do so, specify '--extra-
> > > python=/usr/bin/python2'
> > > as part of the 'configure' command. Note that python3 will still
> > > be used as
> > > the default in this case.
> > > 
> > > Note that Samba 4.10 supports Python 3.4 onwards.
> > > 
> > > Future Python support
> > > ---------------------
> > > Samba 4.10 will be the last release that comes with support for
> > > Python 2.
> > > Unfortunately, the Samba Team doesn't have the resources to
> > > support both
> > > Python 2 and Python 3 long-term.
> > > 
> > > Samba 4.11 will not have any support for Python 2. This means if
> > > you use
> > > Python 2 bindings it is time to migrate to Python 3 now.
> I think we should make it clear that Python 2 and also any Python 3
> version would be enough to build --without-python.

We currently have some text for that, and I tried with Tim to draft up
an explanation of what is and is not supported on python2.  

Even first defining, then using, the terms build time and runtime, it
just ended up in a confusing mess that detracted from the message that
we are moving to Python3.

> > 
> > > 
> > > Also note that Samba 4.11 will only support Python 3.6 onwards.
> I'd say '... will most likely only support ...'

That works for me.

It might be a bit subtle, but I see some opportunity for a useful gap
between what we announce and what may or may not we end up doing.  

The same goes for the python2 waf support, we could agree here to keep
it working and in autobuild, but keep our options open by telling our
users they need to move to python3.

> We should actually try to keep 3.4+ (or at least 3.5+) as long as we
> can. E.g. Ubuntu 16.04 uses 3.5.2 and I'm pretty sure it will be
> security updates even if 3.5 is no longer supported upstream.
> Debian jessie only has 3.4.2 and stretch 3.5.3.
> 
> If we really make use of new async/await in important code sections
> we can discuss it again.
> 
> I think samba-nopython-py should not be different than samba-
> nopython.
> Can't we just keep the magic '-py2' handling for that?

It was a glorious hack but I'll be glad to see the magic -py2 stuff go
away in favour of simplicity and readability. 

> I think we should also add some basic tests to it, instead of just
> compiling it.

Do you have any ideas how should we test it?  We don't want to keep
bindings around for py2 but without it 'make test' isn't going to get
very far.

Personally I think that is the single best argument to just switch,
realising that some will need to install python3 to build Samba and
understanding that this wasn't what was previously agreed.

Better ideas are most welcome.

Andrew Bartlett

-- 
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba






More information about the samba-technical mailing list