Skip to contentSkip to conversation

mingw: enable NO_PYTHON

PATCH In review Erik Faye-Lund 4 participants 9 messages Jun 15, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mingw: enable NO_PYTHON

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

---

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(-)
Makefile +1 -0
index 1c7668a..a2780a2 100644
@@ -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
Signature · 1 line
1.6.6.95.g82b1b.dirty
#1 lore raw

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.

Quoted 29 lines · Erik Faye-Lund

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

---

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(-)
Makefile +0 -0
index 1c7668a..a2780a2 100644
@@ -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

Signature · 1 line
Erik "kusma" Faye-Lund
#2 lore raw

PATCH 1/1 mingw: disable Python

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

---

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(-)
Makefile +1 -0
index 015bfab..0004c52 100644
@@ -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
Signature · 1 line
1.6.6.90.g50bc9.dirty
#3 lore raw

Re: [PATCH] mingw: disable Python

Makefile ifneq (,$(findstring MINGW,$(uname_S))) · line 1027

Quoted 7 lines · Erik Faye-Lund

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

Makefile +1 -0
@@ -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

#4 lore raw

Re: [PATCH] mingw: disable Python

Hi,

Quoted 11 lines · Johannes Sixt

Makefile ifneq (,$(findstring MINGW,$(uname_S))) · line 1027

Quoted 7 lines · Erik Faye-Lund

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

Makefile +1 -0
@@ -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

#5 lore raw

Re: [PATCH] mingw: disable Python

Quoted 3 lines · Johannes Sixt

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.

Quoted 16 lines · Johannes Schindelin

Hi,

Quoted 11 lines · Johannes Sixt

Makefile ifneq (,$(findstring MINGW,$(uname_S))) · line 1027

Quoted 7 lines · Erik Faye-Lund

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

Makefile +1 -0
@@ -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 6 lines

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.

Signature · 1 line
Erik "kusma" Faye-Lund
#6 lore raw

Re: [PATCH] mingw: disable Python

Quoted 14 lines · Erik Faye-Lund
Quoted 13 lines · Johannes Sixt
Quoted 12 lines

Makefile ifneq (,$(findstring MINGW,$(uname_S))) · line 1027

Quoted 7 lines · Erik Faye-Lund

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

Makefile +1 -0
@@ -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 8 lines
Quoted 5 lines

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< --

#7 lore raw

Re: [PATCH] mingw: disable Python

Quoted 20 lines · Junio C Hamano
Quoted 18 lines · Erik Faye-Lund
Quoted 18 lines · Johannes Sixt
Quoted 5 lines
Quoted 3 lines · Erik Faye-Lund

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

Quoted 7 lines

Makefile ifneq (,$(findstring MINGW,$(uname_S))) · line 1027

Quoted 4 lines
Makefile +1 -0
@@ -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=

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

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 :)

Signature · 1 line
Erik "kusma" Faye-Lund
Acked-by
#8 lore raw

Re: [PATCH] mingw: disable Python

In reply to Junio C Hamano
Quoted 5 lines · Junio C Hamano
Quoted 4 lines · Erik Faye-Lund
Quoted 4 lines · Johannes Sixt
Quoted 1 line

(how do you undefine a Makefile variable?);

How about

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

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:

-- Hannes