[PATCH] build: don't execute statfs and f_fsid checks

Andrew Bartlett abartlet at samba.org
Tue Feb 11 11:06:20 MST 2014


Jeremy,

Can you help me find a way out of this challenge?

That is, when we moved to WAF, a number of configure checks were brought
over 'as is', yet many may not actually need to be executed.  It is hard
to know why these were being run in autoconf - some go back so far into
history that I can't even find the initial commit.

My only thought is to try and remove the execute=True, and then run it
on Linux and FreeBSD and check for differences.  What other platforms do
we need to check here?  What standard should we apply when relaxing the
requirement here?

In short, I'm not confident to relax the checks without some backing
from someone with your level of history in the file server :-)

Thanks,

On Fri, 2014-02-07 at 16:12 -0300, Gustavo Zacarias wrote:
> On 02/07/2014 03:25 PM, Andrew Bartlett wrote:
> 
> > RETURN VALUE
> >        On success, zero is returned.  On error, -1 is returned, and
> > errno is set appropriately.
> > 
> >> Nobody knows what f_fsid is supposed to contain (but see below).
> > 
> > Sure, it isn't a firm standard, but where the behaviour is known, it is
> > well known. 
> 
> For f_fsid the test is doing nothing with it, so there's no need to
> execute it.
> And for statfs you're basically checking that it works by executing it,
> the only caveat i can think of is some unix having a broken statfs where
> you'd want to execute the test but it would seem very odd for such a
> common syscall.
> The BSDs seem to use a different structure according to the manpage,
> FreeBSD says:
> http://www.freebsd.org/cgi/man.cgi?query=statfs&sektion=2
> but it's definitely compatible with the test as it is so it'll give the
> same result.
> 
> > Yes, but please do not take any comfort from that.  I would have very
> > little comfort in the accuracy of the the choice of cross-compile
> > default in our autoconf tests.  I say this because while this may be the
> > exception, the typical pattern was to just copy the last similar test,
> > and modify it.  It can't be easily shown that whoever wrote this test
> > considered this carefully.  (The same often applied to the choice of
> > compile/run).
> 
> The statfs.f_fsid check will fail if there's none irrespective of
> executing it.
> 
> > Adding the the confusion, I added
> > 2a4eaa3241fc4ccb79359ea4e4d511754a84d46b only recently, with
> > execute=True, in order to make the FreeBSD build match the waf build.  
> 
> Ouch!
> But you don't need to execute that, the compiler will bail out with an
> error ‘struct statfs’ has no member named ‘f_iosize' on linux.
> There are many other tests that can probably be modified to work with
> Execute=false, i didn't do a complete audit, i've just "fixed" the ones
> that weren't responsive to the answers cache.
> Regards.
> 

-- 
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