[PATCH] build: --picky-developer implies --enable-developer
Martin Schwenke
martin at meltin.net
Tue Oct 27 01:13:24 UTC 2015
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?
peace & happiness,
martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-build-picky-developer-implies-enable-developer.patch
Type: text/x-patch
Size: 1614 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20151027/c924088c/0001-build-picky-developer-implies-enable-developer.bin>
More information about the samba-technical
mailing list