[PATCH] build: --picky-developer implies --enable-developer
Andrew Bartlett
abartlet at samba.org
Tue Oct 27 01:29:05 UTC 2015
On Tue, 2015-10-27 at 12:13 +1100, Martin Schwenke wrote:
> On Mon, 26 Oct 2015 20:47:43 +0200, Uri Simchoni <uri at samba.org>
> wrote:
>
> > On 10/26/2015 11:27 AM, Martin Schwenke wrote:
> > > I first met this back in March when I used --picky-developer on
> > > its own and managed to push something that wouldn't pass
> > > autobuild. I
> > > never forget (or my inbox never does)... so how about the
> > > following? :-)
> > >
> > > Have --picky-developer do the --enable-developer setup too,
> > > instead of
> > > requiring both options to be specified. This makes it obey
> > > the
> > > principle of least surprise.
> > >
> > > This seems to work fine without the extra "if not
> > > Options.options.developer:"
> > > but I think having it there makes things clearer...
> > >
> > > Review and push appreciated...
> > >
> > > peace & happiness,
> > > martin
> > > if Options.options.picky_developer:
> > > + if not Options.options.developer:
> > > + setup_developer(conf)
> > Seems like this is not 100% equivalent to --enable-developer
> > --picky-developer, because there are other places in some wscripts
> > that
> > Options.options.developer is checked. It would be safer to set
> > Options.options.developer if picky_developer is set, but we have to
> > do
> > it early enough, and without modifying the core waf code.
> >
> > If we can't find a place that's provably early enough, then maybe
> > we can
> > have a function which checks either flag, and then replace all
> > references to options.developer with this function.
>
> Yeah, you're right. That was a cheap and nasty effort. :-(
>
> The sane way of doing this is in the actual option handling. I tried
> this last night but made this mistake:
>
> https://stackoverflow.com/questions/2620637/pb-with-callback-in-the
> -python-optparse-module
>
> The error message was so bad that I thought I had a scoping issue (or
> similar) and that solving it would be insane. I tried it again this
> morning before asking a search engine. As it turns out, if Python
> printed a nice message like "callback must not be a string" then I
> wouldn't have tried other insane things.
>
> How about the attached patch?
That looks much better.
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
Andrew Bartlett
--
Andrew Bartlett
https://samba.org/~abartlet/
Authentication Developer, Samba Team https://samba.org
Samba Development and Support, Catalyst IT
https://catalyst.net.nz/services/samba
More information about the samba-technical
mailing list