Skip to content

Commit d161682

Browse files
committed
Fuzzing: Move LPM build to oss-fuzz Dockerfile by default
1 parent b975bab commit d161682

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

fuzzing/scripts/oss-fuzz-build.sh

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,6 @@ cmake \
2929
make -j $(nproc)
3030
make install
3131

32-
cd ${SRC}/libprotobuf-mutator
33-
cmake \
34-
-DCMAKE_C_COMPILER=clang \
35-
-DCMAKE_CXX_COMPILER=clang++ \
36-
-DCMAKE_BUILD_TYPE=Debug \
37-
-DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON \
38-
-DLIB_PROTO_MUTATOR_EXAMPLES=OFF \
39-
-DLIB_PROTO_MUTATOR_TESTING=OFF \
40-
.
41-
make -j $(nproc)
42-
make install
43-
4432
# Build broker and library static libraries
4533
cd ${SRC}/mosquitto
4634
make \

fuzzing/scripts/oss-fuzz-dependencies.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,13 @@ apt-get update && apt-get install -y \
3434
ninja-build \
3535
pkg-config
3636
git clone https://github.com/ralight/cJSON ${SRC}/cJSON
37-
git clone https://github.com/google/libprotobuf-mutator ${SRC}/libprotobuf-mutator
3837

39-
mkdir ${SRC}/LPM
40-
cd ${SRC}/LPM
41-
cmake ../libprotobuf-mutator -GNinja -DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON -DLIB_PROTO_MUTATOR_TESTING=OFF -DCMAKE_BUILD_TYPE=Release
42-
ninja
38+
# If building outside of oss-fuzz, we need LPM
39+
if [ ! -d ${SRC}/LPM ]; then
40+
git clone https://github.com/google/libprotobuf-mutator ${SRC}/libprotobuf-mutator
41+
42+
mkdir ${SRC}/LPM \
43+
&& cd ${SRC}/LPM \
44+
&& cmake ../libprotobuf-mutator -GNinja -DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON -DLIB_PROTO_MUTATOR_TESTING=OFF -DCMAKE_BUILD_TYPE=Release \
45+
&& ninja
46+
fi

0 commit comments

Comments
 (0)