qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fuzz: avoid building twice, when running on gitlab
@ 2021-08-09 11:16 Alexander Bulekov
  2021-08-09 14:38 ` Darren Kenny
  2021-08-09 18:25 ` Peter Maydell
  0 siblings, 2 replies; 8+ messages in thread
From: Alexander Bulekov @ 2021-08-09 11:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: thuth, berrange, cohuck, Alexander Bulekov, Bandan Das,
	Stefan Hajnoczi, Paolo Bonzini, philmd

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

From a couple test runs it looks like this can shave off 15-20 minutes.

 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.30.2



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-08-11  0:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-09 11:16 [PATCH] fuzz: avoid building twice, when running on gitlab Alexander Bulekov
2021-08-09 14:38 ` Darren Kenny
2021-08-09 18:25 ` Peter Maydell
2021-08-09 19:06   ` Alexander Bulekov
2021-08-09 19:30     ` Alexander Bulekov
2021-08-09 19:36       ` Peter Maydell
2021-08-10  5:01         ` Philippe Mathieu-Daudé
2021-08-11  0:11           ` Coiby Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).