fuzz: rebuild everything during each oss-fuzz build
authorJonathan Rudenberg <jonathan@titanous.com>
Tue, 16 Jan 2018 13:36:56 +0000 (08:36 -0500)
committerJonathan Rudenberg <jonathan@titanous.com>
Wed, 17 Jan 2018 18:57:06 +0000 (13:57 -0500)
This avoids failures while using the oss-fuzz local testing
infrastructure.

scripts/oss-fuzz.sh

index b0cd404..beb9d05 100755 (executable)
@@ -20,17 +20,24 @@ set -ex
 
 export LC_CTYPE=C.UTF-8
 
-meson $WORK -Doss-fuzz=true -Db_lundef=false
-ninja -C $WORK fuzzers
+if [ -z "$WORK" ]; then
+         echo '$WORK must be set'
+         exit 1
+fi
+build=$WORK/build
+rm -rf $build
+mkdir -p $build
+
+meson $build -Doss-fuzz=true -Db_lundef=false
+ninja -C $build fuzzers
 
 # get DNS packet corpus
-df=$WORK/dns-fuzzing
-rm -rf $df
+df=$build/dns-fuzzing
 git clone --depth 1 https://github.com/CZ-NIC/dns-fuzzing $df
 zip -jqr $OUT/fuzz-dns-packet_seed_corpus.zip $df/packet
 
 mkdir -p $OUT/src/shared
-mv $WORK/src/shared/libsystemd-shared-*.so $OUT/src/shared
+mv $build/src/shared/libsystemd-shared-*.so $OUT/src/shared
 
-find $WORK -maxdepth 1 -type f -executable -name "fuzz-*" -exec mv {} $OUT \;
-mv $WORK/*.so src/fuzz/*.options $OUT
+find $build -maxdepth 1 -type f -executable -name "fuzz-*" -exec mv {} $OUT \;
+mv $build/*.so src/fuzz/*.options $OUT