git@vger.kernel.org mailing list mirror (one of many)
 help / Atom feed
* [PATCH 0/3] mingw: require Windows Vista or later (and fix the Windows CI builds)
@ 2018-10-03 19:43 Johannes Schindelin via GitGitGadget
  2018-10-03 19:43 ` [PATCH 1/3] compat/poll: prepare for targeting Windows Vista Johannes Schindelin via GitGitGadget
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2018-10-03 19:43 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

I noticed that a recent GitGitGadget build failed in the Windows phase, with
compat/poll/poll.h problems all over the place.

Turns out that this is caused by the recent upgrade of the mingw-w64 headers
and crt files (7.0.0.5233.e0c09544 -> 7.0.0.5245.edf66197, which I assume
now enforces Vista as minimal Windows version also for all mingw-w64
projects).

Luckily, in Git for Windows' master, we already had changes to require Vista
(for unrelated reasons: to restrict the std handle inheritance when spawning
new processes).

Technically, Windows Vista is already no longer supported
[https://support.microsoft.com/en-us/help/22882/windows-vista-end-of-support]
, but we do try to keep Git building on older Windows version, up until the
point when it becomes too big of a maintenance burden.

Johannes Schindelin (3):
  compat/poll: prepare for targeting Windows Vista
  mingw: set _WIN32_WINNT explicitly for Git for Windows
  mingw: bump the minimum Windows version to Vista

 compat/poll/poll.c |  6 +++---
 compat/poll/poll.h | 15 +++++++++++++++
 config.mak.uname   |  4 ----
 git-compat-util.h  |  4 ++--
 4 files changed, 20 insertions(+), 9 deletions(-)


base-commit: fe8321ec057f9231c26c29b364721568e58040f7
Published-As: https://github.com/gitgitgadget/git/releases/tags/pr-44%2Fdscho%2Frequire-windows-vista-or-later-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-44/dscho/require-windows-vista-or-later-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/44
-- 
gitgitgadget

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

* [PATCH 1/3] compat/poll: prepare for targeting Windows Vista
  2018-10-03 19:43 [PATCH 0/3] mingw: require Windows Vista or later (and fix the Windows CI builds) Johannes Schindelin via GitGitGadget
@ 2018-10-03 19:43 ` Johannes Schindelin via GitGitGadget
  2018-10-03 19:43 ` [PATCH 2/3] mingw: set _WIN32_WINNT explicitly for Git for Windows Johannes Schindelin via GitGitGadget
  2018-10-03 19:43 ` [PATCH 3/3] mingw: bump the minimum Windows version to Vista Johannes Schindelin via GitGitGadget
  2 siblings, 0 replies; 6+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2018-10-03 19:43 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Windows Vista (and later) actually have a working poll(), but we still
cannot use it because it only works on sockets.

So let's detect when we are targeting Windows Vista and undefine those
constants, and define `pollfd` so that we can declare our own pollfd
struct.

We also need to make sure that we override those constants *after*
`winsock2.h` has been `#include`d (otherwise we would not really
override those constants).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 compat/poll/poll.c |  6 +++---
 compat/poll/poll.h | 15 +++++++++++++++
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/compat/poll/poll.c b/compat/poll/poll.c
index 7ed3fbbea1..ad5dcde439 100644
--- a/compat/poll/poll.c
+++ b/compat/poll/poll.c
@@ -29,9 +29,6 @@
 
 #include <sys/types.h>
 
-/* Specification.  */
-#include <poll.h>
-
 #include <errno.h>
 #include <limits.h>
 #include <assert.h>
@@ -55,6 +52,9 @@
 # include <unistd.h>
 #endif
 
+/* Specification.  */
+#include "poll.h"
+
 #ifdef HAVE_SYS_IOCTL_H
 # include <sys/ioctl.h>
 #endif
diff --git a/compat/poll/poll.h b/compat/poll/poll.h
index cd1995292a..1e1597360f 100644
--- a/compat/poll/poll.h
+++ b/compat/poll/poll.h
@@ -21,6 +21,21 @@
 #ifndef _GL_POLL_H
 #define _GL_POLL_H
 
+#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x600
+/* Vista has its own, socket-only poll() */
+#undef POLLIN
+#undef POLLPRI
+#undef POLLOUT
+#undef POLLERR
+#undef POLLHUP
+#undef POLLNVAL
+#undef POLLRDNORM
+#undef POLLRDBAND
+#undef POLLWRNORM
+#undef POLLWRBAND
+#define pollfd compat_pollfd
+#endif
+
 /* fake a poll(2) environment */
 #define POLLIN      0x0001      /* any readable data available   */
 #define POLLPRI     0x0002      /* OOB/Urgent readable data      */
-- 
gitgitgadget


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

* [PATCH 2/3] mingw: set _WIN32_WINNT explicitly for Git for Windows
  2018-10-03 19:43 [PATCH 0/3] mingw: require Windows Vista or later (and fix the Windows CI builds) Johannes Schindelin via GitGitGadget
  2018-10-03 19:43 ` [PATCH 1/3] compat/poll: prepare for targeting Windows Vista Johannes Schindelin via GitGitGadget
@ 2018-10-03 19:43 ` Johannes Schindelin via GitGitGadget
  2018-10-03 19:43 ` [PATCH 3/3] mingw: bump the minimum Windows version to Vista Johannes Schindelin via GitGitGadget
  2 siblings, 0 replies; 6+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2018-10-03 19:43 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Previously, we only ever declared a target Windows version if compiling
with Visual C.

Which meant that we were relying on the MinGW headers to guess which
Windows version we want to target...

Let's be explicit about it, in particular because we actually want to
bump the target Windows version to Vista (which we will do in the next
commit).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 git-compat-util.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-compat-util.h b/git-compat-util.h
index 5f2e90932f..3ba93d9c15 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -146,7 +146,7 @@
 #define _SGI_SOURCE 1
 
 #if defined(WIN32) && !defined(__CYGWIN__) /* Both MinGW and MSVC */
-# if defined (_MSC_VER) && !defined(_WIN32_WINNT)
+# if !defined(_WIN32_WINNT)
 #  define _WIN32_WINNT 0x0502
 # endif
 #define WIN32_LEAN_AND_MEAN  /* stops windows.h including winsock.h */
-- 
gitgitgadget


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

* [PATCH 3/3] mingw: bump the minimum Windows version to Vista
  2018-10-03 19:43 [PATCH 0/3] mingw: require Windows Vista or later (and fix the Windows CI builds) Johannes Schindelin via GitGitGadget
  2018-10-03 19:43 ` [PATCH 1/3] compat/poll: prepare for targeting Windows Vista Johannes Schindelin via GitGitGadget
  2018-10-03 19:43 ` [PATCH 2/3] mingw: set _WIN32_WINNT explicitly for Git for Windows Johannes Schindelin via GitGitGadget
@ 2018-10-03 19:43 ` Johannes Schindelin via GitGitGadget
  2018-10-10 14:08   ` Ævar Arnfjörð Bjarmason
  2 siblings, 1 reply; 6+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2018-10-03 19:43 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Quite some time ago, a last plea to the XP users out there who want to
see Windows XP support in Git for Windows, asking them to get engaged
and help, vanished into the depths of the universe.

We tried for a long time to play nice with the last remaining XP users
who somehow manage to build Git from source, but a recent update of
mingw-w64 (7.0.0.5233.e0c09544 -> 7.0.0.5245.edf66197) finally dropped
the last sign of XP support, and Git for Windows' SDK is no longer able
to build core Git's `master` branch as a consequence. (Git for Windows'
`master` branch already bumped the minimum Windows version to Vista a
while ago, so it is fine.)

It is time to require Windows Vista or later to build Git from source.
This, incidentally, lets us use quite a few nice new APIs.

It also means that we no longer need the inet_pton() and inet_ntop()
emulation, which is nice.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 config.mak.uname  | 4 ----
 git-compat-util.h | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/config.mak.uname b/config.mak.uname
index e47af72e01..8acdeb71fd 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -381,8 +381,6 @@ ifeq ($(uname_S),Windows)
 	NO_PYTHON = YesPlease
 	BLK_SHA1 = YesPlease
 	ETAGS_TARGET = ETAGS
-	NO_INET_PTON = YesPlease
-	NO_INET_NTOP = YesPlease
 	NO_POSIX_GOODIES = UnfortunatelyYes
 	NATIVE_CRLF = YesPlease
 	DEFAULT_HELP_FORMAT = html
@@ -529,8 +527,6 @@ ifneq (,$(findstring MINGW,$(uname_S)))
 	NO_REGEX = YesPlease
 	NO_PYTHON = YesPlease
 	ETAGS_TARGET = ETAGS
-	NO_INET_PTON = YesPlease
-	NO_INET_NTOP = YesPlease
 	NO_POSIX_GOODIES = UnfortunatelyYes
 	DEFAULT_HELP_FORMAT = html
 	COMPAT_CFLAGS += -DNOGDI -Icompat -Icompat/win32
diff --git a/git-compat-util.h b/git-compat-util.h
index 3ba93d9c15..48c955541e 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -147,7 +147,7 @@
 
 #if defined(WIN32) && !defined(__CYGWIN__) /* Both MinGW and MSVC */
 # if !defined(_WIN32_WINNT)
-#  define _WIN32_WINNT 0x0502
+#  define _WIN32_WINNT 0x0600
 # endif
 #define WIN32_LEAN_AND_MEAN  /* stops windows.h including winsock.h */
 #include <winsock2.h>
-- 
gitgitgadget

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

* Re: [PATCH 3/3] mingw: bump the minimum Windows version to Vista
  2018-10-03 19:43 ` [PATCH 3/3] mingw: bump the minimum Windows version to Vista Johannes Schindelin via GitGitGadget
@ 2018-10-10 14:08   ` Ævar Arnfjörð Bjarmason
  2018-10-11  6:24     ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2018-10-10 14:08 UTC (permalink / raw)
  To: Johannes Schindelin via GitGitGadget
  Cc: git, Junio C Hamano, Johannes Schindelin


On Wed, Oct 03 2018, Johannes Schindelin via GitGitGadget wrote:

> Quite some time ago, a last plea to the XP users out there who want to
> see Windows XP support in Git for Windows, asking them to get engaged
> and help, vanished into the depths of the universe.
>
> We tried for a long time to play nice with the last remaining XP users
> who somehow manage to build Git from source, but a recent update of
> mingw-w64 (7.0.0.5233.e0c09544 -> 7.0.0.5245.edf66197) finally dropped
> the last sign of XP support, and Git for Windows' SDK is no longer able
> to build core Git's `master` branch as a consequence. (Git for Windows'
> `master` branch already bumped the minimum Windows version to Vista a
> while ago, so it is fine.)
>
> It is time to require Windows Vista or later to build Git from source.
> This, incidentally, lets us use quite a few nice new APIs.
>
> It also means that we no longer need the inet_pton() and inet_ntop()
> emulation, which is nice.

Earlier in this series you add a:

#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x600
...
#endif

Shouldn't that now be something like:

#if defined(_WIN32_WINNT)
#if _WIN32_WINNT >= 0x600
...
#else
#error "You need at least Windows Vista to build Git!"
#endif
#endif

Or do we catch users building on non-supported versions earlier somehow
(i.e. not just with a flood of compilation errors).

> diff --git a/config.mak.uname b/config.mak.uname
> index e47af72e01..8acdeb71fd 100644
> --- a/config.mak.uname
> +++ b/config.mak.uname
> @@ -381,8 +381,6 @@ ifeq ($(uname_S),Windows)
>  	NO_PYTHON = YesPlease
>  	BLK_SHA1 = YesPlease
>  	ETAGS_TARGET = ETAGS
> -	NO_INET_PTON = YesPlease
> -	NO_INET_NTOP = YesPlease
>  	NO_POSIX_GOODIES = UnfortunatelyYes
>  	NATIVE_CRLF = YesPlease
>  	DEFAULT_HELP_FORMAT = html
> @@ -529,8 +527,6 @@ ifneq (,$(findstring MINGW,$(uname_S)))
>  	NO_REGEX = YesPlease
>  	NO_PYTHON = YesPlease
>  	ETAGS_TARGET = ETAGS
> -	NO_INET_PTON = YesPlease
> -	NO_INET_NTOP = YesPlease
>  	NO_POSIX_GOODIES = UnfortunatelyYes
>  	DEFAULT_HELP_FORMAT = html
>  	COMPAT_CFLAGS += -DNOGDI -Icompat -Icompat/win32

So before we were defining NO_INET_{PTON,NTOP} because XP needed it, but
doing so on all Windows versions, is there other compat stuff there
that's just catering to the lowest common denominator, and if so
shouldn't that be version checked against the NT version?

Both of the above are just questions I was curious about since I saw
your <nycvar.QRO.7.76.6.1810101502220.2034@tvgsbejvaqbjf.bet>, and
shouldn't bee seen as bumping this to "this needs a re-roll" or it
should be delayed in getting to master.

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

* Re: [PATCH 3/3] mingw: bump the minimum Windows version to Vista
  2018-10-10 14:08   ` Ævar Arnfjörð Bjarmason
@ 2018-10-11  6:24     ` Junio C Hamano
  0 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2018-10-11  6:24 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Johannes Schindelin via GitGitGadget, git, Johannes Schindelin

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

>> It also means that we no longer need the inet_pton() and inet_ntop()
>> emulation, which is nice.
>
> Earlier in this series you add a:
>
> #if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x600
> ...
> #endif
>
> Shouldn't that now be something like:
>
> #if defined(_WIN32_WINNT)
> #if _WIN32_WINNT >= 0x600
> ...
> #else
> #error "You need at least Windows Vista to build Git!"
> #endif
> #endif
>
> Or do we catch users building on non-supported versions earlier somehow
> (i.e. not just with a flood of compilation errors).

That sounds like a reasonable thing to be curious about.

> Both of the above are just questions I was curious about since I saw
> your <nycvar.QRO.7.76.6.1810101502220.2034@tvgsbejvaqbjf.bet>, and
> shouldn't bee seen as bumping this to "this needs a re-roll" or it
> should be delayed in getting to master.

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

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-03 19:43 [PATCH 0/3] mingw: require Windows Vista or later (and fix the Windows CI builds) Johannes Schindelin via GitGitGadget
2018-10-03 19:43 ` [PATCH 1/3] compat/poll: prepare for targeting Windows Vista Johannes Schindelin via GitGitGadget
2018-10-03 19:43 ` [PATCH 2/3] mingw: set _WIN32_WINNT explicitly for Git for Windows Johannes Schindelin via GitGitGadget
2018-10-03 19:43 ` [PATCH 3/3] mingw: bump the minimum Windows version to Vista Johannes Schindelin via GitGitGadget
2018-10-10 14:08   ` Ævar Arnfjörð Bjarmason
2018-10-11  6:24     ` Junio C Hamano

git@vger.kernel.org mailing list mirror (one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox