From d3e4ba3bb8895afcea44c9595d4fc845fcf4f8d4 Mon Sep 17 00:00:00 2001 From: jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com> Date: Sun, 11 Sep 2022 13:20:02 -0400 Subject: [PATCH] [centipede] Fix centipede (#8467) Pin centipede to a commit that builds. Also remove 1.3GB of image bloat it adds CC @ussuri @Alan32Liu Fixes #8458 --- infra/base-images/base-builder/Dockerfile | 15 +++++++++------ .../base-images/base-builder/precompile_centipede | 4 ++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/infra/base-images/base-builder/Dockerfile b/infra/base-images/base-builder/Dockerfile index 05b8453c2..20bb1a006 100644 --- a/infra/base-images/base-builder/Dockerfile +++ b/infra/base-images/base-builder/Dockerfile @@ -116,6 +116,10 @@ RUN git clone https://github.com/AFLplusplus/AFLplusplus.git aflplusplus && \ wget --no-check-certificate -O oss.sh https://raw.githubusercontent.com/vanhauser-thc/binary_blobs/master/oss.sh && \ chmod 755 oss.sh +# Do precompiles before copying other scripts for better cache efficiency. +COPY precompile_afl /usr/local/bin/ +RUN precompile_afl + RUN cd $SRC && \ curl -L -O https://github.com/google/honggfuzz/archive/oss-fuzz.tar.gz && \ mkdir honggfuzz && \ @@ -123,16 +127,15 @@ RUN cd $SRC && \ tar -xzv --strip-components=1 -f $SRC/oss-fuzz.tar.gz && \ rm -rf examples $SRC/oss-fuzz.tar.gz -RUN cd $SRC && \ - git clone --depth 1 https://github.com/google/centipede.git - -# Do precompiles before copying other scripts for better cache efficiency. -COPY precompile_afl /usr/local/bin/ -RUN precompile_afl COPY precompile_honggfuzz /usr/local/bin/ RUN precompile_honggfuzz +RUN cd $SRC && \ + git clone https://github.com/google/centipede.git && \ + cd centipede && \ + git checkout a976295b2acaff8461a906c461f5bb25dafdf557 + COPY precompile_centipede /usr/local/bin/ RUN precompile_centipede diff --git a/infra/base-images/base-builder/precompile_centipede b/infra/base-images/base-builder/precompile_centipede index 665ca97f3..ac8c26a3f 100755 --- a/infra/base-images/base-builder/precompile_centipede +++ b/infra/base-images/base-builder/precompile_centipede @@ -32,4 +32,8 @@ bazel --bazelrc=/tmp/centipede.bazelrc build -c opt :all /clang/bin/clang++ "$SRC/centipede/weak_sancov_stubs.cc" -c -o \ "$SRC/centipede/weak.o" +echo 'Removing extra stuff leftover to avoid bloating image.' + +rm -rf /clang-*.tgz /clang /root/.cache/* + echo 'Done.'