[Samba] Samba4 with python2.7 and python3

Ng Oon-Ee ngoonee at gmail.com
Wed Jan 12 03:05:12 MST 2011


On Wed, 2011-01-12 at 20:52 +1100, Andrew Bartlett wrote:
> > On 12 January 2011 01:23, Ng Oon-Ee <ngoonee at gmail.com> wrote:
> > > Hi all,
> > >
> > > Arch Linux (a rolling release distro) has updated to python3 a while
> > > back. python2 is still installed in parallel, but part of the
> > > ramifications of this move is the following:-0
> > > 1. /usr/bin/python points to /usr/bin/python3 instead of /usr/bin/python2
> > > 2. /usr/bin/python-config points to /usr/bin/python3-config instead of
> > > /usr/bin/python2-config
> > >
> > > I'm having problems with make for samba4 (am installing it to be able
> > > to install openchange->evolution-mapi. Initial problems were simply
> > > that various scripts don't reference the PYTHON env variable, so I ran
> > > a sed as follows:-
> > >  sed -i -e "s|/usr/bin/env python$|/usr/bin/env python2|" \
> > >         -e "s|python-config|python2-config|" \
> > >         -e "s|bin/python|bin/python2|" \
> > >    $(find ${samba-4.0.0alpha13 -type f)
> > >
> > > This gets me all the way past configure, but now I have this error:-
> > >
> > > 'configure' finished successfully (29.915s)
> > > WAF_MAKE=1 ../buildtools/bin/waf build
> > > Waf: Entering directory
> > > `/var/abs/local/aur/samba4/src/samba-4.0.0alpha13/source4/bin'
> > > Checking project rules ...
> > > Project rules pass
> > > Waf: Leaving directory
> > > `/var/abs/local/aur/samba4/src/samba-4.0.0alpha13/source4/bin'
> > > find_or_declare found a source file where a build file was expected
> > > 'lib/Parse/Pidl/IDL.pm'
> > > make: *** [all] Error 1
> > >    Aborting...
> > 
> > I can't find where that message is printed.
> 
> My best guess is that this is caused by pidl regenerating some of it's
> files after the rules where changed by your sed script. 
> 
> First try again with the current GIT tree, and then let's see if we can
> some up with a sensible way to handle this.  What is the right way to
> find python 2.6 on all systems?  What is done for other packages - Samba
> must not be the only software not yet to move to python3?
> 
> Andrew Bartlett
> 
Apologies, but as I mentioned I'm compiling samba4.0.0alpha13
specifically (instead of current alpha14) because that's what is
required by openchange.

With regards to your response, I'll try to refine my simple sed to avoid
the files there (specifically, I should only touch .py files and various
other specific files like configure.ac).

Also, we're on python2.7, which is not much of a difference from 2.6 for
this issue of course.

Most other software (that I know of, which isn't very many) simply
respect the PYTHON env variable. In Arch there's quite a few that don't,
and require various sed scripts of this sort. Chromium is an example of
another software that doesn't respect PYTHON fully and requires
symlinking (that I know off, from hearsay).



More information about the samba-technical mailing list