From: Akihiko Odaki <akihiko.odaki@gmail.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, "Alexander Bulekov" <alxndr@bu.edu>,
"Bandan Das" <bsd@redhat.com>, "Thomas Huth" <thuth@redhat.com>,
"Volker Rümelin" <vr_qemu@t-online.de>,
"Darren Kenny" <darren.kenny@oracle.com>,
"Qiuhao Li" <Qiuhao.Li@outlook.com>,
"Jason Wang" <jasowang@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Gerd Hoffmann" <kraxel@redhat.com>
Subject: Re: [PATCH v3 4/4] net: convert to use qemu_find_file to locate bridge helper
Date: Thu, 16 Jun 2022 01:47:20 +0900 [thread overview]
Message-ID: <49bfd565-664c-ce10-ce79-f51fa9ddb3a6@gmail.com> (raw)
In-Reply-To: <YqnK5z5l4e9gNqeE@redhat.com>
On 2022/06/15 21:04, Daniel P. Berrangé wrote:
> On Wed, Jun 15, 2022 at 01:42:58PM +0200, Paolo Bonzini wrote:
>> On 6/15/22 12:52, Daniel P. Berrangé wrote:
>>> + case QEMU_FILE_TYPE_HELPER:
>>> + rel_install_dir = "";
>>> + rel_build_dir = "";
>>> + default_install_dir = default_helper_dir;
>>> + break;
>>> +
>>
>> You're replacing ad hoc rules in Akihiko's meson.build with an ad hoc enum +
>> the corresponding "case"s here in qemu_find_file(). There is duplication
>> anyway, in this case between Meson and QEMU (plus QEMU needs to know about
>> two filesystem layouts).
>
> IMHO this is simpler to deal with than the meson additions, and also
> avoids the confusion of having files appearing in two places in the
> build dir.
Thanks to Paolo's suggestion to unify the common code to build the
bundle tree, the required code for each bundled file is just a statement
now (something like: bundles += { destination: source }) in the v6.
Doing everything in Meson also allows to reuse the knowledge of the
build tree Meson already has. I do no longer think my patch series are
complicated more than yours. It even has less lines now.
There is still a room for improvements though. Particularly, the
installing code and bundle-tree code are still duplicate. For example,
pc-bios/meson.build now has the following code:
install_data(blobs, install_dir: qemu_datadir)
foreach f : blobs
bundles += { qemu_datadir / f: meson.current_source_dir() / f }
endforeach
It would be nice if it can be written like:
foreach f : blobs
bundle_data(qemu_datadir / f, f)
endforeach
Unfortunately Meson does not allow this.
Another problem is that the top-level meson.build is somewhat clutter.
In my opinion, it is a persistent problem of the build system but I
don't have a solution.
Anyway, I think my patch series is as close to the ideal as Meson
currently allows.
The confusion caused by the files appearing in two places in the
build tree should be minimal. qemu-bundle is implemented entirely with
symbolic links. If you know what is a symbolic link, you also know it is
an alias and the files appear in different places, and I expect everyone
hacking QEMU knows symbolic link.
>
> If we really want to have the build dir look just like the install
> dir though, why write custom meson commands per file type at all,
> instead add a rule that always invokes
>
> DESTDIR=$(BUILDDIR)/vroot ninja install
>
> to populate a dir that's guaranteed identical to the install layout
Unfortunately Meson cannot define a rule which will be always invoked as
far as I know.
Regards,
Akihiko Odaki
>
> Regards,
> Daniel
prev parent reply other threads:[~2022-06-15 16:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-15 10:52 [PATCH v3 0/4] softmmu: make qemu_find_file more flexible wrt build dir layout Daniel P. Berrangé
2022-06-15 10:52 ` [PATCH v3 1/4] softmmu: rewrite handling of qemu_find_file Daniel P. Berrangé
2022-06-15 10:52 ` [PATCH v3 2/4] ui: move 'pc-bios/keymaps' to 'ui/keymaps' Daniel P. Berrangé
2022-06-15 10:52 ` [PATCH v3 3/4] ui: find icons using qemu_find_file Daniel P. Berrangé
2022-06-15 10:52 ` [PATCH v3 4/4] net: convert to use qemu_find_file to locate bridge helper Daniel P. Berrangé
2022-06-15 11:42 ` Paolo Bonzini
2022-06-15 12:04 ` Daniel P. Berrangé
2022-06-15 16:47 ` Akihiko Odaki [this message]
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=49bfd565-664c-ce10-ce79-f51fa9ddb3a6@gmail.com \
--to=akihiko.odaki@gmail.com \
--cc=Qiuhao.Li@outlook.com \
--cc=alxndr@bu.edu \
--cc=berrange@redhat.com \
--cc=bsd@redhat.com \
--cc=darren.kenny@oracle.com \
--cc=f4bug@amsat.org \
--cc=jasowang@redhat.com \
--cc=kraxel@redhat.com \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=thuth@redhat.com \
--cc=vr_qemu@t-online.de \
/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).