On Thu, Jan 25, 2024 at 3:35 PM Daniel P. Berrangé <berra...@redhat.com> wrote:
> The latter feels redundant, but the former feels worthwhile as long as we
> keep a wrapper cnofigure script around.
>
> It seems like we're not far off being able to do a build with the normal
> sequence of
>
>   meson setup build
>   meson compile -C build
>
> The creation of the config-host.mak and config-host.h files looks like
> the big one. I feel like config-host.mak ought not to even exist. Meson
> only consumes a subset of values written into that AFAICT:

The big one is actually everything else that configure does. :) All
emulator build tasks and tests (especially config-host.h) are done in
meson.build, but there's more than that to configure.

At this point, concerns are well separated between configure and
meson. QEMU has a complex multi-target build system that goes beyond
what Meson is designed to do well; but it also has a complex
multi-binary component (the emulators) that goes beyond what can be
done easily in Makefiles. So we have shell/Makefile to orchestrate the
build, and a single meson/ninja step underneath it for the emulators.

Creating the Python virtual environment _could_ be part of the Meson
Python module, but it doesn't make sense in my opinion to do so.
First, because the virtual environment is also used by other non-meson
parts of the build, notably by Avocado. Second, because it would force
us to use very new Meson versions now that we've been able to rein
that in. (Third, because I can't afford the required time :)).

Determining the firmware and tests trees to recurse into, based on the
list of targets and the detected compiler environments, cannot be done
in meson because it only supports two compiler environments. It also
does not map well to the meson DSL.

> $ git grep 'config_host\b'
> meson.build:config_host = keyval.load(meson.current_build_dir() / 
> 'config-host.mak')
> meson.build:target_dirs = config_host['TARGET_DIRS'].split()
> meson.build:default_targets = 'CONFIG_DEFAULT_TARGETS' in config_host
> meson.build:if config_host.has_key('GDB')
> meson.build:  summary_info += {'gdb':             config_host['GDB']}
> meson.build:summary_info += {'genisoimage':       config_host['GENISOIMAGE']}
>
> and I would have thought meson could detect 'gdb' / 'genisoimage' itself,

gdb/genisoimage are used by only used to print the summary, they are
not used anywhere in the emulator build but they are used by the TCG
and Avocado tests.

It should be possible to move TARGET_DIRS and CONFIG_DEFAULT_TARGETS
to meson options and remove the need for meson.build to read
config-host.mak. I would not reject patches to do so, but building
qemu.git without going through configure was never a goal of the
conversion. (The only wrinkle would be that the default TARGET_DIRS
are computed with globbing, which does not exist in meson, so one
would have to list the desired targets by hand. That's not a problem,
it's just different from "./configure").

Paolo


Reply via email to