[PATCH] mingw: enable NO_PYTHON

Subsystems: kernel build + files below scripts/ (unless maintained elsewhere), the rest

DORMANTno replies

9 messages, 4 authors, 2016-06-15 · open the first message on its own page

[PATCH] mingw: enable NO_PYTHON

From: Erik Faye-Lund <hidden>
Date: 2016-06-15 22:47:59

Python is not commonly installed on Windows machines, so
we should disable it there by default.

Signed-off-by: Erik Faye-Lund <redacted>
---

This patch is against Junio's current master, and enables
msysgit to compile upstream git again after Sverre's addition
of the python remote-helpers (2fe40b6).

 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
index 1c7668a..a2780a2 100644
--- a/Makefile
+++ b/Makefile
@@ -1028,6 +1028,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
 	BLK_SHA1 = YesPlease
 	NO_INET_PTON = YesPlease
 	NO_INET_NTOP = YesPlease
+	NO_PYTHON = YesPlease
 	COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/fnmatch
 	COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
 	COMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/winansi.o
-- 
1.6.6.95.g82b1b.dirty

Re: [PATCH] mingw: enable NO_PYTHON

From: Erik Faye-Lund <hidden>
Date: 2016-06-15 22:47:59

Uhm, I just realized that I sent out a patch that wasn't clean against
Junio's master after all. I'll send out a fixed one ASAP.

Sorry about the noise.

On Thu, Jan 7, 2010 at 10:52 PM, Erik Faye-Lund
[off-list ref] wrote:
quoted hunk
Python is not commonly installed on Windows machines, so
we should disable it there by default.

Signed-off-by: Erik Faye-Lund <redacted>
---

This patch is against Junio's current master, and enables
msysgit to compile upstream git again after Sverre's addition
of the python remote-helpers (2fe40b6).

 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
index 1c7668a..a2780a2 100644
--- a/Makefile
+++ b/Makefile
@@ -1028,6 +1028,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
       BLK_SHA1 = YesPlease
       NO_INET_PTON = YesPlease
       NO_INET_NTOP = YesPlease
+       NO_PYTHON = YesPlease
       COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/fnmatch
       COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
       COMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/winansi.o
--
1.6.6.95.g82b1b.dirty


-- 
Erik "kusma" Faye-Lund

[PATCH] mingw: disable Python

From: Erik Faye-Lund <hidden>
Date: 2016-06-15 22:47:59

Python is not commonly installed on Windows machines, so
we should disable it there by default.

Signed-off-by: Erik Faye-Lund <redacted>
---

This patch is against Junio's current master, and enables
msysgit to compile upstream git again after Sverre's addition
of the python remote-helpers (2fe40b6).

 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
index 015bfab..0004c52 100644
--- a/Makefile
+++ b/Makefile
@@ -1027,6 +1027,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
 	OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
 	NO_REGEX = YesPlease
 	BLK_SHA1 = YesPlease
+	NO_PYTHON = YesPlease
 	COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/fnmatch
 	COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
 	COMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/winansi.o
-- 
1.6.6.90.g50bc9.dirty

Re: [PATCH] mingw: disable Python

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:47:59

Erik Faye-Lund schrieb:
quoted hunk
Python is not commonly installed on Windows machines, so
we should disable it there by default.
--- a/Makefile
+++ b/Makefile
@@ -1027,6 +1027,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
+	NO_PYTHON = YesPlease
I'm worried that with this solution it is impossible to re-enable Python
in config.mak (how do you undefine a Makefile variable?); it would be
necessary to hack Makefile.

Wouldn't it be superior to set

	PYTHON_PATH =

in the MinGW section[*]. It works because there is this heuristic later:

ifeq ($(PYTHON_PATH),)
NO_PYTHON=NoThanks
endif

To enable Python, the user would have to set PYTHON_PATH in config.mak.

[I have only Python 1.6 to test (doh!), so I can only tell that it gets
used during 'make', but this fails due to missing modules, so I cannot
tell whether there would be a usable result if Python were sufficiently
recent.]

[*] You should probably set the MSVC section as well, even if you cannot
test it. The effect of the change is predictable enough, I think.

-- Hannes

Re: [PATCH] mingw: disable Python

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:47:59

Hi,

On Fri, 8 Jan 2010, Johannes Sixt wrote:
Erik Faye-Lund schrieb:
quoted
Python is not commonly installed on Windows machines, so
we should disable it there by default.
--- a/Makefile
+++ b/Makefile
@@ -1027,6 +1027,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
+	NO_PYTHON = YesPlease
I'm worried that with this solution it is impossible to re-enable Python
in config.mak (how do you undefine a Makefile variable?);
How about

	NO_PYTHON=

in config.mak?

Ciao,
Dscho

Re: [PATCH] mingw: disable Python

From: Erik Faye-Lund <hidden>
Date: 2016-06-15 22:47:59

On Fri, Jan 8, 2010 at 9:07 AM, Johannes Sixt [off-list ref] wrote:
Wouldn't it be superior to set

       PYTHON_PATH =
Yes, I think it would. I've tested it (I've got Python 2.6 installed
in c:\Python26\, so with your fix I can re-enable it by setting
"PYTHON_PATH=/c/Python26/python.exe" in config.mak.

On Fri, Jan 8, 2010 at 11:35 AM, Johannes Schindelin
[off-list ref] wrote:
Hi,

On Fri, 8 Jan 2010, Johannes Sixt wrote:
quoted
Erik Faye-Lund schrieb:
quoted
Python is not commonly installed on Windows machines, so
we should disable it there by default.
--- a/Makefile
+++ b/Makefile
@@ -1027,6 +1027,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
+   NO_PYTHON = YesPlease
I'm worried that with this solution it is impossible to re-enable Python
in config.mak (how do you undefine a Makefile variable?);
How about

       NO_PYTHON=

in config.mak?
That doesn't work for me, at least not out of the box. NO_PYTHON is
still defined, it's just defined to an empty string. I guess we could
change to Makefile to accept empty NO_PYTHON as enabled, but since
Hannes' suggestion works fine, I think I'll stick with it, even if
it's a little inconsistent with the other stuff in the MinGW-section
of Makefile.

I'll resend a bit later.

-- 
Erik "kusma" Faye-Lund

Re: [PATCH] mingw: disable Python

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:47:59

Erik Faye-Lund [off-list ref] writes:
quoted
On Fri, 8 Jan 2010, Johannes Sixt wrote:
quoted
Erik Faye-Lund schrieb:
quoted
Python is not commonly installed on Windows machines, so
we should disable it there by default.
--- a/Makefile
+++ b/Makefile
@@ -1027,6 +1027,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
+   NO_PYTHON = YesPlease
I'm worried that with this solution it is impossible to re-enable Python
in config.mak (how do you undefine a Makefile variable?);
quoted
How about

       NO_PYTHON=

in config.mak?
That doesn't work for me, at least not out of the box. NO_PYTHON is
still defined, it's just defined to an empty string.
I think Dscho is right.  "ifdef FOO" yields (and should yield) false if
FOO is set to empty.

-- >8 -- cut here and try it for yourself -- >8 --
#!/bin/sh

rm -f config.mk

cat >Makefile <<\EOF
# The default is...
all::
FROTZ = NITFOL
-include config.mk
ifdef FROTZ
all::
	echo FROTZ is $(FROTZ)
else
all::
	echo FROTZ is not defined
endif
EOF

make
# says "NITFOL"

echo "FROTZ =" >config.mk
make
# says "not defined"

exit
-- 8< --

Re: [PATCH] mingw: disable Python

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:47:59

Junio C Hamano schrieb:
Erik Faye-Lund [off-list ref] writes:
quoted
quoted
On Fri, 8 Jan 2010, Johannes Sixt wrote:
quoted
(how do you undefine a Makefile variable?);
How about

       NO_PYTHON=

in config.mak?
That doesn't work for me, at least not out of the box. NO_PYTHON is
still defined, it's just defined to an empty string.
I think Dscho is right.  "ifdef FOO" yields (and should yield) false if
FOO is set to empty.
Indeed. Strange. It didn't work when I tested it a few hours ago, but no
it works as you say. According to the docs, 'ifdef' actually does not test
defined-ness, but emptyness. So, Erik's original version is fine:

Acked-by: Johannes Sixt <redacted>

-- Hannes

Re: [PATCH] mingw: disable Python

From: Erik Faye-Lund <hidden>
Date: 2016-06-15 22:47:59

On Fri, Jan 8, 2010 at 2:35 PM, Junio C Hamano [off-list ref] wrote:
Erik Faye-Lund [off-list ref] writes:
quoted
quoted
On Fri, 8 Jan 2010, Johannes Sixt wrote:
quoted
Erik Faye-Lund schrieb:
quoted
Python is not commonly installed on Windows machines, so
we should disable it there by default.
--- a/Makefile
+++ b/Makefile
@@ -1027,6 +1027,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
+   NO_PYTHON = YesPlease
I'm worried that with this solution it is impossible to re-enable Python
in config.mak (how do you undefine a Makefile variable?);
quoted
How about

       NO_PYTHON=

in config.mak?
That doesn't work for me, at least not out of the box. NO_PYTHON is
still defined, it's just defined to an empty string.
I think Dscho is right.  "ifdef FOO" yields (and should yield) false if
FOO is set to empty.
In that case I guess I messed up my test. I'll retest.

Yes, I messed up. "NO_PYTHON=" works like a charm.

So, no repost :)

-- 
Erik "kusma" Faye-Lund
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help