Bug 8576 - Feature request: option for WAF to ignore unknown options
Feature request: option for WAF to ignore unknown options
Status: NEW
Product: Samba 4.0
Classification: Unclassified
Component: Build
unspecified
All Linux
: P5 enhancement
: ---
Assigned To: Andrew Tridgell
samba4-qa@samba.org
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-04 16:17 UTC by Stephen Gallagher
Modified: 2012-05-04 08:32 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen Gallagher 2011-11-04 16:17:23 UTC
Some build systems (such as Fedora) specifies certain configure arguments that WAF does not understand (e.g. --disable-silent-rules). As a result, the configure script (and subsequent build) fails.

WAF should just ignore unknown configure flags instead of treating them as a failure.
Comment 1 Stefan Metzmacher 2011-11-05 09:01:19 UTC
I think it's on advantage that waf doesn't ignore unknown options.
You can filter the option in the spec file.
Comment 2 Stephen Gallagher 2011-11-07 14:01:35 UTC
(In reply to comment #1)
> I think it's on advantage that waf doesn't ignore unknown options.
> You can filter the option in the spec file.

It's extremely non-trivial to filter it out in the spec file. The packaging guidelines for Fedora require using the %configure macro because it makes it possible for the default configure options to be changed/fixed with a trivial rebuild, rather than requiring packager intervention (if for a contrived example the decision was made to change to using /usr/local as a prefix or something).


For what it's worth, I think the addition of this autotools-specific option was a mistake and I have https://bugzilla.redhat.com/show_bug.cgi?id=744766 open to address it.

However, I think this is likely to be an issue for other packagers in the future as well. At minimum, please allow an extra tolerance flag like (--ignore-unknown) to be passed.
Comment 3 Stefan Metzmacher 2011-11-07 14:35:57 UTC
adding a --ignore-unknown sounds useful, do you want to provide a patch?
Comment 4 Stephen Gallagher 2011-11-07 15:16:25 UTC
(In reply to comment #3)
> adding a --ignore-unknown sounds useful, do you want to provide a patch?

I took a look at the WAF upstream sources. I think that writing this patch is beyond my capabilities at this time. Here's what I learned, though: WAF uses python's optparse library to split the command-line into two categories: options and commands. So all recognized options become 'option' objects, and the remains are passed to WAF as commands (in the same way that 'configure' and 'build' are commands; perhaps 'targets' would be a better term).

So I think what would need to be done is adding a new default option --ignore-unknown that would set a global variable that would result in unknown options that cannot be executed as commands to be reported as warnings and ignored, rather than errors aborting the configuration.
Comment 5 ita 2011-11-07 17:29:41 UTC
Stephen Gallagher: such an abomination will not go in Waf. But feel free to hack the optparse module for Fedora.
Comment 6 Jeremy Allison 2011-11-07 17:42:19 UTC
ita. Fedora and Red Hat are essential partners to the Samba project. We need to make our build system work for them in order to be useful at all.

Stephen, would a wrapper that can strip out unknown options before they get passed to waf help here ?

Jeremy.
Comment 7 Jelmer Vernooij 2012-02-24 15:31:18 UTC
Is this really a release blocker?
Comment 8 Stephen Gallagher 2012-02-24 15:34:10 UTC
(In reply to comment #7)
> Is this really a release blocker?

I'd say no. The original issue that spawned this was that the Fedora and RHEL build-systems changed their "configure" macro to include "--disable-silent-rules", which WAF did not support. We have subsequently worked around the problem by adding --disable-silent-rules as a do-nothing option in WAF.
Comment 9 Jelmer Vernooij 2012-02-24 15:38:16 UTC
Thanks, Stephen. I guess you guys are still interested in adding this in case there are other options specified in the future, but I'll reduce the importance.
Comment 10 Matthias Dieter Wallnöfer 2012-05-04 08:32:19 UTC
This is more like a feature request, than a bug.