[PATCH 1 of 3] setup: use a more strict way to test BSD or OSX's statfs

Jun Wu quark at fb.com
Fri Mar 24 13:05:48 EDT 2017


I think "cancompile" is cleaner - you can check headers, functions, fields
together.

The current code will actually break if the system has "statfs" but does not
have a "struct statfs" in the header files we checked. So I plan to make the
linux statfs check explicit, by removing checking for "statfs" function,
linux headers, and adding a "cancompile" check for Linux.

Excerpts from David Soria Parra's message of 2017-03-24 10:01:14 -0700:
> On Thu, Mar 23, 2017 at 10:32:52PM -0700, Jun Wu wrote:
> > # HG changeset patch
> > # User Jun Wu <quark at fb.com>
> > # Date 1490332536 25200
> > #      Thu Mar 23 22:15:36 2017 -0700
> > # Node ID 597a29c947fe2b9f9ac0a6a03cf710ab9f69757c
> > # Parent  2c02bb7fd7fc1212029dc903527e35a9efb7dbe1
> > # Available At https://bitbucket.org/quark-zju/hg-draft 
> > #              hg pull https://bitbucket.org/quark-zju/hg-draft  -r 597a29c947fe
> > setup: use a more strict way to test BSD or OSX's statfs
> > 
> > We want to use the `f_fstypename` field to get the filesystem type. Test it
> > directly. The new macro HAVE_BSD_STATFS implys the old HAVE_SYS_MOUNT_H and
> > HAVE_SYS_PARAM_H. So the latter ones are removed.
> > 
> 
> I think the series is good. I wonder if it makes sense to have a more generic
> hasmember() function in setup.py. I have a patch for that as I was working on
> ZFS and UFS detection myself.


More information about the Mercurial-devel mailing list