kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Roman Bolshakov <r.bolshakov@yadro.com>, kvm@vger.kernel.org
Cc: Thomas Huth <thuth@redhat.com>, Cameron Esfahani <dirty@apple.com>
Subject: Re: [kvm-unit-tests PATCH v2 06/10] configure: Add an option to specify getopt
Date: Tue, 22 Sep 2020 15:53:27 +0200	[thread overview]
Message-ID: <922fee6f-f6d0-b6cd-c9b7-63ad5e3a004c@redhat.com> (raw)
In-Reply-To: <20200901085056.33391-7-r.bolshakov@yadro.com>

On 01/09/20 10:50, Roman Bolshakov wrote:
> macOS is shipped with an old non-enhanced version of getopt and it
> doesn't support options used by run_tests.sh. Proper version of getopt
> is available from homebrew but it has to be added to PATH before invoking
> run_tests.sh. It's not convenient because it has to be done in each
> shell instance and there could be many if a multiplexor is used.
> 
> The change provides a way to override getopt and halts ./configure if
> enhanced getopt can't be found.
> 
> Cc: Cameron Esfahani <dirty@apple.com>
> Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>

I don't like the extra option very much, generally people are just expected
to stick homebrew in their path somehow.  Reporting a better error is a
good idea though, what about this:

diff --git a/configure b/configure
index 4eb504f..3293634 100755
--- a/configure
+++ b/configure
@@ -167,6 +167,13 @@ EOF
   rm -f lib-test.{o,S}
 fi
 
+# require enhanced getopt
+getopt -T > /dev/null
+if [ $? -ne 4 ]; then
+    echo "Enhanced getopt is not available, add it to your PATH?"
+    exit 1
+fi
+
 # Are we in a separate build tree? If so, link the Makefile
 # and shared stuff so that 'make' and run_tests.sh work.
 if test ! -e Makefile; then
diff --git a/run_tests.sh b/run_tests.sh
index 01e36dc..70d012c 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -34,6 +34,13 @@ EOF
 RUNTIME_arch_run="./$TEST_DIR/run"
 source scripts/runtime.bash
 
+# require enhanced getopt
+getopt -T > /dev/null
+if [ $? -ne 4 ]; then
+    echo "Enhanced getopt is not available, add it to your PATH?"
+    exit 1
+fi
+
 only_tests=""
 args=`getopt -u -o ag:htj:v -l all,group:,help,tap13,parallel:,verbose -- $*`
 [ $? -ne 0 ] && exit 2;

Paolo


  parent reply	other threads:[~2020-09-22 13:53 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-01  8:50 [kvm-unit-tests PATCH v2 00/10] Add support for generic ELF cross-compiler Roman Bolshakov
2020-09-01  8:50 ` [kvm-unit-tests PATCH v2 01/10] x86: Makefile: Allow division on x86_64-elf binutils Roman Bolshakov
2020-09-03 15:19   ` Thomas Huth
2020-09-01  8:50 ` [kvm-unit-tests PATCH v2 02/10] x86: Replace instruction prefixes with spaces Roman Bolshakov
2020-09-01  8:50 ` [kvm-unit-tests PATCH v2 03/10] x86: Makefile: Fix linkage of realmode on x86_64-elf binutils Roman Bolshakov
2020-09-01  8:50 ` [kvm-unit-tests PATCH v2 04/10] lib: Bundle debugreg.h from the kernel Roman Bolshakov
2020-09-01  8:50 ` [kvm-unit-tests PATCH v2 05/10] lib: x86: Use portable format macros for uint32_t Roman Bolshakov
2020-09-04 13:47   ` Thomas Huth
2020-09-01  8:50 ` [kvm-unit-tests PATCH v2 06/10] configure: Add an option to specify getopt Roman Bolshakov
2020-09-04 13:50   ` Thomas Huth
2020-09-22 13:53   ` Paolo Bonzini [this message]
2020-09-22 21:51     ` Roman Bolshakov
2020-09-23  2:41       ` Paolo Bonzini
2020-09-23  5:14         ` Thomas Huth
2020-09-01  8:50 ` [kvm-unit-tests PATCH v2 07/10] README: Update build instructions for macOS Roman Bolshakov
2020-09-01  8:50 ` [kvm-unit-tests PATCH v2 08/10] travis.yml: Add CI " Roman Bolshakov
2020-09-04 13:53   ` Thomas Huth
2020-09-01  8:50 ` [kvm-unit-tests PATCH v2 09/10] travis.yml: Change matrix keyword to jobs Roman Bolshakov
2020-09-04 14:20   ` Thomas Huth
2020-09-01  8:50 ` [kvm-unit-tests PATCH v2 10/10] travis.yml: Add x86 build with clang 10 Roman Bolshakov
2020-09-04 14:31   ` Thomas Huth
2020-09-14 14:45     ` Roman Bolshakov
2020-09-14 16:37       ` Thomas Huth
2020-09-15 15:59         ` Roman Bolshakov
2020-09-22 14:51           ` Paolo Bonzini
2020-09-22 21:25             ` Roman Bolshakov
2020-09-23  2:37               ` Paolo Bonzini

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=922fee6f-f6d0-b6cd-c9b7-63ad5e3a004c@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=dirty@apple.com \
    --cc=kvm@vger.kernel.org \
    --cc=r.bolshakov@yadro.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).