From 411ff5a0bd63051557a51b0c0219c9f33eb6acf3 Mon Sep 17 00:00:00 2001 From: Stefan Profanter Date: Thu, 20 Jul 2017 00:00:08 +0200 Subject: [PATCH] [open62541] simplify build script (#727) * [open62541] Switch to master branch and use gmail address for cc author * [open62541] Simplify build script and move logic to cmake This makes continuous integration easier in open62541 and allows to test the fuzzing targets --- projects/open62541/Dockerfile | 2 +- projects/open62541/build.sh | 36 +++++---------------------------- projects/open62541/project.yaml | 2 +- 3 files changed, 7 insertions(+), 33 deletions(-) diff --git a/projects/open62541/Dockerfile b/projects/open62541/Dockerfile index a01d135e8..87bfb325f 100644 --- a/projects/open62541/Dockerfile +++ b/projects/open62541/Dockerfile @@ -17,7 +17,7 @@ FROM gcr.io/oss-fuzz-base/base-builder MAINTAINER git@s.profanter.me RUN apt-get update && apt-get install -y make cmake -RUN git clone --depth 1 https://github.com/open62541/open62541.git -bfeature/fuzzing open62541 +RUN git clone --depth 1 https://github.com/open62541/open62541.git -bmaster open62541 WORKDIR open62541 RUN git submodule update --init --recursive COPY build.sh $SRC/ diff --git a/projects/open62541/build.sh b/projects/open62541/build.sh index 24432df16..10dba4e61 100755 --- a/projects/open62541/build.sh +++ b/projects/open62541/build.sh @@ -29,40 +29,14 @@ cd $WORK/open62541 cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_ENABLE_AMALGAMATION=OFF \ -DBUILD_SHARED_LIBS=OFF -DUA_BUILD_EXAMPLES=OFF -DUA_LOGLEVEL=600 \ - -DUA_ENABLE_DISCOVERY=ON -DUA_ENABLE_DISCOVERY_MULTICAST=ON \ + -DUA_BUILD_OSS_FUZZ=ON \ $SRC/open62541/ -# for now just use one processor, otherwise amalgamation may fail +# This also builds all the fuzz targets and places them in the $OUT directory +# Only build with one process otherwise amalgamation fails. make -j1 -# ------------------------------------------------------------ -# Add additional definitions which are normally set with CMake -# ------------------------------------------------------------ - -# Definitions -CXXFLAGS="$CXXFLAGS -DUA_NO_AMALGAMATION" -# Include dirs -CXXFLAGS="$CXXFLAGS -I$WORK/open62541/src_generated -I$SRC/open62541/include -I$SRC/open62541/plugins -I$SRC/open62541/deps -I$SRC/open62541/src -I$SRC/open62541/src/server" - -# ------------------------------------------------------------ -# Build all the fuzzing targets in tests/fuzz -# ------------------------------------------------------------ - -fuzzerFiles=$(find $SRC/open62541/tests/fuzz/ -name "*.cc") - -for F in $fuzzerFiles; do - fuzzerName=$(basename $F .cc) - echo "Building fuzzer $fuzzerName" - - $CXX $CXXFLAGS -std=c++11 \ - $F -o $OUT/${fuzzerName} \ - -lFuzzingEngine -L $WORK/open62541/bin -lopen62541 - - if [ -d "$SRC/open62541/tests/fuzz/${fuzzerName}_corpus" ]; then - zip -j $OUT/${fuzzerName}_seed_corpus.zip $SRC/open62541/tests/fuzz/${fuzzerName}_corpus/* - fi -done - -cp $SRC/open62541/tests/fuzz/*.dict $SRC/open62541/tests/fuzz/*.options $OUT/ +# Copy the corpus, dict and options to the $OUT dir +$SRC/open62541/tests/fuzz/oss-fuzz-copy.sh echo "Built all fuzzer targets." diff --git a/projects/open62541/project.yaml b/projects/open62541/project.yaml index 808555d3b..8b2ef436e 100644 --- a/projects/open62541/project.yaml +++ b/projects/open62541/project.yaml @@ -1,7 +1,7 @@ homepage: "https://open62541.org/" primary_contact: "Stefan.Profanter@gmail.com" auto_ccs: - - "julius.pfrommer@iosb.fraunhofer.de" + - "julius.pfrommer@gmail.com" - "f.palm@plt.rwth-aachen.de" - "chris_paul.iatrou@tu-dresden.de" sanitizers: