Skip to contentSkip to conversation

Explicitly set X to avoid potential build breakage

PATCH Superseded Michael 2 participants 2 messages Jun 15, 2016 Kbuild

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Michael

author
#0 lore raw

PATCH 1/1 Explicitly set X to avoid potential build breakage

$X is appended to binary names for Windows builds (ie. git.exe). Pollution from the environment can inadvertently trigger this behaviour, resulting in 'git' turning into 'gitwhatever' without warning.

---
 Makefile |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
Makefile +3 -0
index c457c34..380d96f 100644
@@ -388,6 +388,9 @@ SCRIPT_SH =
 SCRIPT_LIB =
 TEST_PROGRAMS_NEED_X =
 
+# Binary suffix used for Windows builds
+X =
+
 # Having this variable in your environment would break pipelines because
 # you cause "cd" to echo its destination to stdout.  It can also take
 # scripts to unexpected places.  If you like CDPATH, define it for your
Signature · 1 line
1.7.8.4
#1 lore raw
Quoted 5 lines · Michael

$X is appended to binary names for Windows builds (ie. git.exe). Pollution from the environment can inadvertently trigger this behaviour, resulting in 'git' turning into 'gitwhatever' without warning.

Unless there is a compelling reason not to, could we have your name here, not just half a name, please?

It is not particularly a good reason to say "I go by 'Michael' among my friends". The output from "git shortlog -s --author=Michael" shows more than 20 Michaels already, and it would be nice for us if we can easily differenciate you among this group of people you are now joining with this patch.

Quoted 9 lines
---
 Makefile |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
Makefile +0 -0
index c457c34..380d96f 100644

Makefile SCRIPT_SH = · line 393

Quoted 6 lines
Makefile +3 -0
@@ -388,6 +388,9 @@ SCRIPT_SH =
 SCRIPT_LIB =
 TEST_PROGRAMS_NEED_X =
 
+# Binary suffix used for Windows builds
+X =
+

The patch looks good to me, although it might make sense to move it down before this line

	PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))

where it matters most as the documentation of what $X is being used for.