From 05b51ab5b36d5a0df1dfe017d1174c7883d1987a Mon Sep 17 00:00:00 2001 From: Dridi Boukelmoune Date: Tue, 7 Sep 2021 16:51:07 +0000 Subject: [PATCH] varnish: Patch the build system (#6412) * varnish: Drop the downstream build system patch I made sure future changes upstream would less likely break OSS-Fuzz builds by adding an explicit --enable-oss-fuzz configure option. * varnish: Reduce build parallelism The partial build performed seems to be subject to races with 32 CPUs. * varnish: This is a C project, not C++ Not sure how much this matters, it may change environment variables set during the build with for example CFLAGS instead of CXXFLAGS. Or it might just be for statistics reasons? Anyway, this is a C project. --- projects/varnish/Dockerfile | 1 - projects/varnish/build.sh | 11 +++++------ projects/varnish/patch.diff | 17 ----------------- projects/varnish/project.yaml | 2 +- 4 files changed, 6 insertions(+), 25 deletions(-) delete mode 100644 projects/varnish/patch.diff diff --git a/projects/varnish/Dockerfile b/projects/varnish/Dockerfile index 7bd362ade..5fd0fb49c 100644 --- a/projects/varnish/Dockerfile +++ b/projects/varnish/Dockerfile @@ -18,5 +18,4 @@ FROM gcr.io/oss-fuzz-base/base-builder RUN apt-get update && apt install -y automake autoconf libtool pkg-config python3-docutils python3-sphinx libedit-dev libpcre2-dev libncurses-dev RUN git clone --depth 1 https://github.com/varnishcache/varnish-cache COPY build.sh $SRC -COPY patch.diff $SRC WORKDIR $SRC/varnish-cache diff --git a/projects/varnish/build.sh b/projects/varnish/build.sh index e7550005b..21eeb7768 100755 --- a/projects/varnish/build.sh +++ b/projects/varnish/build.sh @@ -16,12 +16,11 @@ ################################################################################ -git apply --ignore-whitespace $SRC/patch.diff # build project ./autogen.sh -./configure PCRE2_LIBS=-l:libpcre2-8.a -make -j$(nproc) -C include/ -make -j$(nproc) -C lib/libvarnish/ -make -j$(nproc) -C lib/libvgz/ -make -j$(nproc) -C bin/varnishd/ VSC_main.c esi_parse_fuzzer +./configure --enable-oss-fuzz PCRE2_LIBS=-l:libpcre2-8.a +make -j2 -C include/ +make -j2 -C lib/libvarnish/ +make -j2 -C lib/libvgz/ +make -j2 -C bin/varnishd/ VSC_main.c esi_parse_fuzzer cp bin/varnishd/*_fuzzer $OUT/ diff --git a/projects/varnish/patch.diff b/projects/varnish/patch.diff deleted file mode 100644 index 1d1dc524a..000000000 --- a/projects/varnish/patch.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/bin/varnishd/Makefile.am b/bin/varnishd/Makefile.am -index ce7145e..18d23b3 100644 ---- a/bin/varnishd/Makefile.am -+++ b/bin/varnishd/Makefile.am -@@ -208,10 +208,11 @@ esi_parse_fuzzer_SOURCES = \ - cache/cache_esi_parse.c \ - fuzzers/esi_parse_fuzzer.c - esi_parse_fuzzer_CFLAGS = \ -- @SAN_CFLAGS@ -DNOT_IN_A_VMOD -DTEST_DRIVER -include config.h -+ @SAN_CFLAGS@ -DNOT_IN_A_VMOD -include config.h - esi_parse_fuzzer_LDADD = \ - $(top_builddir)/lib/libvarnish/libvarnish.la \ - $(top_builddir)/lib/libvgz/libvgz.a -+esi_parse_fuzzer_LDFLAGS = $(LIB_FUZZING_ENGINE) - - TESTS = vhp_table_test vhp_decode_test - diff --git a/projects/varnish/project.yaml b/projects/varnish/project.yaml index 70c892c0e..d25135569 100644 --- a/projects/varnish/project.yaml +++ b/projects/varnish/project.yaml @@ -1,5 +1,5 @@ homepage: "https://varnish-cache.org/" -language: c++ +language: c primary_contact: "phk@varnish.org" auto_ccs: - "bsdphk@gmail.com"