{"thread":{"id":"23293","subject":"[PATCH] Makefile: update defaults for modern Cygwin","startedAt":"2010-04-01T22:43:54Z","lastAt":"2010-04-05T15:36:48Z","messageCount":11,"participants":["Eric Blake","Junio C Hamano","Jonathan Nieder","Andreas Schwab"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"138369","messageId":"1270161834-9597-1-git-send-email-eblake@redhat.com","threadId":"23293","inReplyTo":null,"subject":"[PATCH] Makefile: update defaults for modern Cygwin","fromName":"Eric Blake","fromEmail":"eblake@redhat.com","sentAt":"2010-04-01T22:43:54Z","receivedAt":"2010-04-01T22:43:54Z","isPatch":true,"sender":{"key":"eblake@redhat.com","avatar":"https://avatars.githubusercontent.com/u/32933908?v=4"},"body":"Now that Cygwin 1.7.x has enabled lots of new features, and Cygwin 1.5\nis no longer actively supported by the Cygwin mailing lists, we might\nas well update the defaults to cater to those new features.\n\nNO_TRUSTABLE_FILEMODE is only necessary on FAT drives; the Cygwin\ncommunity recommends NTFS drives, but there is still too much use\nfor FAT to switch the default.  Likewise, UNRELIABLE_FSTAT is probably\nfile-system specific, but worth keeping unchanged.\n\nThis commit does not change the default for NO_MMAP, although definitive\nproof of whether this option is necessary is lacking.\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\n---\n Makefile |   22 ++++++++++++----------\n 1 files changed, 12 insertions(+), 10 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 3e816e1..442ce0b 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -34,7 +34,7 @@ all::\n # Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent.\n #\n # Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks\n-# d_type in struct dirent (latest Cygwin -- will be fixed soonish).\n+# d_type in struct dirent (Cygwin 1.5, fixed in Cygwin 1.7).\n #\n # Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.)\n # do not support the 'size specifiers' introduced by C99, namely ll, hh,\n@@ -109,7 +109,7 @@ all::\n # Define NO_PTHREADS if you do not have or do not want to use Pthreads.\n #\n # Define NO_PREAD if you have a problem with pread() system call (e.g.\n-# cygwin.dll before v1.5.22).\n+# cygwin1.dll before v1.5.22).\n #\n # Define NO_FAST_WORKING_DIRECTORY if accessing objects in pack files is\n # generally faster on your platform than accessing the working directory.\n@@ -831,22 +831,24 @@ ifeq ($(uname_S),SunOS)\n \tBASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__ -DHAVE_ALLOCA_H\n endif\n ifeq ($(uname_O),Cygwin)\n-\tNO_D_TYPE_IN_DIRENT = YesPlease\n-\tNO_D_INO_IN_DIRENT = YesPlease\n-\tNO_STRCASESTR = YesPlease\n-\tNO_MEMMEM = YesPlease\n-\tNO_MKSTEMPS = YesPlease\n-\tNO_SYMLINK_HEAD = YesPlease\n+\tifneq ($(wordlist 1, 2, $(subst ., ,$(uname_R))),1 7)\n+\t\tNO_D_TYPE_IN_DIRENT = YesPlease\n+\t\tNO_D_INO_IN_DIRENT = YesPlease\n+\t\tNO_STRCASESTR = YesPlease\n+\t\tNO_MEMMEM = YesPlease\n+\t\tNO_MKSTEMPS = YesPlease\n+\t\tNO_SYMLINK_HEAD = YesPlease\n+\t\tNO_IPV6 = YesPlease\n+\t\tOLD_ICONV = UnfortunatelyYes\n+\tendif\n \tNEEDS_LIBICONV = YesPlease\n \tNO_FAST_WORKING_DIRECTORY = UnfortunatelyYes\n \tNO_TRUSTABLE_FILEMODE = UnfortunatelyYes\n-\tOLD_ICONV = UnfortunatelyYes\n \tNO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease\n \t# There are conflicting reports about this.\n \t# On some boxes NO_MMAP is needed, and not so elsewhere.\n \t# Try commenting this out if you suspect MMAP is more efficient\n \tNO_MMAP = YesPlease\n-\tNO_IPV6 = YesPlease\n \tX = .exe\n \tCOMPAT_OBJS += compat/cygwin.o\n \tUNRELIABLE_FSTAT = UnfortunatelyYes\n-- \n1.6.6.1\n"},{"id":"138391","messageId":"7vaatmmju9.fsf@alter.siamese.dyndns.org","threadId":"23293","inReplyTo":"1270161834-9597-1-git-send-email-eblake@redhat.com","subject":"Re: [PATCH] Makefile: update defaults for modern Cygwin","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-04-02T06:47:42Z","receivedAt":"2010-04-02T06:47:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Blake <eblake@redhat.com> writes:\n\n> Now that Cygwin 1.7.x has enabled lots of new features, and Cygwin 1.5\n> is no longer actively supported by the Cygwin mailing lists, we might\n> as well update the defaults to cater to those new features.\n>\n> NO_TRUSTABLE_FILEMODE is only necessary on FAT drives; the Cygwin\n> community recommends NTFS drives, but there is still too much use\n> for FAT to switch the default.  Likewise, UNRELIABLE_FSTAT is probably\n> file-system specific, but worth keeping unchanged.\n>\n> This commit does not change the default for NO_MMAP, although definitive\n> proof of whether this option is necessary is lacking.\n>\n> Signed-off-by: Eric Blake <eblake@redhat.com>\n\nThanks; as I lack Cygwin environment to test this myself, I'll apply this\ndirectly on 'master' and see if anybody screams ;-)\n\n> +\tifneq ($(wordlist 1, 2, $(subst ., ,$(uname_R))),1 7)\n\nDo we need to update this part when Cygwin 1.8 is released?  Replacing\nthis with \"ifeq(... ,1 5)\" may not be an improvement either, unless we are\nsure that nobody is using 1.4 or older, but I wonder if somebody else have\nbetter ideas?\n"},{"id":"138427","messageId":"4BB5F94F.3090403@redhat.com","threadId":"23293","inReplyTo":"7vaatmmju9.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Makefile: update defaults for modern Cygwin","fromName":"Eric Blake","fromEmail":"eblake@redhat.com","sentAt":"2010-04-02T14:03:59Z","receivedAt":"2010-04-02T14:03:59Z","isPatch":true,"sender":{"key":"eblake@redhat.com","avatar":"https://avatars.githubusercontent.com/u/32933908?v=4"},"body":"On 04/02/2010 12:47 AM, Junio C Hamano wrote:\n> Thanks; as I lack Cygwin environment to test this myself, I'll apply this\n> directly on 'master' and see if anybody screams ;-)\n\nThanks.\n\n> \n>> +\tifneq ($(wordlist 1, 2, $(subst ., ,$(uname_R))),1 7)\n> \n> Do we need to update this part when Cygwin 1.8 is released?\n\nOdd numbers are public cygwin releases (1.5, 1.7), even numbers are Red\nHat releases (1.6, 1.8), so cygwin 1.8 already does exist for Red Hat\nlicensed customers.  It will probably be years before cygwin 1.9/1.10\nexists, at which point 1.5/1.6 will be such a distant memory that we\ncould just delete this block altogether at that time.\n\n>  Replacing\n> this with \"ifeq(... ,1 5)\" may not be an improvement either, unless we are\n> sure that nobody is using 1.4 or older, but I wonder if somebody else have\n> better ideas?\n\nNothing short of using $(shell) and doing some actual computation on the\nstring in $(uname_R).  But that's not too hard, if people think it's\nworth it; speak up if you want me to rework it along those lines,\notherwise I'll assume that things are good enough as-is.\n\n-- \nEric Blake   eblake@redhat.com    +1-801-349-2682\nLibvirt virtualization library http://libvirt.org\n\n"},{"id":"138492","messageId":"20100403074700.GA24176@progeny.tock","threadId":"23293","inReplyTo":"4BB5F94F.3090403@redhat.com","subject":"Re: [PATCH] Makefile: update defaults for modern Cygwin","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-04-03T07:47:00Z","receivedAt":"2010-04-03T07:47:00Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Eric Blake wrote:\n> On 04/02/2010 12:47 AM, Junio C Hamano wrote:\n\n>> Replacing\n>> this with \"ifeq(... ,1 5)\" may not be an improvement either, unless we are\n>> sure that nobody is using 1.4 or older, but I wonder if somebody else have\n>> better ideas?\n>\n> Nothing short of using $(shell) and doing some actual computation on the\n> string in $(uname_R).  But that's not too hard, if people think it's\n> worth it; speak up if you want me to rework it along those lines,\n> otherwise I'll assume that things are good enough as-is.\n\nRed Hat internal people might want to be able to use 1.8 when it comes\nout.  Maybe something like this would do the trick?  I don’t know whether\nCygwin 1.6 has the fixes 1.7 does, so in my ignorance I lumped it with\n1.5.\n\nWhat you sent is probably good enough already; just trying to avoid\nfuture work.\n\n-- %< --\nSubject: Makefile: future-proof Cygwin version check\n\nTweak the condition that detects old Cygwin versions to not include\nversions such as 1.8, 1.11, and 2.1.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\ndiff --git a/Makefile b/Makefile\nindex 11ec3e2..a712430 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -831,7 +831,7 @@ ifeq ($(uname_S),SunOS)\n \tBASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__ -DHAVE_ALLOCA_H\n endif\n ifeq ($(uname_O),Cygwin)\n-\tifneq ($(wordlist 1, 2, $(subst ., ,$(uname_R))),1 7)\n+\tifeq ($(shell expr \"$(uname_R)\" : '1\\.[1-6]\\.'),4)\n \t\tNO_D_TYPE_IN_DIRENT = YesPlease\n \t\tNO_D_INO_IN_DIRENT = YesPlease\n \t\tNO_STRCASESTR = YesPlease\n-- \n"},{"id":"138505","messageId":"7vr5mw8k66.fsf@alter.siamese.dyndns.org","threadId":"23293","inReplyTo":"20100403074700.GA24176@progeny.tock","subject":"Re: [PATCH] Makefile: update defaults for modern Cygwin","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-04-03T18:28:49Z","receivedAt":"2010-04-03T18:28:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks, will queue.  By the way, please spell scissors as 8< or >8 not\nwith a per-cent at least for now.\n"},{"id":"138507","messageId":"20100403195217.GA26698@progeny.tock","threadId":"23293","inReplyTo":"7vr5mw8k66.fsf@alter.siamese.dyndns.org","subject":"[PATCH] Teach mailinfo %< as an alternative scissors mark","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-04-03T19:52:17Z","receivedAt":"2010-04-03T19:52:17Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Handle perforations found “in the wild” more robustly by recognizing\n“%<” as an alternative scissors mark.\n\nThis feature is only meant to support old habits.  Discourage new use\nof the percent-based version by only documenting the 8< symbol so new\nusers’ perforations can still be recognized by old versions of Git.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\nJunio C Hamano wrote:\n\n> Thanks, will queue.  By the way, please spell scissors as 8< or >8 not\n> with a per-cent at least for now.\n\nThanks for pointing it out.  I will from now on.\n\nSearching for “cut here” on groups.google.com revealed several examples\nlike this one:\n\n ______________________%<__cut here ______________>%_____________\n\n[ed: dashes converted to underscores to avoid confusing am]\n\nSo I guess I’m the only one using the small-fingered scissors.  Maybe\nthis patch could help support old habits.\n\n builtin/mailinfo.c |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/mailinfo.c b/builtin/mailinfo.c\nindex ce2ef6b..4a9729b 100644\n--- a/builtin/mailinfo.c\n+++ b/builtin/mailinfo.c\n@@ -746,7 +746,8 @@ static int is_scissors_line(const struct strbuf *line)\n \t\t\tcontinue;\n \t\t}\n \t\tif (i + 1 < len &&\n-\t\t    (!memcmp(buf + i, \">8\", 2) || !memcmp(buf + i, \"8<\", 2))) {\n+\t\t    (!memcmp(buf + i, \">8\", 2) || !memcmp(buf + i, \"8<\", 2) ||\n+\t\t     !memcmp(buf + i, \">%\", 2) || !memcmp(buf + i, \"%<\", 2))) {\n \t\t\tin_perforation = 1;\n \t\t\tperforation += 2;\n \t\t\tscissors += 2;\n-- \n1.7.0.3\n"},{"id":"138590","messageId":"4BB9E24E.4090206@redhat.com","threadId":"23293","inReplyTo":"20100403074700.GA24176@progeny.tock","subject":"Re: [PATCH] Makefile: update defaults for modern Cygwin","fromName":"Eric Blake","fromEmail":"eblake@redhat.com","sentAt":"2010-04-05T13:14:54Z","receivedAt":"2010-04-05T13:14:54Z","isPatch":true,"sender":{"key":"eblake@redhat.com","avatar":"https://avatars.githubusercontent.com/u/32933908?v=4"},"body":"On 04/03/2010 01:47 AM, Jonathan Nieder wrote:\n> Red Hat internal people might want to be able to use 1.8 when it comes\n> out.  Maybe something like this would do the trick?  I don’t know whether\n> Cygwin 1.6 has the fixes 1.7 does, so in my ignorance I lumped it with\n> 1.5.\n\nCygwin 1.6 is on par with 1.5 feature-wise, so your cutoff of 1.6 as the\nlast old version is correct.\n\n> @@ -831,7 +831,7 @@ ifeq ($(uname_S),SunOS)\n>  \tBASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__ -DHAVE_ALLOCA_H\n>  endif\n>  ifeq ($(uname_O),Cygwin)\n> -\tifneq ($(wordlist 1, 2, $(subst ., ,$(uname_R))),1 7)\n> +\tifeq ($(shell expr \"$(uname_R)\" : '1\\.[1-6]\\.'),4)\n\nIt would be nice to use fewer processes, since forking is so expensive\non cygwin:\n\nifeq ($(shell case '$(uname_R)' in 1.[1-6].*) echo old;; esac),old)\n\nBut does that work to have unbalanced ) in a makefile $(shell)?  On the\nother hand, this is already in a chunk guarded by $(uname_S) being\ncygwin, and we know that cygwin shells understand:\n\nifeq ($(shell case '$(uname_R)' in (1.[1-6].*) echo old;; esac),old)\n\neven though it is not portable to other shells, like Solaris /bin/sh.\n\n-- \nEric Blake   eblake@redhat.com    +1-801-349-2682\nLibvirt virtualization library http://libvirt.org\n\n"},{"id":"138594","messageId":"20100405143053.GA13093@progeny.tock","threadId":"23293","inReplyTo":"4BB9E24E.4090206@redhat.com","subject":"Re: [PATCH] Makefile: update defaults for modern Cygwin","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-04-05T14:30:53Z","receivedAt":"2010-04-05T14:30:53Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Eric Blake wrote:\n\n> Cygwin 1.6 is on par with 1.5 feature-wise, so your cutoff of 1.6 as the\n> last old version is correct.\n\nThanks for explaining.\n\n> ifeq ($(shell case '$(uname_R)' in (1.[1-6].*) echo old;; esac),old)\n\nLooks good to me.\n\nWhile I have your attention, do you know of a simple way to test\nCygwin programs under Linux?  setup.exe does not work well under wine,\nso I am asking mostly in the hope that there is a .tar.gz or .zip\nbinary distribution somewhere I could play with.\n\nThanks,\nJonathan\n"},{"id":"138596","messageId":"4BB9F756.7030701@redhat.com","threadId":"23293","inReplyTo":"20100405143053.GA13093@progeny.tock","subject":"Re: [PATCH] Makefile: update defaults for modern Cygwin","fromName":"Eric Blake","fromEmail":"eblake@redhat.com","sentAt":"2010-04-05T14:44:38Z","receivedAt":"2010-04-05T14:44:38Z","isPatch":true,"sender":{"key":"eblake@redhat.com","avatar":"https://avatars.githubusercontent.com/u/32933908?v=4"},"body":"On 04/05/2010 08:30 AM, Jonathan Nieder wrote:\n> Eric Blake wrote:\n> \n>> Cygwin 1.6 is on par with 1.5 feature-wise, so your cutoff of 1.6 as the\n>> last old version is correct.\n> \n> Thanks for explaining.\n> \n>> ifeq ($(shell case '$(uname_R)' in (1.[1-6].*) echo old;; esac),old)\n> \n> Looks good to me.\n\nJunio mentioned he had already queued your first version of the patch;\nare you going to re-submit it with this tweak?\n\n> \n> While I have your attention, do you know of a simple way to test\n> Cygwin programs under Linux?  setup.exe does not work well under wine,\n> so I am asking mostly in the hope that there is a .tar.gz or .zip\n> binary distribution somewhere I could play with.\n\nSadly, the fact that wine is not yet able to run setup.exe is evidence\nthat wine is still lacking some emulation abilities, and while I am\naware that the situation is trying to be improved, I am not actively\nparticipating in that effort.  For now, I am only aware of the ability\nto run cygwin on native windows boxes (including virtual machines).  In\nfact, I'm currently using a 240-day evaluation license of Windows Sever\n2008 inside a VM to experiment with cygwin on my Linux box, without\nhaving spent any extra money.\n\n-- \nEric Blake   eblake@redhat.com    +1-801-349-2682\nLibvirt virtualization library http://libvirt.org\n\n"},{"id":"138600","messageId":"20100405151059.GB13761@progeny.tock","threadId":"23293","inReplyTo":"4BB9F756.7030701@redhat.com","subject":"[PATCH] Makefile: avoid a fork in Cygwin version check","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-04-05T15:11:00Z","receivedAt":"2010-04-05T15:11:00Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"From: Eric Blake <eblake@redhat.com>\n\nIt is nice to use fewer processes, since forking is so expensive on\ncygwin.  So use a case statement instead of expr.\n\nBut does that work to have unbalanced ) in a makefile $(shell)?  On\nthe other hand, this is already in a chunk guarded by $(uname_S) being\ncygwin, and we know that cygwin shells understand:\n\n\tcase '$(uname_R)' in (1.[1-6].*) echo old;; esac\n\neven though it is not portable to other shells, like NetBSD ash.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\nEric Blake wrote:\n>> Eric Blake wrote:\n\n>>> ifeq ($(shell case '$(uname_R)' in (1.[1-6].*) echo old;; esac),old)\n[...]\n> Junio mentioned he had already queued your first version of the patch;\n> are you going to re-submit it with this tweak?\n\nSince the patch to future-proof the version check has already hit master,\nhere’s the change as an independent patch against master.\n\n Makefile |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex e210a42..767fb66 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -831,7 +831,7 @@ ifeq ($(uname_S),SunOS)\n \tBASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__ -DHAVE_ALLOCA_H\n endif\n ifeq ($(uname_O),Cygwin)\n-\tifeq ($(shell expr \"$(uname_R)\" : '1\\.[1-6]\\.'),4)\n+\tifeq ($(shell case '$(uname_R)' in (1.[1-6].*) echo old;; esac),old)\n \t\tNO_D_TYPE_IN_DIRENT = YesPlease\n \t\tNO_D_INO_IN_DIRENT = YesPlease\n \t\tNO_STRCASESTR = YesPlease\n-- \n1.7.0.3\n"},{"id":"138601","messageId":"m2eiitc3n3.fsf@igel.home","threadId":"23293","inReplyTo":"20100405151059.GB13761@progeny.tock","subject":"Re: [PATCH] Makefile: avoid a fork in Cygwin version check","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2010-04-05T15:36:48Z","receivedAt":"2010-04-05T15:36:48Z","isPatch":true,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> diff --git a/Makefile b/Makefile\n> index e210a42..767fb66 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -831,7 +831,7 @@ ifeq ($(uname_S),SunOS)\n>  \tBASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__ -DHAVE_ALLOCA_H\n>  endif\n>  ifeq ($(uname_O),Cygwin)\n> -\tifeq ($(shell expr \"$(uname_R)\" : '1\\.[1-6]\\.'),4)\n> +\tifeq ($(shell case '$(uname_R)' in (1.[1-6].*) echo old;; esac),old)\n\nEven less forks:\n\n        ifneq ($(filter 1.1.% 1.2.% 1.3.% 1.4.% 1.5.% 1.6.%,$(uname_R)),)\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"}]}