git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Makefile: update defaults for modern Cygwin
@ 2010-04-01 22:43 Eric Blake
  2010-04-02  6:47 ` Junio C Hamano
  0 siblings, 1 reply; 11+ messages in thread
From: Eric Blake @ 2010-04-01 22:43 UTC (permalink / raw)
  To: git; +Cc: jon.seymour, jrnieder

Now that Cygwin 1.7.x has enabled lots of new features, and Cygwin 1.5
is no longer actively supported by the Cygwin mailing lists, we might
as well update the defaults to cater to those new features.

NO_TRUSTABLE_FILEMODE is only necessary on FAT drives; the Cygwin
community recommends NTFS drives, but there is still too much use
for FAT to switch the default.  Likewise, UNRELIABLE_FSTAT is probably
file-system specific, but worth keeping unchanged.

This commit does not change the default for NO_MMAP, although definitive
proof of whether this option is necessary is lacking.

Signed-off-by: Eric Blake <eblake@redhat.com>
---
 Makefile |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index 3e816e1..442ce0b 100644
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,7 @@ all::
 # Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent.
 #
 # Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks
-# d_type in struct dirent (latest Cygwin -- will be fixed soonish).
+# d_type in struct dirent (Cygwin 1.5, fixed in Cygwin 1.7).
 #
 # Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.)
 # do not support the 'size specifiers' introduced by C99, namely ll, hh,
@@ -109,7 +109,7 @@ all::
 # 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.
-# cygwin.dll before v1.5.22).
+# cygwin1.dll before v1.5.22).
 #
 # Define NO_FAST_WORKING_DIRECTORY if accessing objects in pack files is
 # generally faster on your platform than accessing the working directory.
@@ -831,22 +831,24 @@ ifeq ($(uname_S),SunOS)
 	BASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__ -DHAVE_ALLOCA_H
 endif
 ifeq ($(uname_O),Cygwin)
-	NO_D_TYPE_IN_DIRENT = YesPlease
-	NO_D_INO_IN_DIRENT = YesPlease
-	NO_STRCASESTR = YesPlease
-	NO_MEMMEM = YesPlease
-	NO_MKSTEMPS = YesPlease
-	NO_SYMLINK_HEAD = YesPlease
+	ifneq ($(wordlist 1, 2, $(subst ., ,$(uname_R))),1 7)
+		NO_D_TYPE_IN_DIRENT = YesPlease
+		NO_D_INO_IN_DIRENT = YesPlease
+		NO_STRCASESTR = YesPlease
+		NO_MEMMEM = YesPlease
+		NO_MKSTEMPS = YesPlease
+		NO_SYMLINK_HEAD = YesPlease
+		NO_IPV6 = YesPlease
+		OLD_ICONV = UnfortunatelyYes
+	endif
 	NEEDS_LIBICONV = YesPlease
 	NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
 	NO_TRUSTABLE_FILEMODE = UnfortunatelyYes
-	OLD_ICONV = UnfortunatelyYes
 	NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
 	# There are conflicting reports about this.
 	# On some boxes NO_MMAP is needed, and not so elsewhere.
 	# Try commenting this out if you suspect MMAP is more efficient
 	NO_MMAP = YesPlease
-	NO_IPV6 = YesPlease
 	X = .exe
 	COMPAT_OBJS += compat/cygwin.o
 	UNRELIABLE_FSTAT = UnfortunatelyYes
-- 
1.6.6.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] Makefile: update defaults for modern Cygwin
  2010-04-01 22:43 [PATCH] Makefile: update defaults for modern Cygwin Eric Blake
@ 2010-04-02  6:47 ` Junio C Hamano
  2010-04-02 14:03   ` Eric Blake
  0 siblings, 1 reply; 11+ messages in thread
From: Junio C Hamano @ 2010-04-02  6:47 UTC (permalink / raw)
  To: Eric Blake; +Cc: git, jon.seymour, jrnieder

Eric Blake <eblake@redhat.com> writes:

> Now that Cygwin 1.7.x has enabled lots of new features, and Cygwin 1.5
> is no longer actively supported by the Cygwin mailing lists, we might
> as well update the defaults to cater to those new features.
>
> NO_TRUSTABLE_FILEMODE is only necessary on FAT drives; the Cygwin
> community recommends NTFS drives, but there is still too much use
> for FAT to switch the default.  Likewise, UNRELIABLE_FSTAT is probably
> file-system specific, but worth keeping unchanged.
>
> This commit does not change the default for NO_MMAP, although definitive
> proof of whether this option is necessary is lacking.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>

Thanks; as I lack Cygwin environment to test this myself, I'll apply this
directly on 'master' and see if anybody screams ;-)

> +	ifneq ($(wordlist 1, 2, $(subst ., ,$(uname_R))),1 7)

Do we need to update this part when Cygwin 1.8 is released?  Replacing
this with "ifeq(... ,1 5)" may not be an improvement either, unless we are
sure that nobody is using 1.4 or older, but I wonder if somebody else have
better ideas?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Makefile: update defaults for modern Cygwin
  2010-04-02  6:47 ` Junio C Hamano
@ 2010-04-02 14:03   ` Eric Blake
  2010-04-03  7:47     ` Jonathan Nieder
  0 siblings, 1 reply; 11+ messages in thread
From: Eric Blake @ 2010-04-02 14:03 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, jon.seymour, jrnieder

[-- Attachment #1: Type: text/plain, Size: 1236 bytes --]

On 04/02/2010 12:47 AM, Junio C Hamano wrote:
> Thanks; as I lack Cygwin environment to test this myself, I'll apply this
> directly on 'master' and see if anybody screams ;-)

Thanks.

> 
>> +	ifneq ($(wordlist 1, 2, $(subst ., ,$(uname_R))),1 7)
> 
> Do we need to update this part when Cygwin 1.8 is released?

Odd numbers are public cygwin releases (1.5, 1.7), even numbers are Red
Hat releases (1.6, 1.8), so cygwin 1.8 already does exist for Red Hat
licensed customers.  It will probably be years before cygwin 1.9/1.10
exists, at which point 1.5/1.6 will be such a distant memory that we
could just delete this block altogether at that time.

>  Replacing
> this with "ifeq(... ,1 5)" may not be an improvement either, unless we are
> sure that nobody is using 1.4 or older, but I wonder if somebody else have
> better ideas?

Nothing short of using $(shell) and doing some actual computation on the
string in $(uname_R).  But that's not too hard, if people think it's
worth it; speak up if you want me to rework it along those lines,
otherwise I'll assume that things are good enough as-is.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 323 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Makefile: update defaults for modern Cygwin
  2010-04-02 14:03   ` Eric Blake
@ 2010-04-03  7:47     ` Jonathan Nieder
  2010-04-03 18:28       ` Junio C Hamano
  2010-04-05 13:14       ` [PATCH] Makefile: update defaults for modern Cygwin Eric Blake
  0 siblings, 2 replies; 11+ messages in thread
From: Jonathan Nieder @ 2010-04-03  7:47 UTC (permalink / raw)
  To: Eric Blake; +Cc: Junio C Hamano, git, jon.seymour

Eric Blake wrote:
> On 04/02/2010 12:47 AM, Junio C Hamano wrote:

>> Replacing
>> this with "ifeq(... ,1 5)" may not be an improvement either, unless we are
>> sure that nobody is using 1.4 or older, but I wonder if somebody else have
>> better ideas?
>
> Nothing short of using $(shell) and doing some actual computation on the
> string in $(uname_R).  But that's not too hard, if people think it's
> worth it; speak up if you want me to rework it along those lines,
> otherwise I'll assume that things are good enough as-is.

Red Hat internal people might want to be able to use 1.8 when it comes
out.  Maybe something like this would do the trick?  I don’t know whether
Cygwin 1.6 has the fixes 1.7 does, so in my ignorance I lumped it with
1.5.

What you sent is probably good enough already; just trying to avoid
future work.

-- %< --
Subject: Makefile: future-proof Cygwin version check

Tweak the condition that detects old Cygwin versions to not include
versions such as 1.8, 1.11, and 2.1.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
diff --git a/Makefile b/Makefile
index 11ec3e2..a712430 100644
--- a/Makefile
+++ b/Makefile
@@ -831,7 +831,7 @@ ifeq ($(uname_S),SunOS)
 	BASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__ -DHAVE_ALLOCA_H
 endif
 ifeq ($(uname_O),Cygwin)
-	ifneq ($(wordlist 1, 2, $(subst ., ,$(uname_R))),1 7)
+	ifeq ($(shell expr "$(uname_R)" : '1\.[1-6]\.'),4)
 		NO_D_TYPE_IN_DIRENT = YesPlease
 		NO_D_INO_IN_DIRENT = YesPlease
 		NO_STRCASESTR = YesPlease
-- 

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] Makefile: update defaults for modern Cygwin
  2010-04-03  7:47     ` Jonathan Nieder
@ 2010-04-03 18:28       ` Junio C Hamano
  2010-04-03 19:52         ` [PATCH] Teach mailinfo %< as an alternative scissors mark Jonathan Nieder
  2010-04-05 13:14       ` [PATCH] Makefile: update defaults for modern Cygwin Eric Blake
  1 sibling, 1 reply; 11+ messages in thread
From: Junio C Hamano @ 2010-04-03 18:28 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Eric Blake, git, jon.seymour

Thanks, will queue.  By the way, please spell scissors as 8< or >8 not
with a per-cent at least for now.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] Teach mailinfo %< as an alternative scissors mark
  2010-04-03 18:28       ` Junio C Hamano
@ 2010-04-03 19:52         ` Jonathan Nieder
  0 siblings, 0 replies; 11+ messages in thread
From: Jonathan Nieder @ 2010-04-03 19:52 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Handle perforations found “in the wild” more robustly by recognizing
“%<” as an alternative scissors mark.

This feature is only meant to support old habits.  Discourage new use
of the percent-based version by only documenting the 8< symbol so new
users’ perforations can still be recognized by old versions of Git.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Junio C Hamano wrote:

> Thanks, will queue.  By the way, please spell scissors as 8< or >8 not
> with a per-cent at least for now.

Thanks for pointing it out.  I will from now on.

Searching for “cut here” on groups.google.com revealed several examples
like this one:

 ______________________%<__cut here ______________>%_____________

[ed: dashes converted to underscores to avoid confusing am]

So I guess I’m the only one using the small-fingered scissors.  Maybe
this patch could help support old habits.

 builtin/mailinfo.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c
index ce2ef6b..4a9729b 100644
--- a/builtin/mailinfo.c
+++ b/builtin/mailinfo.c
@@ -746,7 +746,8 @@ static int is_scissors_line(const struct strbuf *line)
 			continue;
 		}
 		if (i + 1 < len &&
-		    (!memcmp(buf + i, ">8", 2) || !memcmp(buf + i, "8<", 2))) {
+		    (!memcmp(buf + i, ">8", 2) || !memcmp(buf + i, "8<", 2) ||
+		     !memcmp(buf + i, ">%", 2) || !memcmp(buf + i, "%<", 2))) {
 			in_perforation = 1;
 			perforation += 2;
 			scissors += 2;
-- 
1.7.0.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] Makefile: update defaults for modern Cygwin
  2010-04-03  7:47     ` Jonathan Nieder
  2010-04-03 18:28       ` Junio C Hamano
@ 2010-04-05 13:14       ` Eric Blake
  2010-04-05 14:30         ` Jonathan Nieder
  1 sibling, 1 reply; 11+ messages in thread
From: Eric Blake @ 2010-04-05 13:14 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Junio C Hamano, git, jon.seymour

[-- Attachment #1: Type: text/plain, Size: 1264 bytes --]

On 04/03/2010 01:47 AM, Jonathan Nieder wrote:
> Red Hat internal people might want to be able to use 1.8 when it comes
> out.  Maybe something like this would do the trick?  I don’t know whether
> Cygwin 1.6 has the fixes 1.7 does, so in my ignorance I lumped it with
> 1.5.

Cygwin 1.6 is on par with 1.5 feature-wise, so your cutoff of 1.6 as the
last old version is correct.

> @@ -831,7 +831,7 @@ ifeq ($(uname_S),SunOS)
>  	BASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__ -DHAVE_ALLOCA_H
>  endif
>  ifeq ($(uname_O),Cygwin)
> -	ifneq ($(wordlist 1, 2, $(subst ., ,$(uname_R))),1 7)
> +	ifeq ($(shell expr "$(uname_R)" : '1\.[1-6]\.'),4)

It would be nice to use fewer processes, since forking is so expensive
on cygwin:

ifeq ($(shell case '$(uname_R)' in 1.[1-6].*) echo old;; esac),old)

But does that work to have unbalanced ) in a makefile $(shell)?  On the
other hand, this is already in a chunk guarded by $(uname_S) being
cygwin, and we know that cygwin shells understand:

ifeq ($(shell case '$(uname_R)' in (1.[1-6].*) echo old;; esac),old)

even though it is not portable to other shells, like Solaris /bin/sh.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 323 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Makefile: update defaults for modern Cygwin
  2010-04-05 13:14       ` [PATCH] Makefile: update defaults for modern Cygwin Eric Blake
@ 2010-04-05 14:30         ` Jonathan Nieder
  2010-04-05 14:44           ` Eric Blake
  0 siblings, 1 reply; 11+ messages in thread
From: Jonathan Nieder @ 2010-04-05 14:30 UTC (permalink / raw)
  To: Eric Blake; +Cc: Junio C Hamano, git, jon.seymour

Eric Blake wrote:

> Cygwin 1.6 is on par with 1.5 feature-wise, so your cutoff of 1.6 as the
> last old version is correct.

Thanks for explaining.

> ifeq ($(shell case '$(uname_R)' in (1.[1-6].*) echo old;; esac),old)

Looks good to me.

While I have your attention, do you know of a simple way to test
Cygwin programs under Linux?  setup.exe does not work well under wine,
so I am asking mostly in the hope that there is a .tar.gz or .zip
binary distribution somewhere I could play with.

Thanks,
Jonathan

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Makefile: update defaults for modern Cygwin
  2010-04-05 14:30         ` Jonathan Nieder
@ 2010-04-05 14:44           ` Eric Blake
  2010-04-05 15:11             ` [PATCH] Makefile: avoid a fork in Cygwin version check Jonathan Nieder
  0 siblings, 1 reply; 11+ messages in thread
From: Eric Blake @ 2010-04-05 14:44 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Junio C Hamano, git, jon.seymour

[-- Attachment #1: Type: text/plain, Size: 1348 bytes --]

On 04/05/2010 08:30 AM, Jonathan Nieder wrote:
> Eric Blake wrote:
> 
>> Cygwin 1.6 is on par with 1.5 feature-wise, so your cutoff of 1.6 as the
>> last old version is correct.
> 
> Thanks for explaining.
> 
>> ifeq ($(shell case '$(uname_R)' in (1.[1-6].*) echo old;; esac),old)
> 
> Looks good to me.

Junio mentioned he had already queued your first version of the patch;
are you going to re-submit it with this tweak?

> 
> While I have your attention, do you know of a simple way to test
> Cygwin programs under Linux?  setup.exe does not work well under wine,
> so I am asking mostly in the hope that there is a .tar.gz or .zip
> binary distribution somewhere I could play with.

Sadly, the fact that wine is not yet able to run setup.exe is evidence
that wine is still lacking some emulation abilities, and while I am
aware that the situation is trying to be improved, I am not actively
participating in that effort.  For now, I am only aware of the ability
to run cygwin on native windows boxes (including virtual machines).  In
fact, I'm currently using a 240-day evaluation license of Windows Sever
2008 inside a VM to experiment with cygwin on my Linux box, without
having spent any extra money.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 323 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] Makefile: avoid a fork in Cygwin version check
  2010-04-05 14:44           ` Eric Blake
@ 2010-04-05 15:11             ` Jonathan Nieder
  2010-04-05 15:36               ` Andreas Schwab
  0 siblings, 1 reply; 11+ messages in thread
From: Jonathan Nieder @ 2010-04-05 15:11 UTC (permalink / raw)
  To: Eric Blake; +Cc: Junio C Hamano, git, jon.seymour

From: Eric Blake <eblake@redhat.com>

It is nice to use fewer processes, since forking is so expensive on
cygwin.  So use a case statement instead of expr.

But does that work to have unbalanced ) in a makefile $(shell)?  On
the other hand, this is already in a chunk guarded by $(uname_S) being
cygwin, and we know that cygwin shells understand:

	case '$(uname_R)' in (1.[1-6].*) echo old;; esac

even though it is not portable to other shells, like NetBSD ash.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Eric Blake wrote:
>> Eric Blake wrote:

>>> ifeq ($(shell case '$(uname_R)' in (1.[1-6].*) echo old;; esac),old)
[...]
> Junio mentioned he had already queued your first version of the patch;
> are you going to re-submit it with this tweak?

Since the patch to future-proof the version check has already hit master,
here’s the change as an independent patch against master.

 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index e210a42..767fb66 100644
--- a/Makefile
+++ b/Makefile
@@ -831,7 +831,7 @@ ifeq ($(uname_S),SunOS)
 	BASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__ -DHAVE_ALLOCA_H
 endif
 ifeq ($(uname_O),Cygwin)
-	ifeq ($(shell expr "$(uname_R)" : '1\.[1-6]\.'),4)
+	ifeq ($(shell case '$(uname_R)' in (1.[1-6].*) echo old;; esac),old)
 		NO_D_TYPE_IN_DIRENT = YesPlease
 		NO_D_INO_IN_DIRENT = YesPlease
 		NO_STRCASESTR = YesPlease
-- 
1.7.0.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] Makefile: avoid a fork in Cygwin version check
  2010-04-05 15:11             ` [PATCH] Makefile: avoid a fork in Cygwin version check Jonathan Nieder
@ 2010-04-05 15:36               ` Andreas Schwab
  0 siblings, 0 replies; 11+ messages in thread
From: Andreas Schwab @ 2010-04-05 15:36 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Eric Blake, Junio C Hamano, git, jon.seymour

Jonathan Nieder <jrnieder@gmail.com> writes:

> diff --git a/Makefile b/Makefile
> index e210a42..767fb66 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -831,7 +831,7 @@ ifeq ($(uname_S),SunOS)
>  	BASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__ -DHAVE_ALLOCA_H
>  endif
>  ifeq ($(uname_O),Cygwin)
> -	ifeq ($(shell expr "$(uname_R)" : '1\.[1-6]\.'),4)
> +	ifeq ($(shell case '$(uname_R)' in (1.[1-6].*) echo old;; esac),old)

Even less forks:

        ifneq ($(filter 1.1.% 1.2.% 1.3.% 1.4.% 1.5.% 1.6.%,$(uname_R)),)

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-04-05 15:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-01 22:43 [PATCH] Makefile: update defaults for modern Cygwin Eric Blake
2010-04-02  6:47 ` Junio C Hamano
2010-04-02 14:03   ` Eric Blake
2010-04-03  7:47     ` Jonathan Nieder
2010-04-03 18:28       ` Junio C Hamano
2010-04-03 19:52         ` [PATCH] Teach mailinfo %< as an alternative scissors mark Jonathan Nieder
2010-04-05 13:14       ` [PATCH] Makefile: update defaults for modern Cygwin Eric Blake
2010-04-05 14:30         ` Jonathan Nieder
2010-04-05 14:44           ` Eric Blake
2010-04-05 15:11             ` [PATCH] Makefile: avoid a fork in Cygwin version check Jonathan Nieder
2010-04-05 15:36               ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).