Re: sys/param.h
On Tue, Dec 18, 2012 at 6:01 PM, Junio C Hamano gits...@pobox.com wrote: Johannes Sixt j.s...@viscovery.net writes: Junio C Hamano wrote: It could turn out that we may be able to get rid of sys/param.h altogether, but one step at a time. Inputs from people on minority platforms are very much appreciated---does your platform build fine when the inclusion of the file is removed from git-compat-util.h? MinGW works fine with sys/param.h removed from git-compat-util.h. It seems that OpenBSD 5.2 does not mind it getting removed, either. Debian 5 and Debian 6 seem OK; so do Ubuntu 10.04 and 12.04. I have a hunch that Fedora or anything based on glibc would be fine, too. And just to be sure; Fedora 17: OK. -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: sys/param.h
On 12/19/2012 02:59 AM, Erik Faye-Lund wrote: On Tue, Dec 18, 2012 at 6:01 PM, Junio C Hamano gits...@pobox.com wrote: Johannes Sixt j.s...@viscovery.net writes: Junio C Hamano wrote: It could turn out that we may be able to get rid of sys/param.h altogether, but one step at a time. Inputs from people on minority platforms are very much appreciated---does your platform build fine when the inclusion of the file is removed from git-compat-util.h? cygwin is fine with that removed. Mark -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: sys/param.h
Thanks. -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
sys/param.h
Johannes Sixt j.s...@viscovery.net writes: Junio C Hamano wrote: It could turn out that we may be able to get rid of sys/param.h altogether, but one step at a time. Inputs from people on minority platforms are very much appreciated---does your platform build fine when the inclusion of the file is removed from git-compat-util.h? MinGW works fine with sys/param.h removed from git-compat-util.h. It seems that OpenBSD 5.2 does not mind it getting removed, either. Debian 5 and Debian 6 seem OK; so do Ubuntu 10.04 and 12.04. I have a hunch that Fedora or anything based on glibc would be fine, too. What other platforms do we care deeply about? -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFH/PATCH] git-compat-util.h: do not #include sys/param.h by default
Earlier we allowed platforms that lack sys/param.h not to include the header file from git-compat-util.h; we have included this header file since the early days back when we used MAXPATHLEN (which we no longer use) and also depended on it slurping ULONG_MAX (which we get by including stdint.h or inttypes.h these days). It turns out that we can compile our modern codebase just file without including it on many platforms (so far, Debian, Ubuntu, MinGW, HP-Nonstop, QNX and z/OS are reported to be OK). Let's stop including it by default, and on platforms that need it to be included, leave make NEEDS_SYS_PARAM_H=YesPlease as an escape hatch and ask them to report to us, so that we can find out about the real dependency and fix it in a more platform agnostic way. Signed-off-by: Junio C Hamano gits...@pobox.com --- * I'd propose queuing this on top of dm/port topic, cook it in 'next' for a while and then unleash it to the public. Makefile | 8 +--- configure.ac | 6 -- git-compat-util.h | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 5cd1de0..2c1f04f 100644 --- a/Makefile +++ b/Makefile @@ -167,7 +167,9 @@ all:: # Define NO_POLL if you do not have or don't want to use poll(). # This also implies NO_SYS_POLL_H. # -# Define NO_SYS_PARAM_H if you don't have sys/param.h. +# Define NEEDS_SYS_PARAM_H if you need to include sys/param.h to compile, +# *PLEASE* REPORT to git@vger.kernel.org if your platform needs this; +# we want to know more about the issue. # # Define NO_PTHREADS if you do not have or do not want to use Pthreads. # @@ -1747,8 +1749,8 @@ endif ifdef NO_SYS_POLL_H BASIC_CFLAGS += -DNO_SYS_POLL_H endif -ifdef NO_SYS_PARAM_H - BASIC_CFLAGS += -DNO_SYS_PARAM_H +ifdef NEEDS_SYS_PARAM_H + BASIC_CFLAGS += -DNEEDS_SYS_PARAM_H endif ifdef NO_INTTYPES_H BASIC_CFLAGS += -DNO_INTTYPES_H diff --git a/configure.ac b/configure.ac index e3ab6fe..8fbb533 100644 --- a/configure.ac +++ b/configure.ac @@ -699,12 +699,6 @@ AC_CHECK_HEADER([sys/poll.h], [NO_SYS_POLL_H=UnfortunatelyYes]) GIT_CONF_SUBST([NO_SYS_POLL_H]) # -# Define NO_SYS_PARAM_H if you don't have sys/param.h -AC_CHECK_HEADER([sys/param.h], -[NO_SYS_PARAM_H=], -[NO_SYS_PARAM_H=UnfortunatelyYes]) -GIT_CONF_SUBST([NO_SYS_PARAM_H]) -# # Define NO_INTTYPES_H if you don't have inttypes.h AC_CHECK_HEADER([inttypes.h], [NO_INTTYPES_H=], diff --git a/git-compat-util.h b/git-compat-util.h index d7359ef..a88147b 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -104,7 +104,7 @@ #endif #include errno.h #include limits.h -#ifndef NO_SYS_PARAM_H +#ifdef NEEDS_SYS_PARAM_H #include sys/param.h #endif #include sys/types.h -- 1.8.1.rc2.136.gb42b73a -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: sys/param.h
On 18.12.12 18:01, Junio C Hamano wrote: Johannes Sixt j.s...@viscovery.net writes: Junio C Hamano wrote: It could turn out that we may be able to get rid of sys/param.h altogether, but one step at a time. Inputs from people on minority platforms are very much appreciated---does your platform build fine when the inclusion of the file is removed from git-compat-util.h? MinGW works fine with sys/param.h removed from git-compat-util.h. It seems that OpenBSD 5.2 does not mind it getting removed, either. Debian 5 and Debian 6 seem OK; so do Ubuntu 10.04 and 12.04. I have a hunch that Fedora or anything based on glibc would be fine, too. What other platforms do we care deeply about? Mac OS X 10.6.8: OK -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/4] Support builds when sys/param.h is missing
David Michael fedora@gmail.com writes: On Fri, Dec 14, 2012 at 6:41 PM, Junio C Hamano gits...@pobox.com wrote: I have this suspicion that nobody would notice if we simply stopped including the header. While I'm not aware of any subtleties it could be causing on other platforms, it does seem fine to drop sys/param.h on my test GNU/Linux systems. I can resend the series and just remove the include, if preferred. I am sure the patch as posted is much safer, but I was hoping that folks on non-Linux platforms may say I tried to compile with the include removed, and I get identical binaries from before. Until that happens, I would prefer queuing your patch as-is. Thanks. -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/4] Support builds when sys/param.h is missing
An option is added to the Makefile to skip the inclusion of sys/param.h. The only known platform with this condition thus far is the z/OS UNIX System Services environment. Signed-off-by: David Michael fedora@gmail.com --- Makefile | 5 + configure.ac | 6 ++ git-compat-util.h | 2 ++ 3 files changed, 13 insertions(+) diff --git a/Makefile b/Makefile index 736ecd4..8c3a0dd 100644 --- a/Makefile +++ b/Makefile @@ -165,6 +165,8 @@ all:: # Define NO_POLL if you do not have or don't want to use poll(). # This also implies NO_SYS_POLL_H. # +# Define NO_SYS_PARAM_H if you don't have sys/param.h. +# # Define NO_PTHREADS if you do not have or do not want to use Pthreads. # # Define NO_PREAD if you have a problem with pread() system call (e.g. @@ -1748,6 +1750,9 @@ endif ifdef NO_SYS_POLL_H BASIC_CFLAGS += -DNO_SYS_POLL_H endif +ifdef NO_SYS_PARAM_H +BASIC_CFLAGS += -DNO_SYS_PARAM_H +endif ifdef NO_INTTYPES_H BASIC_CFLAGS += -DNO_INTTYPES_H endif diff --git a/configure.ac b/configure.ac index ad215cc..317bfc6 100644 --- a/configure.ac +++ b/configure.ac @@ -699,6 +699,12 @@ AC_CHECK_HEADER([sys/poll.h], [NO_SYS_POLL_H=UnfortunatelyYes]) GIT_CONF_SUBST([NO_SYS_POLL_H]) # +# Define NO_SYS_PARAM_H if you don't have sys/param.h +AC_CHECK_HEADER([sys/param.h], +[NO_SYS_PARAM_H=], +[NO_SYS_PARAM_H=UnfortunatelyYes]) +GIT_CONF_SUBST([NO_SYS_PARAM_H]) +# # Define NO_INTTYPES_H if you don't have inttypes.h AC_CHECK_HEADER([inttypes.h], [NO_INTTYPES_H=], diff --git a/git-compat-util.h b/git-compat-util.h index 2e79b8a..ace1549 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -104,7 +104,9 @@ #endif #include errno.h #include limits.h +#ifndef NO_SYS_PARAM_H #include sys/param.h +#endif #include sys/types.h #include dirent.h #include sys/time.h -- 1.7.11.7 -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/4] Support builds when sys/param.h is missing
David Michael fedora@gmail.com writes: An option is added to the Makefile to skip the inclusion of sys/param.h. The only known platform with this condition thus far is the z/OS UNIX System Services environment. Signed-off-by: David Michael fedora@gmail.com --- Hmm, makes me wonder if we can remove that inclusion everywhere instead. What definitions are we getting from it? 8695c8b (Add show-files command to show the list of managed (or non-managed) files., 2005-04-11) added it to show-files, and without the include the compilation failed due to lack of MAXPATHLEN, but you shouldn't be using that in the first place (we tend to either use PATH_MAX or lift the upper limit using strbuf these days.). 65bb491 (Add the ability to prefix something to the pathname to checkout-cache.c, 2005-04-21) does the same to checkout-cache.c to grab MAXPATHLEN. bb233d6 (Add support for a GIT_INDEX_FILE environment variable., 2005-04-21) moves these two inclusions to cache.h; removing it bteaks compilation due to lack of MAXPATHLEN, ULONG_MAX, etc., I didn't check what else sys/parms.h was accicdentally slurping into the compilation, but ULONG_MAX is what we explicitly ask for by including either inttypes or stdint these days. Later 4050c0d (Clean up compatibility definitions., 2005-12-05) further consolidated the headers by moving inclusion around. This commit did not audit unused headers. I have this suspicion that nobody would notice if we simply stopped including the header. -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/4] Support builds when sys/param.h is missing
Hi, On Fri, Dec 14, 2012 at 6:41 PM, Junio C Hamano gits...@pobox.com wrote: I have this suspicion that nobody would notice if we simply stopped including the header. While I'm not aware of any subtleties it could be causing on other platforms, it does seem fine to drop sys/param.h on my test GNU/Linux systems. I can resend the series and just remove the include, if preferred. Thanks. David -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html