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.
This commit is contained in:
Dridi Boukelmoune 2021-09-07 16:51:07 +00:00 committed by GitHub
parent 405818cd00
commit 05b51ab5b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 25 deletions

View File

@ -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

View File

@ -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/

View File

@ -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

View File

@ -1,5 +1,5 @@
homepage: "https://varnish-cache.org/"
language: c++
language: c
primary_contact: "phk@varnish.org"
auto_ccs:
- "bsdphk@gmail.com"