{"thread":{"id":"5570","subject":"[PATCH] Build on Debian GNU/Hurd","startedAt":"2006-09-15T12:58:46Z","lastAt":"2006-09-22T17:22:21Z","messageCount":7,"participants":["Gerrit Pape","Martin Waitz","Junio C Hamano","Ramsay Jones","Linus Torvalds"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"26968","messageId":"20060915125846.10469.qmail@ccc765dd61a02d.315fe32.mid.smarden.org","threadId":"5570","inReplyTo":null,"subject":"[PATCH] Build on Debian GNU/Hurd","fromName":"Gerrit Pape","fromEmail":"pape@smarden.org","sentAt":"2006-09-15T12:58:46Z","receivedAt":"2006-09-15T12:58:46Z","isPatch":true,"sender":{"key":"pape@smarden.org","avatar":"https://avatars.githubusercontent.com/u/143170252?v=4"},"body":"Patch from Cyril Brulebois to make the build process detect and support the\nDebian GNU/Hurd architecture, see\n http://bugs.debian.org/379841\n\nSigned-off-by: Gerrit Pape <pape@smarden.org>\n\n---\n Makefile |    5 +++++\n 1 files changed, 5 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 7b3114f..6e36eff 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -383,6 +383,11 @@ ifeq ($(uname_S),NetBSD)\n \tALL_CFLAGS += -I/usr/pkg/include\n \tALL_LDFLAGS += -L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib\n endif\n+ifeq ($(uname_S),GNU)\n+       # GNU stands for GNU/Hurd\n+       NO_STRLCPY = YesPlease\n+       ALL_CFLAGS += -DPATH_MAX=4096\n+endif\n ifeq ($(uname_S),AIX)\n \tNO_STRCASESTR=YesPlease\n \tNO_STRLCPY = YesPlease\n-- \n1.4.2.1\n"},{"id":"26974","messageId":"20060915154742.GT17042@admingilde.org","threadId":"5570","inReplyTo":"20060915125846.10469.qmail@ccc765dd61a02d.315fe32.mid.smarden.org","subject":"Re: [PATCH] Build on Debian GNU/Hurd","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2006-09-15T15:47:42Z","receivedAt":"2006-09-15T15:47:42Z","isPatch":true,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"hoi :)\n\nOn Fri, Sep 15, 2006 at 12:58:46PM +0000, Gerrit Pape wrote:\n> +ifeq ($(uname_S),GNU)\n> +       # GNU stands for GNU/Hurd\n> +       NO_STRLCPY = YesPlease\n> +       ALL_CFLAGS += -DPATH_MAX=4096\n> +endif\n\nI guess this arbitrary limit will upset all the Hurd enthusiasts... ;-)\n\n-- \nMartin Waitz\n"},{"id":"26992","messageId":"7vr6yce5ky.fsf@assigned-by-dhcp.cox.net","threadId":"5570","inReplyTo":"20060915125846.10469.qmail@ccc765dd61a02d.315fe32.mid.smarden.org","subject":"Re: [PATCH] Build on Debian GNU/Hurd","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-09-16T05:35:57Z","receivedAt":"2006-09-16T05:35:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Gerrit Pape <pape@smarden.org> writes:\n\n> Patch from Cyril Brulebois to make the build process detect and support the\n> Debian GNU/Hurd architecture, see\n>  http://bugs.debian.org/379841\n>\n> Signed-off-by: Gerrit Pape <pape@smarden.org>\n>\n> +ifeq ($(uname_S),GNU)\n> +       # GNU stands for GNU/Hurd\n> +       NO_STRLCPY = YesPlease\n> +       ALL_CFLAGS += -DPATH_MAX=4096\n> +endif\n\nTwo questions come to mind. (1) Does GNU stand for GNU/Hurd and\nnobody else? (2) Does everybody else have PATH_MAX?\n\nAdding NO_STRLCPY I do not have much problems with, but\nsomething like the attached may be cleaner to deal with PATH_MAX;\nof course now there is an issue of what the appropriate value\nfor that symbol should be.\n\nWould including git-compat-util.h in builtin.h break somebody?\n\n-- >8 --\nDefine fallback PATH_MAX on systems that do not define one in <limits.h>\n\nNotably GNU/Hurd, as reported by Gerrit Pape.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 552b8ec..0272d04 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -26,6 +26,13 @@ #include <netinet/in.h>\n #include <sys/types.h>\n #include <dirent.h>\n \n+/* On most systems <limits.h> would have given us this, but\n+ * not on some systems (e.g. GNU/Hurd).\n+ */\n+#ifndef PATH_MAX\n+#define PATH_MAX 4096\n+#endif\n+\n #ifdef __GNUC__\n #define NORETURN __attribute__((__noreturn__))\n #else\ndiff --git a/builtin.h b/builtin.h\nindex 34ed7b9..1d41f83 100644\n--- a/builtin.h\n+++ b/builtin.h\n@@ -1,8 +1,7 @@\n #ifndef BUILTIN_H\n #define BUILTIN_H\n \n-#include <stdio.h>\n-#include <limits.h>\n+#include \"git-compat-util.h\"\n \n extern const char git_version_string[];\n extern const char git_usage_string[];\n"},{"id":"27162","messageId":"20060919170335.28054.qmail@14e0e1fe2bc371.315fe32.mid.smarden.org","threadId":"5570","inReplyTo":"7vr6yce5ky.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Build on Debian GNU/Hurd","fromName":"Gerrit Pape","fromEmail":"pape@smarden.org","sentAt":"2006-09-19T17:03:35Z","receivedAt":"2006-09-19T17:03:35Z","isPatch":true,"sender":{"key":"pape@smarden.org","avatar":"https://avatars.githubusercontent.com/u/143170252?v=4"},"body":"On Fri, Sep 15, 2006 at 10:35:57PM -0700, Junio C Hamano wrote:\n> Gerrit Pape <pape@smarden.org> writes:\n> > Patch from Cyril Brulebois to make the build process detect and support the\n> > Debian GNU/Hurd architecture, see\n> >  http://bugs.debian.org/379841\n> >\n> > Signed-off-by: Gerrit Pape <pape@smarden.org>\n> >\n> > +ifeq ($(uname_S),GNU)\n> > +       # GNU stands for GNU/Hurd\n> > +       NO_STRLCPY = YesPlease\n> > +       ALL_CFLAGS += -DPATH_MAX=4096\n> > +endif\n> \n> Two questions come to mind. (1) Does GNU stand for GNU/Hurd and\n> nobody else? (2) Does everybody else have PATH_MAX?\n\nI'm not that familiar with the Hurd, but (1) seems to be so according\nto http://www.gnu.org/software/hurd/hurd.html; it looks like either GNU\nor GNU/Hurd is used.  (2) For IRIX64 PATH_MAX also is defined explicitly\n\n git$ grep -B7 -A3 PATH_MAX Makefile \n ifeq ($(uname_S),IRIX64)\n         NO_IPV6=YesPlease\n         NO_SETENV=YesPlease\n         NO_STRCASESTR=YesPlease\n         NO_STRLCPY = YesPlease\n         NO_SOCKADDR_STORAGE=YesPlease\n         SHELL_PATH=/usr/gnu/bin/bash\n         ALL_CFLAGS += -DPATH_MAX=1024\n         # for now, build 32-bit version\n         ALL_LDFLAGS += -L/usr/lib32\n endif\n\nthat's where I got it from.\n\n> Adding NO_STRLCPY I do not have much problems with, but\n> something like the attached may be cleaner to deal with PATH_MAX;\n> of course now there is an issue of what the appropriate value\n> for that symbol should be.\n\nIt's been so before it seems, I'm not sure why it changed.\nhttp://www.debian.org/ports/hurd/hurd-devel-debian says one cannot\nexpect PATH_MAX to be defined on a POSIX system, so defining it\nconditionally IMHO is the right thing.\n\n git$ PAGER=cat git log -p 579d1fb..8e76483\n commit 8e76483ce0ce256b01345abc4ca97b1f94aed354\n Author: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>\n Date:   Sun Jul 30 17:00:40 2006 +0100\n \n     Fix header breakage due to redefining PATH_MAX.\n     \n     The header builtin.h was, incorrectly, redefining PATH_MAX which\n     causes a header order dependency in builtin-write-tree.c.  The fix\n     is to simply include <limits.h> directly to obtain the correct\n     definition of PATH_MAX.\n     \n     Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>\n     Signed-off-by: Junio C Hamano <junkio@cox.net>\n \n diff --git a/builtin.h b/builtin.h\n index 1c8637a..88c4d84 100644\n --- a/builtin.h\n +++ b/builtin.h\n @@ -2,10 +2,7 @@ #ifndef BUILTIN_H\n  #define BUILTIN_H\n  \n  #include <stdio.h>\n -\n -#ifndef PATH_MAX\n -# define PATH_MAX 4096\n -#endif\n +#include <limits.h>\n  \n  extern const char git_version_string[];\n  \n\nHTH, Gerrit.\n"},{"id":"27383","messageId":"000001c6dda4$ad0b1ec0$c47eedc1@ramsay1.demon.co.uk","threadId":"5570","inReplyTo":"20060919170335.28054.qmail@14e0e1fe2bc371.315fe32.mid.smarden.org","subject":"RE: [PATCH] Build on Debian GNU/Hurd","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2006-09-21T17:37:56Z","receivedAt":"2006-09-21T17:37:56Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nOn Tues Sept 19, 2006 at 18:04, Gerrit Pape wrote:\n> On Fri, Sep 15, 2006 at 10:35:57PM -0700, Junio C Hamano wrote:\n> > Gerrit Pape <pape@smarden.org> writes:\n> > > Patch from Cyril Brulebois to make the build process detect \n> and support the\n> > > Debian GNU/Hurd architecture, see\n> > >  http://bugs.debian.org/379841\n> > >\n> > > Signed-off-by: Gerrit Pape <pape@smarden.org>\n> > >\n> > > +ifeq ($(uname_S),GNU)\n> > > +       # GNU stands for GNU/Hurd\n> > > +       NO_STRLCPY = YesPlease\n> > > +       ALL_CFLAGS += -DPATH_MAX=4096\n> > > +endif\n> > \n> > Two questions come to mind. (1) Does GNU stand for GNU/Hurd and\n> > nobody else? (2) Does everybody else have PATH_MAX?\n> \n> I'm not that familiar with the Hurd, but (1) seems to be so according\n> to http://www.gnu.org/software/hurd/hurd.html; it looks like either GNU\n> or GNU/Hurd is used.  (2) For IRIX64 PATH_MAX also is defined explicitly\n> \n>  git$ grep -B7 -A3 PATH_MAX Makefile \n>  ifeq ($(uname_S),IRIX64)\n>          NO_IPV6=YesPlease\n>          NO_SETENV=YesPlease\n>          NO_STRCASESTR=YesPlease\n>          NO_STRLCPY = YesPlease\n>          NO_SOCKADDR_STORAGE=YesPlease\n>          SHELL_PATH=/usr/gnu/bin/bash\n>          ALL_CFLAGS += -DPATH_MAX=1024\n>          # for now, build 32-bit version\n>          ALL_LDFLAGS += -L/usr/lib32\n>  endif\n> \n> that's where I got it from.\n> \n> > Adding NO_STRLCPY I do not have much problems with, but\n> > something like the attached may be cleaner to deal with PATH_MAX;\n> > of course now there is an issue of what the appropriate value\n> > for that symbol should be.\n> \n> It's been so before it seems, I'm not sure why it changed.\n\nBecause without the change (below), git would not compile for me ;-)\n\nIndeed it would not compile for any system that:\n    1) defines PATH_MAX in limits.h\nAND 2) conditionally defines PATH_MAX to a different value.\n(Actually, it does not have to be a different value, just a different\ntoken sequence, including the presence/absence of whitespace/comments)\n\nNote that other systems use a different \"PATH_MAX value\", (a value of\n1024 is common), and in particular, earlier version of linux use a\nvalue of 4095.\n\n> http://www.debian.org/ports/hurd/hurd-devel-debian says one cannot\n> expect PATH_MAX to be defined on a POSIX system,\n\nCorrect. Although PATH_MAX is a POSIX symbol, it is not required to be\ndefined; it *may* be defined in limits.h and, if so, must have a value\nof at least 256.\n\nThe symbol _PC_PATH_MAX *may* also be defined and, if so, may be used\nin a call to pathconf() to *maybe* determine a \"PATH_MAX value\" at\nruntime; it can return a value, indicate no limit, or an \"indeterminate\"\nlimit.\n\n... so defining it\n> conditionally IMHO is the right thing.\n\nIMHO, setting the value in the Makefile, for systems that don't define\nPATH_MAX, is a much better solution. In fact, that is what I thought was\nalready being done.\n\nAll the best,\n\nRamsay\n\n\n> \n>  git$ PAGER=cat git log -p 579d1fb..8e76483\n>  commit 8e76483ce0ce256b01345abc4ca97b1f94aed354\n>  Author: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>\n>  Date:   Sun Jul 30 17:00:40 2006 +0100\n>  \n>      Fix header breakage due to redefining PATH_MAX.\n>      \n>      The header builtin.h was, incorrectly, redefining PATH_MAX which\n>      causes a header order dependency in builtin-write-tree.c.  The fix\n>      is to simply include <limits.h> directly to obtain the correct\n>      definition of PATH_MAX.\n>      \n>      Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>\n>      Signed-off-by: Junio C Hamano <junkio@cox.net>\n>  \n>  diff --git a/builtin.h b/builtin.h\n>  index 1c8637a..88c4d84 100644\n>  --- a/builtin.h\n>  +++ b/builtin.h\n>  @@ -2,10 +2,7 @@ #ifndef BUILTIN_H\n>   #define BUILTIN_H\n>   \n>   #include <stdio.h>\n>  -\n>  -#ifndef PATH_MAX\n>  -# define PATH_MAX 4096\n>  -#endif\n>  +#include <limits.h>\n>   \n>   extern const char git_version_string[];\n>   \n"},{"id":"27384","messageId":"Pine.LNX.4.64.0609211050390.4388@g5.osdl.org","threadId":"5570","inReplyTo":"000001c6dda4$ad0b1ec0$c47eedc1@ramsay1.demon.co.uk","subject":"RE: [PATCH] Build on Debian GNU/Hurd","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-09-21T17:53:53Z","receivedAt":"2006-09-21T17:53:53Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 21 Sep 2006, Ramsay Jones wrote:\n> \n> IMHO, setting the value in the Makefile, for systems that don't define\n> PATH_MAX, is a much better solution. In fact, that is what I thought was\n> already being done.\n\nWell, considering that we _can_ test defines, why not just do it \nautomatically.\n\nIn other words, instead of this patch:\n\n> >  -\n> >  -#ifndef PATH_MAX\n> >  -# define PATH_MAX 4096\n> >  -#endif\n> >  +#include <limits.h>\n\nJust make the code read\n\n\t#include <limits.h>\n\n\t/*\n\t * Insane systems don't have a fixed PATH_MAX, it's POSIX\n\t * compliant but not worth worrying about, so if we didn't\n\t * get PATH_MAX from <limits.h>, just make up our own\n\t */\n\t#ifndef PATH_MAX\n\t# define PATH_MAX 4096\n\t#endif\n\nand after that we can just ignore the issue forever more.\n\nThe thing is, it's not like we even really _care_ what PATH_MAX is all \nthat deeply. We just want to get some random value that is reasonable.\n\n\t\tLinus\n"},{"id":"27415","messageId":"000001c6de6b$a9994920$c47eedc1@ramsay1.demon.co.uk","threadId":"5570","inReplyTo":"Pine.LNX.4.64.0609211050390.4388@g5.osdl.org","subject":"RE: [PATCH] Build on Debian GNU/Hurd","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2006-09-22T17:22:21Z","receivedAt":"2006-09-22T17:22:21Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nOn Thurs Sept 21 at 18:54, Linus Torvalds wrote:\n> On Thu, 21 Sep 2006, Ramsay Jones wrote:\n> >\n> > IMHO, setting the value in the Makefile, for systems that don't define\n> > PATH_MAX, is a much better solution. In fact, that is what I thought was\n> > already being done.\n>\n> Well, considering that we _can_ test defines, why not just do it\n> automatically.\n>\n> In other words, instead of this patch:\n>\n> > >  -\n> > >  -#ifndef PATH_MAX\n> > >  -# define PATH_MAX 4096\n> > >  -#endif\n> > >  +#include <limits.h>\n>\n> Just make the code read\n>\n> \t#include <limits.h>\n>\n> \t/*\n> \t * Insane systems don't have a fixed PATH_MAX, it's POSIX\n> \t * compliant but not worth worrying about, so if we didn't\n> \t * get PATH_MAX from <limits.h>, just make up our own\n> \t */\n> \t#ifndef PATH_MAX\n> \t# define PATH_MAX 4096\n> \t#endif\n>\n> and after that we can just ignore the issue forever more.\n\nYes, that would certainly be a solution. (Of course, setting the value in\nthe Makefile would still be a better solution ;-)\nHowever, ...\n\n>\n> The thing is, it's not like we even really _care_ what PATH_MAX is all\n> that deeply. We just want to get some random value that is reasonable.\n>\n> \t\tLinus\n>\n\n... given the above, a better solution is: don't use PATH_MAX.\nSimply #define a new symbol in a suitable git header file and globally\nreplace uses of PATH_MAX with the new symbol. Job done.\n\nAll the best,\n\nRamsay\n"}]}