Without -DBUILD_FOR_FUZZING
the fuzz binary is less suited for testing puporses, because it won’t crash on Assume
and it won’t work around fuzz blockers with FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
. Afaict, the only place where the fuzz binary is currently used without -DBUILD_FOR_FUZZING
is in the macOS and windows CI jobs.
I would like to propose that we split the CI jobs into separate fuzz-only jobs that use -DBUILD_FOR_FUZZING
and that we remove support for building the fuzz binary without it.
Historically, we used to build most binaries by default (including the fuzz binary) to ensure that compile failures are caught early by devs. With the switch to CMake this is no longer the case and imo that’s fine since compile failures would be caught by the CI or other devs that regularly fuzz.
This would also avoid the need for workarounds like #31028.