qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Darren Kenny <darren.kenny@oracle.com>
To: Alexander Bulekov <alxndr@bu.edu>, qemu-devel@nongnu.org
Cc: thuth@redhat.com, berrange@redhat.com, cohuck@redhat.com,
	Alexander Bulekov <alxndr@bu.edu>, Bandan Das <bsd@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	philmd@redhat.com
Subject: Re: [PATCH] fuzz: avoid building twice, when running on gitlab
Date: Mon, 09 Aug 2021 15:38:28 +0100	[thread overview]
Message-ID: <m2sfzik7iz.fsf@oracle.com> (raw)
In-Reply-To: <20210809111621.54454-1-alxndr@bu.edu>

On Monday, 2021-08-09 at 07:16:21 -04, Alexander Bulekov wrote:
> 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>

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


  reply	other threads:[~2021-08-09 14:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-09 11:16 [PATCH] fuzz: avoid building twice, when running on gitlab Alexander Bulekov
2021-08-09 14:38 ` Darren Kenny [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2sfzik7iz.fsf@oracle.com \
    --to=darren.kenny@oracle.com \
    --cc=alxndr@bu.edu \
    --cc=berrange@redhat.com \
    --cc=bsd@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).