[PATCHv2 1-14/14] Re: Disabling Python Modules

Andrew Bartlett abartlet at samba.org
Tue Jan 31 06:10:00 UTC 2017


On Mon, 2017-01-30 at 14:11 -0500, Ian Stakenvicius wrote:
> On 30/01/17 01:44 PM, Andrew Bartlett wrote:
> > We seem to have moved off-list.  Can we move this back on-list?
> 
> Done.
> 
> 
> > On Mon, 2017-01-30 at 10:06 -0500, Ian Stakenvicius wrote:
> > > On 29/01/17 10:56 PM, Andrew Bartlett wrote:
> > > > 
> > > > With:
> > > > 
> > > > ./configure.developer  --picky-developer --
> > > > prefix=/tmp/b9407/prefix/samba-nopython  --with-profiling-
> > > > data  
> > > > --without-ad-dc --disable-python && make -j
> > > > 
> > > > I now get:
> > > > 
> > > > In file included from ../lib/replace/replace.h:32:0,
> > > >                  from ../dynconfig/dynconfig.c:41:
> > > > default/include/config.h:431:0: error: "PYTHONDIR" redefined [-
> > > > Werror]
> > > >  #define PYTHONDIR "/tmp/b9407/prefix/samba-
> > > > nopython/lib/python2.7/site-packages"
> > > >  
> > > > <command-line>:0:0: note: this is the location of the previous
> > > > definition
> > > > In file included from ../lib/replace/replace.h:32:0,
> > > >                  from ../dynconfig/dynconfig.c:41:
> > > > default/include/config.h:432:0: error: "PYTHONARCHDIR"
> > > > redefined [-
> > > > Werror]
> > > >  #define PYTHONARCHDIR "/tmp/b9407/prefix/samba-
> > > > nopython/lib64/python2.7/site-packages"
> > > >  
> > > 
> > > 
> > > RIGHT, now I recall why I had coded the
> > > SAMBA_CHECK_PYTHON_HEADERS()
> > > the way I did originally, it was so that deleting the defines
> > > would
> > > still happen regardless of whether the check was skipped.  The
> > > following should work, alternatively I can put it back to the way
> > > it
> > > was with most of the function wrapped by the conditional..
> > > 
> > > --- a/buildtools/wafsamba/samba_python.py
> > > +++ b/buildtools/wafsamba/samba_python.py
> > > @@ -47,6 +47,10 @@ def SAMBA_CHECK_PYTHON_HEADERS(conf,
> > > mandatory=True):
> > >                                   "--disable-python specified")
> > > 
> > >          conf.msg("python headers", "Check disabled due to
> > > --disable-python")
> > > +        # we don't want PYTHONDIR in config.h, as otherwise
> > > changing
> > > +        # --prefix causes a complete rebuild
> > > +        del(conf.env.defines['PYTHONDIR'])
> > > +        del(conf.env.defines['PYTHONARCHDIR'])
> > >          return
> > > 
> > >      if conf.env["python_headers_checked"] == []:
> > > 
> > 
> > My preference would be that the call is:
> > 
> > if not conf.env.disable_python:
> >         conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=True)
> > 
> > I didn't make a bother about it before as I really didn't want to
> > bikeshed you to death, but I don't think we should call
> > SAMBA_CHECK_PYTHON_HEADERS if we disable python.  
> > 
> > I'm OK with checking for the python interpreter: it might be handy,
> > or
> > it might just bite us later.  The main hope is that we bail early
> > before hitting future python 2.7 syntax in the remainder of the
> > build
> > system.
> > 
> 
> I don't think that would fix this particular issue, in fact I think
> avoiding the call to SAMBA_CHECK_PYTHON_HEADERS would cause the
> dynconfig problem to occur more rather than less.  The original
> version of my patch ensured that those calls to
> del(conf.env.defines['PYTHON*]) always occurred regardless of whether
> the header check(s) were being skipped, the issue you ran into was
> when they don't occur, which would happen if
> SAMBA_CHECK_PYTHON_HEADERS isn't called at all.

OK.  I'm happy to leave a further cleanup of this until later.

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