qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] fuzz: fix unbound variable in build.sh


From: Thomas Huth
Subject: Re: [PATCH] fuzz: fix unbound variable in build.sh
Date: Wed, 8 Sep 2021 07:53:27 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0

On 07/09/2021 14.51, Alexander Bulekov wrote:
On 210907 1432, Thomas Huth wrote:
On 07/09/2021 13.08, Alexander Bulekov wrote:
/src/build.sh: line 76: GITLAB_CI: unbound variable
Fix that.

Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
---

This change is in preparation to revert:
7602748c ("qemu: manually build glib (#5919)") on OSS-Fuzz.
Reverting as-is produces an unbound variable complaint when we try to
build the fuzzers in the OSS-Fuzz container.

   scripts/oss-fuzz/build.sh | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/oss-fuzz/build.sh b/scripts/oss-fuzz/build.sh
index 98b56e0521..5ddc769c9c 100755
--- a/scripts/oss-fuzz/build.sh
+++ b/scripts/oss-fuzz/build.sh
@@ -73,7 +73,7 @@ if ! make "-j$(nproc)" qemu-fuzz-i386; then
             "\nFor example: CC=clang CXX=clang++ $0"
   fi
-if [ "$GITLAB_CI" != "true" ]; then
+if [ -z ${GITLAB_CI+x} ]; then

My bash-foo is really not the best, but shouldn't there be a colon in there,
i.e. ${GITLAB_CI:+x} ?

I think the difference is that GITLAB_CI+x only checks if GITLAB_CI is
set, while GITLAB_CI:+x checks that it is set and non-null.
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02

I don't think that makes much of a difference here.

TIL, and I agree that it does not make a difference here (and if it would, your variant is certainly better).

Reviewed-by: Thomas Huth <thuth@redhat.com>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]