All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
	qemu-devel@nongnu.org, "Kevin Wolf" <kwolf@redhat.com>,
	"Hanna Reitz" <hreitz@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Viktor Prutyanov" <viktor.prutyanov@phystech.edu>,
	"Akihiko Odaki" <odaki@rsg.ci.i.u-tokyo.ac.jp>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Eric Blake" <eblake@redhat.com>,
	"Vladimir Sementsov-Ogievskiy" <vsementsov@yandex-team.ru>,
	"Jason Wang" <jasowang@redhat.com>
Subject: Re: [PATCH 0/9] tools: Move more tools sources into tools/
Date: Mon, 11 May 2026 09:37:24 +0100	[thread overview]
Message-ID: <agGVRFsSh1mbKc4U@redhat.com> (raw)
In-Reply-To: <CAJ+F1C+XzzsGRwLjUCYiDaS9OGXMq5oc3QM5pm4obZAgLP7Z1w@mail.gmail.com>

On Mon, May 11, 2026 at 12:23:32AM +0400, Marc-André Lureau wrote:
> Hi
> 
> On Fri, May 8, 2026 at 8:23 PM Peter Maydell <peter.maydell@linaro.org> wrote:
> >
> > On Fri, 8 May 2026 at 17:00, Pierrick Bouvier
> > <pierrick.bouvier@oss.qualcomm.com> wrote:
> > >
> > > On 5/8/2026 8:24 AM, Peter Maydell wrote:
> > > > We have a set of binaries that we call "tools": they're built based on
> > > > the --enable-tools/--disable-tools configure setting, they're
> > > > documented in docs/tools, and they're standalone executables of one
> > > > form or another.
> > > >
> > > > Currently the sources for these are a bit scattered: many still in the
> > > > top level source directory, some in contrib, one or two actually in
> > > > the tools directory.
> > > >
> > > > As an initial attempt at cleanup, this patchset moves the sources for
> > > > qemu-bridge-helper, qemu-edid, qemu-img, qemu-io, qemu-nbd,
> > > > qemu-keymap, qemu-vmsr-helper and elf2dmp into the tools/ directory.
> > > >
> > > > The patchseries also moves the ebfp skeleton sources from tools/ebpf/
> > > > to ebpf/bpf-src/, because this isn't a tool by the above definition.
> > > >
> > > > As per my thread from a while back, I would ultimately like us to
> > > > clean up contrib/:
> > > > https://lore.kernel.org/qemu-devel/CAFEAcA_5HvGriDsWnb1ALuA_dgG320eKv7yuM2kThv=rfOSZQA@mail.gmail.com/
> > > > But parts of that clearly need more discussion. So this is just doing
> > > > some parts that I hope are not controversial.
> > > >
> > > > Annoyingly, meson doesn't seem to provide any way for a subdirectory
> > > > meson.build to say "the foo.c in this subdir builds into a foo
> > > > executable that lives at the top level of the builddir". And we have a
> > > > lot of test harness stuff plus user muscle memory that assumes that
> > > > qemu-img and qemu-io live there. So the build runes for these tools
> > > > have to stay in the top level meson.build (and tools/meson.build
> > > > remains an empty file). The exception is that contrib/elf2dmp/elf2dmp
> > > > is now tools/elf2dmp/elf2dmp, but I think the set of people who were
> > > > running that from the build directory will be small.
> > > >
> > >
> > > It's a deliberate design more than an annoyance. It pushes users to make
> > > things explicit at top level, which is good to understand what is built
> > > and how, and hide details in subdirs in variables. QEMU's top level
> > > meson.build is over complex, so it may appear more as a burden than a
> > > benefit though.
> >
> > Personally I think if the build system doesn't let you do a
> > pretty normal and reasonable thing that's annoying. Meson
> > annoys me because it has a tendency to be over-opinionated.

Being opinionated is a double edge sword. A big part of the mess you
get with traditional build tools is that they are not opinionated so
every project ends up doing something slightly different and thus it
is harder to understand each project.  Being opinionated is what keeps
meson simpler to understand and learn, at the cost of loss of flexiblity.

Meson may not have the balance entirely right, but overall I think it
has been beneficial to be very opinionated, even if that means some
places needs to be relaxed over time.


> I have to agree that meson is sometimes lacking. In this case, it
> would be convenient to have a link created at build time. But you have
> to resort to fairly annoying custom_target python code today. In the
> meantime, there is also fs.copyfile() that could work (although it's
> also somewhat limited or buggy). For later, we could try adding
> fs.symlink() perhaps. Paolo might have better chances than me getting
> it accepted ;)

IIUC, the main reason to want binaries in a specific location is
so that tests find them in that location.  That is a valid historical
approach, but meson offer an alternative approach that could be used
instead.

We can set the test environment so that meson modifies $PATH such that
all the built binaries appear at head of $PATH. Tests then don't need
to assume a location for them in the build directory, just let execvp
search $PATH as normal.  For execution outside of 'meson test', we have
"meson devenv" which sets up a local interactive shell environment, or
we can launch the test via the "run" script which wraps "meson devenv"
for a single command.

With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|



  reply	other threads:[~2026-05-11  9:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-08 15:24 [PATCH 0/9] tools: Move more tools sources into tools/ Peter Maydell
2026-05-08 15:24 ` [PATCH 1/9] ebpf: move ebpf skeleton source to ebpf/ directory Peter Maydell
2026-05-08 16:07   ` Daniel P. Berrangé
2026-05-27  6:35   ` Philippe Mathieu-Daudé
2026-05-08 15:24 ` [PATCH 2/9] tools: Move qemu-bridge-helper sources to tools/ directory Peter Maydell
2026-05-08 15:24 ` [PATCH 3/9] tools: Move qemu-edid " Peter Maydell
2026-05-08 15:24 ` [PATCH 4/9] tools: Move qemu-img " Peter Maydell
2026-05-08 15:24 ` [PATCH 5/9] tools: Move qemu-io " Peter Maydell
2026-05-08 15:24 ` [PATCH 6/9] tools: Move qemu-nbd " Peter Maydell
2026-05-08 15:24 ` [PATCH 7/9] tools: Move qemu-keymap " Peter Maydell
2026-05-08 15:24 ` [PATCH 8/9] tools: Move qemu-vmsr-helper up a directory level Peter Maydell
2026-05-12  6:53   ` Akihiko Odaki
2026-05-12  8:45     ` Peter Maydell
2026-05-08 15:24 ` [PATCH 9/9] tools: Move elf2dmp from contrib/ to tools/ Peter Maydell
2026-05-08 16:00 ` [PATCH 0/9] tools: Move more tools sources into tools/ Pierrick Bouvier
2026-05-08 16:22   ` Peter Maydell
2026-05-10 20:23     ` Marc-André Lureau
2026-05-11  8:37       ` Daniel P. Berrangé [this message]
2026-05-11  9:27         ` Peter Maydell
2026-05-11 16:56           ` Pierrick Bouvier
2026-05-08 16:02 ` Pierrick Bouvier
2026-05-11  9:05 ` Kevin Wolf
2026-05-11  9:21   ` Peter Maydell

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=agGVRFsSh1mbKc4U@redhat.com \
    --to=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=odaki@rsg.ci.i.u-tokyo.ac.jp \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=viktor.prutyanov@phystech.edu \
    --cc=vsementsov@yandex-team.ru \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.