Jens-G opened a new pull request, #3407:
URL: https://github.com/apache/thrift/pull/3407

   ## Summary
   
   Follow-up to #3402 addressing @mhlakhani's request:
   > lowpri: is it possible to have a mode where they are built by make check 
(without fuzz instrumentation)?
   > the reason I ask is e.g. to avoid cases where we make some change to the 
code that breaks the fuzzer build, and then we don't realize it because 
compilation doesn't run in CI
   
   With this PR, `make check` in `lib/netstd` now compiles all 12 fuzzer 
variants (3 protocols × 2 fuzzer types × 2 engines) but skips SharpFuzz IL 
rewriting. Any source change that breaks the fuzzer projects will now fail CI. 
The fully instrumented build suitable for actually running a fuzzer stays 
opt-in.
   
   ## Changes
   
   - **`buildfuzzers.sh`**: new `--no-instrument` flag that skips the 
`SHARPFUZZ_DIR` / `libfuzzer-dotnet` / `sharpfuzz` CLI preflight checks and the 
post-build IL rewriting. Code generation and the 12 `dotnet build` steps still 
run.
   - **`lib/netstd/Makefile.am`**:
     - `check-local` gains a `precompile-fuzzers` dependency that invokes 
`./buildfuzzers.sh --no-instrument`.
     - The existing `build-fuzzers` target is rewritten to delegate to 
`./buildfuzzers.sh` (it previously inlined 12 `dotnet build` commands and 
skipped code generation, which made it fail on a clean tree).
     - `gen-netstd` added to `clean-local`; `buildfuzzers.sh` and 
`runfuzzer.sh` added to `EXTRA_DIST` so `make dist` includes them.
   - **`lib/netstd/README.md`**: Fuzzing section updated to describe the new CI 
behavior.
   
   ## Verification
   
   Tested end-to-end inside the `thrift:jammy` docker image:
   
   - `make check` in `lib/netstd` with `SHARPFUZZ_DIR` unset: 12 fuzzer 
variants build cleanly, existing tests still pass (`Thrift.Tests`: 32 pass, 
`Thrift.IntegrationTests`: 57 pass).
   - Deliberately breaking a fuzzer source file (e.g. changing `class` to 
`clazz` in `TBinaryProtocolAFL.cs`) now fails `make check` at the 
`precompile-fuzzers` step.
   - `./buildfuzzers.sh --foo` rejects unknown flags; `./buildfuzzers.sh 
--no-instrument` exits 0 without needing `SHARPFUZZ_DIR` / `libfuzzer-dotnet` / 
`sharpfuzz`.
   
   ## Test plan
   
   - [x] `make check` builds the 12 fuzzer variants without SharpFuzz tooling 
installed
   - [x] Broken fuzzer source fails `make check`
   - [x] Existing netstd tests still pass
   - [x] `./buildfuzzers.sh` (full flow) unchanged when invoked without 
`--no-instrument`
   
   ---
   
   Co-Authored-By: Claude Opus 4.7 <[email protected]>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to