Skip to content

Commit 60cfad9

Browse files
avarttaylorr
authored andcommitted
cocci: split off "--all-includes" from SPATCH_FLAGS
Per the rationale in 7b63ea5 (Makefile: remove mandatory "spatch" arguments from SPATCH_FLAGS, 2022-07-05) we have certain flags that are truly mandatory, such as "--sp-file" and "--patch .". The "--all-includes" flag is also critical, but per [1] we might want to ad-hoc tweak it occasionally for testing or one-offs. But being unable to set e.g. SPATCH_FLAGS="--verbose-parsing" without breaking how our "spatch" works isn't ideal, i.e. before this we'd need to know about the default include flags, and specify: SPATCH_FLAGS="--all-includes --verbose-parsing". If we were then to change the default include flag (e.g. to "--recursive-includes") in the future any such one-off commands would need to be correspondingly updated. Let's instead leave the SPATCH_FLAGS for the user, while creating a new SPATCH_INCLUDE_FLAGS to allow for ad-hoc testing of the include strategy itself. 1. https://lore.kernel.org/git/[email protected]/ Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent b75f270 commit 60cfad9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1295,7 +1295,8 @@ SANITIZE_LEAK =
12951295
SANITIZE_ADDRESS =
12961296

12971297
# For the 'coccicheck' target
1298-
SPATCH_FLAGS = --all-includes
1298+
SPATCH_INCLUDE_FLAGS = --all-includes
1299+
SPATCH_FLAGS =
12991300
SPATCH_TEST_FLAGS =
13001301
# Setting SPATCH_BATCH_SIZE higher will
13011302
# usually result in less CPU usage at the cost of higher peak memory.
@@ -1305,6 +1306,7 @@ SPATCH_BATCH_SIZE = 1
13051306
# Rebuild 'coccicheck' if $(SPATCH), its flags etc. change
13061307
TRACK_SPATCH_DEFINES =
13071308
TRACK_SPATCH_DEFINES += $(SPATCH)
1309+
TRACK_SPATCH_DEFINES += $(SPATCH_INCLUDE_FLAGS)
13081310
TRACK_SPATCH_DEFINES += $(SPATCH_FLAGS)
13091311
TRACK_SPATCH_DEFINES += $(SPATCH_TEST_FLAGS)
13101312
TRACK_SPATCH_DEFINES += $(SPATCH_BATCH_SIZE)
@@ -3177,6 +3179,7 @@ $(COCCI_PATCHES): %.patch: %
31773179
fi; \
31783180
if ! echo $(COCCI_SOURCES) | xargs $$limit \
31793181
$(SPATCH) $(SPATCH_FLAGS) \
3182+
$(SPATCH_INCLUDE_FLAGS) \
31803183
--sp-file $< --patch . \
31813184
>$@+ 2>$@.log; \
31823185
then \

0 commit comments

Comments
 (0)