build.sh 732 B

12345678910111213141516171819
  1. #!/bin/bash -eu
  2. # ClusterFuzzLite build script (T4-3): compile every cargo-fuzz target and
  3. # stage the binaries plus any checked-in seed corpus into $OUT.
  4. #
  5. # Hermetic by construction: every target exercises only pure parsers (no
  6. # network, Postgres, or Redis), so the OSS-Fuzz sandbox needs no services.
  7. cd "$SRC/d-oauth-server/fuzz"
  8. cargo fuzz build -O --debug-assertions
  9. for target_path in fuzz_targets/*.rs; do
  10. target="$(basename "$target_path" .rs)"
  11. cp "build/x86_64-unknown-linux-gnu/release/$target" "$OUT/" 2>/dev/null \
  12. || cp "target/x86_64-unknown-linux-gnu/release/$target" "$OUT/"
  13. if [ -d "corpus/$target" ]; then
  14. zip -j "$OUT/${target}_seed_corpus.zip" "corpus/$target/"* 2>/dev/null || true
  15. fi
  16. done