diff mbox series

[v2,1/6] Makefile: remove "all" on "$(FUZZ_OBJS)"

Message ID 20210201111715.10200-2-avarab@gmail.com (mailing list archive)
State New, archived
Headers show
Series [v2,1/6] Makefile: remove "all" on "$(FUZZ_OBJS)" | expand

Commit Message

Ævar Arnfjörð Bjarmason Feb. 1, 2021, 11:17 a.m. UTC
Adding this as a dependency was intentionally done in
5e472150800 (fuzz: add basic fuzz testing target., 2018-10-12).

I don't see why we need to prevent bitrot here under "all" for these
in particular, but not e.g. contrib/credential/**/*.c

In any case, these files are rather trivial and from their commit log
it seems the fuzz-all target is run by a few people already.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 Makefile | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Jeff King Feb. 4, 2021, 6:51 a.m. UTC | #1
On Mon, Feb 01, 2021 at 12:17:10PM +0100, Ævar Arnfjörð Bjarmason wrote:

> Adding this as a dependency was intentionally done in
> 5e472150800 (fuzz: add basic fuzz testing target., 2018-10-12).
> 
> I don't see why we need to prevent bitrot here under "all" for these
> in particular, but not e.g. contrib/credential/**/*.c
> 
> In any case, these files are rather trivial and from their commit log
> it seems the fuzz-all target is run by a few people already.

Part of me wants to love this commit, because I don't care about the
fuzz code (since I don't run it myself[1]).

But looking at "git log fuzz-*.c", I do think it will lead to bitrot.
Many of those commits are things that do not care about fuzzing, but
were just fixing up function interfaces as we go (e.g., my c8828530b,
though see [2]).

The difference between contrib/credential/ and this is that those
credential helpers do not rely on the rest of the source. They are
independent programs that can be built totally out of tree.

So I dunno. This puts the responsibility for fixing bitrot onto the
people who actually use them, which is nice. But often times it is
easier for the person making the original change to just fix them up
along with the others (because they understand the point of the change
better, and also because a bunch of rot doesn't accrue over time).

-Peff

[1] I just ran "make fuzz-all", and it barfed at the link step. It looks
    like I need to specify a bunch of llvm stuff manually. So no, I'd
    guess not a lot of people are running this. :)

[2] That one is particularly egregious because it fixed a copy-pasted
    version of a public function header. Yuck.
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 4edfda3e009..65e600713c1 100644
--- a/Makefile
+++ b/Makefile
@@ -667,9 +667,6 @@  FUZZ_OBJS += fuzz-commit-graph.o
 FUZZ_OBJS += fuzz-pack-headers.o
 FUZZ_OBJS += fuzz-pack-idx.o
 
-# Always build fuzz objects even if not testing, to prevent bit-rot.
-all:: $(FUZZ_OBJS)
-
 FUZZ_PROGRAMS += $(patsubst %.o,%,$(FUZZ_OBJS))
 
 # Empty...
@@ -3321,4 +3318,4 @@  $(FUZZ_PROGRAMS): all
 	$(QUIET_LINK)$(CXX) $(FUZZ_CXXFLAGS) $(LIB_OBJS) $(BUILTIN_OBJS) \
 		$(XDIFF_OBJS) $(EXTLIBS) git.o $@.o $(LIB_FUZZING_ENGINE) -o $@
 
-fuzz-all: $(FUZZ_PROGRAMS)
+fuzz-all: $(FUZZ_PROGRAMS) $(FUZZ_OBJS)