qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 0/2] *** configure: Add 'mkdir build' check ***


From: Peter Maydell
Subject: Re: [PATCH 0/2] *** configure: Add 'mkdir build' check ***
Date: Thu, 16 Feb 2023 14:06:39 +0000

On Wed, 8 Feb 2023 at 23:32, Dinah Baum <dinahbaum123@gmail.com> wrote:
>
> QEMU configure script goes into an infinite error printing loop
> when in read only directory due to 'build' dir never being created.
>
> 1 - Checking if 'mkdir dir' succeeds and if the directory is
> writeable prevents this error.
>
> 2 - Since we exit early on error in (1), code for reading in
> arguments has been moved before that

Unfortunately this patch series changes the output of the --help
message, because it moves the code that prints it so that it
is before some of the other bits of configure that identify
various default values to print as part of the help message.
You can see this if you do './configure --help > help.txt'
before and after the changes and compare the outputs:



--- /tmp/old.help       2023-02-16 13:58:45.302662220 +0000
+++ /tmp/new-help       2023-02-16 13:56:05.579389660 +0000
@@ -1,47 +1,21 @@
-Using './build' as the directory for build output

 Usage: configure [options]
 Options: [defaults in brackets after descriptions]

 Standard options:
   --help                   print this message
-  --prefix=PREFIX          install in PREFIX [/usr/local]
+  --prefix=PREFIX          install in PREFIX []
   --target-list=LIST       set target list (default: build all)
-                           Available targets: aarch64-softmmu alpha-softmmu
-                           arm-softmmu avr-softmmu cris-softmmu hppa-softmmu
-                           i386-softmmu loongarch64-softmmu m68k-softmmu
-                           microblaze-softmmu microblazeel-softmmu mips-softmmu
-                           mips64-softmmu mips64el-softmmu mipsel-softmmu
-                           nios2-softmmu or1k-softmmu ppc-softmmu ppc64-softmmu
-                           riscv32-softmmu riscv64-softmmu rx-softmmu
-                           s390x-softmmu sh4-softmmu sh4eb-softmmu
-                           sparc-softmmu sparc64-softmmu tricore-softmmu
-                           x86_64-softmmu xtensa-softmmu xtensaeb-softmmu
-                           aarch64-linux-user aarch64_be-linux-user
-                           alpha-linux-user arm-linux-user armeb-linux-user
-                           cris-linux-user hexagon-linux-user hppa-linux-user
-                           i386-linux-user loongarch64-linux-user
-                           m68k-linux-user microblaze-linux-user
-                           microblazeel-linux-user mips-linux-user
-                           mips64-linux-user mips64el-linux-user
-                           mipsel-linux-user mipsn32-linux-user
-                           mipsn32el-linux-user nios2-linux-user
-                           or1k-linux-user ppc-linux-user ppc64-linux-user
-                           ppc64le-linux-user riscv32-linux-user
-                           riscv64-linux-user s390x-linux-user sh4-linux-user
-                           sh4eb-linux-user sparc-linux-user
-                           sparc32plus-linux-user sparc64-linux-user
-                           x86_64-linux-user xtensa-linux-user
-                           xtensaeb-linux-user
+                           Available targets:
   --target-list-exclude=LIST exclude a set of targets from the
default target-list

 Advanced options (experts only):
   --cross-prefix=PREFIX    use PREFIX for compile tools, PREFIX can be blank []
-  --cc=CC                  use C compiler CC [cc]
-  --host-cc=CC             use C compiler CC [cc] for code run at
+  --cc=CC                  use C compiler CC []
+  --host-cc=CC             use C compiler CC [] for code run at
                            build time
(etc)

You can see that the new output doesn't show the available target
list or the default values in [] for options like --cc and --host-cc.

This is kind of awkward to fix because some of the code we run to
figure out those default values probably assumes that the current
directory is writeable and/or that the build directory was created.

My suggestion is that because the case we're trying to fix is
really a corner case (accidentally running configure in a
read-only directory), and our hope for the future is to move
still more of this code out of configure and into meson.build,
that we should take the simple approach:
 * just do something like patch 1, which exits immediately if
   it finds that it couldn't create the build directory
 * accept that in this situation, --help doesn't work. This
   is already the case for some other early error paths, like
   the one where we failed to create the temporary directory TMPDIR1

I think that's OK if we have a suitably clear error message.
I'll go and review patch 1 specifically now, assuming this
approach.

thanks
-- PMM



reply via email to

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