[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/11] fuzz: avoid building twice, when running on gitlab
From: |
Thomas Huth |
Subject: |
[PULL 05/11] fuzz: avoid building twice, when running on gitlab |
Date: |
Sat, 14 Aug 2021 08:09:50 +0200 |
From: Alexander Bulekov <alxndr@bu.edu>
On oss-fuzz, we build twice, to put together a build that is portable to
the runner containers. On gitlab ci, this is wasteful and contributes to
timeouts on the build-oss-fuzz job. Avoid building twice on gitlab, at
the remote cost of potentially missing some cases that break oss-fuzz
builds.
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Message-Id: <20210809111621.54454-1-alxndr@bu.edu>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
scripts/oss-fuzz/build.sh | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/scripts/oss-fuzz/build.sh b/scripts/oss-fuzz/build.sh
index c1af43fded..98b56e0521 100755
--- a/scripts/oss-fuzz/build.sh
+++ b/scripts/oss-fuzz/build.sh
@@ -73,17 +73,19 @@ if ! make "-j$(nproc)" qemu-fuzz-i386; then
"\nFor example: CC=clang CXX=clang++ $0"
fi
-for i in $(ldd ./qemu-fuzz-i386 | cut -f3 -d' '); do
- cp "$i" "$DEST_DIR/lib/"
-done
-rm qemu-fuzz-i386
-
-# Build a second time to build the final binary with correct rpath
-../configure --disable-werror --cc="$CC" --cxx="$CXX" --enable-fuzzing \
- --prefix="$DEST_DIR" --bindir="$DEST_DIR" --datadir="$DEST_DIR/data/" \
- --extra-cflags="$EXTRA_CFLAGS" --extra-ldflags="-Wl,-rpath,\$ORIGIN/lib" \
- --target-list="i386-softmmu"
-make "-j$(nproc)" qemu-fuzz-i386 V=1
+if [ "$GITLAB_CI" != "true" ]; then
+ for i in $(ldd ./qemu-fuzz-i386 | cut -f3 -d' '); do
+ cp "$i" "$DEST_DIR/lib/"
+ done
+ rm qemu-fuzz-i386
+
+ # Build a second time to build the final binary with correct rpath
+ ../configure --disable-werror --cc="$CC" --cxx="$CXX" --enable-fuzzing \
+ --prefix="$DEST_DIR" --bindir="$DEST_DIR" --datadir="$DEST_DIR/data/" \
+ --extra-cflags="$EXTRA_CFLAGS"
--extra-ldflags="-Wl,-rpath,\$ORIGIN/lib" \
+ --target-list="i386-softmmu"
+ make "-j$(nproc)" qemu-fuzz-i386 V=1
+fi
# Copy over the datadir
cp -r ../pc-bios/ "$DEST_DIR/pc-bios"
--
2.27.0
- [PULL 00/11] Optional gitlab-CI and doc fixes for -rc4, Thomas Huth, 2021/08/14
- [PULL 01/11] gitlab: exclude sparc-softmmu and riscv32-softmmu from cross builds, Thomas Huth, 2021/08/14
- [PULL 05/11] fuzz: avoid building twice, when running on gitlab,
Thomas Huth <=
- [PULL 02/11] gitlab: skip many more targets in windows cross builds, Thomas Huth, 2021/08/14
- [PULL 04/11] tests/qtest/vhost-user-blk-test: Check whether qemu-storage-daemon is available, Thomas Huth, 2021/08/14
- [PULL 03/11] storage-daemon: Add missing build dependency to the vhost-user-blk-test, Thomas Huth, 2021/08/14
- [PULL 09/11] docs/about/removed-features: Document removed HMP commands from QEMU v2.12, Thomas Huth, 2021/08/14
- [PULL 06/11] docs/about/removed-features: Document removed CLI options from QEMU v2.12, Thomas Huth, 2021/08/14
- [PULL 07/11] docs/about/removed-features: Document removed CLI options from QEMU v3.0, Thomas Huth, 2021/08/14
- [PULL 08/11] docs/about/removed-features: Document removed CLI options from QEMU v3.1, Thomas Huth, 2021/08/14
- [PULL 10/11] docs/about/removed-features: Document removed devices from older QEMU versions, Thomas Huth, 2021/08/14
- [PULL 11/11] docs/about/removed-features: Document removed machines from older QEMU versions, Thomas Huth, 2021/08/14