Skip to contentSkip to conversation

make: don't spray static check failures all over the subdir build

PATCH In review Darrick J. Wong 2 participants 3 messages Nov 10, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 make: don't spray static check failures all over the subdir build

From: Darrick J. Wong <[email protected]>

Debian package building is special -- it directly calls make -C libxfs when building the debian-installer packages. This means that any variables we define in the top level Makefile don't get passed down to subdir make processes.

This means that the new static checker support effectively runs the first argument in $(CFLAGS) as a command, which is surprising. Fix up buildrules to patch out CHECK_CMD if nobody's defined it, so that direct subdir make works again.

---
 include/buildrules |    4 ++++
 1 file changed, 4 insertions(+)
include/buildrules +4 -0
index 83dfe05b..5c3e6eb9 100644
@@ -36,6 +36,10 @@ $(SUBDIRS):
 	$(Q)$(MAKE) $(MAKEOPTS) -q -C $@ || $(MAKE) $(MAKEOPTS) -C $@
 endif
 
+ifndef CHECK_CMD
+CHECK_CMD = @true
+endif
+
 #
 # Standard targets
 #
Reviewed-by on v1 1/1
#1 lore raw
Quoted 22 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

Debian package building is special -- it directly calls make -C libxfs when building the debian-installer packages. This means that any variables we define in the top level Makefile don't get passed down to subdir make processes.

This means that the new static checker support effectively runs the first argument in $(CFLAGS) as a command, which is surprising. Fix up buildrules to patch out CHECK_CMD if nobody's defined it, so that direct subdir make works again.

---
 include/buildrules |    4 ++++
 1 file changed, 4 insertions(+)
include/buildrules +0 -0
index 83dfe05b..5c3e6eb9 100644

include/buildrules $(SUBDIRS): · line 42

Quoted 7 lines
include/buildrules +4 -0
@@ -36,6 +36,10 @@ $(SUBDIRS):
 	$(Q)$(MAKE) $(MAKEOPTS) -q -C $@ || $(MAKE) $(MAKEOPTS) -C $@
 endif
 
+ifndef CHECK_CMD
+CHECK_CMD = @true
+endif
+

Hm, ok, not quite clear if this is a hack or a proper fix - maybe all the check stuff should have gone into buildrules in the first place? But at this late stage in the game, it's probably good enough.

Thanks,
-eric

#2 lore raw
Quoted 26 lines · Eric Sandeen
Quoted 25 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

Debian package building is special -- it directly calls make -C libxfs when building the debian-installer packages. This means that any variables we define in the top level Makefile don't get passed down to subdir make processes.

This means that the new static checker support effectively runs the first argument in $(CFLAGS) as a command, which is surprising. Fix up buildrules to patch out CHECK_CMD if nobody's defined it, so that direct subdir make works again.

---
 include/buildrules |    4 ++++
 1 file changed, 4 insertions(+)
include/buildrules +0 -0
index 83dfe05b..5c3e6eb9 100644
@@ -36,6 +36,10 @@ $(SUBDIRS):
 	$(Q)$(MAKE) $(MAKEOPTS) -q -C $@ || $(MAKE) $(MAKEOPTS) -C $@
 endif
 
Quoted 8 lines

include/buildrules $(SUBDIRS): · line 42

Quoted 4 lines
include/buildrules +4 -0
+ifndef CHECK_CMD
+CHECK_CMD = @true
+endif
+

Hm, ok, not quite clear if this is a hack or a proper fix - maybe all the check stuff should have gone into buildrules in the first place? But at this late stage in the game, it's probably good enough.

It's a stupid hack, but if CFLAGS=-g -O2 -Wall and someone runs "make -C repair" instead of "make repair" then make will foolishly run "g -O2 -Wall", whatever that does. command-not-found tells me there's no known "g" command.

As for debian builds we probably should just update debian/rules to something more modern.

--D

Quoted 4 lines

Thanks,
-eric