From: Eric Blake <eblake@redhat.com>
To: Wei Yang <richardw.yang@linux.intel.com>,
Markus Armbruster <armbru@redhat.com>
Cc: berrange@redhat.com, kraxel@redhat.com, alex.bennee@linaro.org,
qemu-devel@nongnu.org, philmd@redhat.com
Subject: Re: [Qemu-devel] [PATCH] Makefile: simplify qapi-py definition with wildcard
Date: Tue, 21 May 2019 20:36:42 -0500 [thread overview]
Message-ID: <09538032-9453-9d09-2823-1515005b5516@redhat.com> (raw)
In-Reply-To: <20190522005349.GC14030@richard>
[-- Attachment #1: Type: text/plain, Size: 2302 bytes --]
On 5/21/19 7:53 PM, Wei Yang wrote:
> On Tue, May 21, 2019 at 05:28:27PM +0200, Markus Armbruster wrote:
>> Eric Blake <eblake@redhat.com> writes:
>>
>>> On 5/21/19 3:12 AM, Wei Yang wrote:
>>>> All the python script in scripts/qapi is used to generate qapi code. Use
>>>> wildcard to simplify it.
>>>>
>>>> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
>>>> ---
>>>> Makefile | 8 +-------
>>>> 1 file changed, 1 insertion(+), 7 deletions(-)
>>>
>>> I'm not a fan of $(wildcard). It makes your tarball creation
>>> non-deterministic - if there is a leftover file from development that is
>>> no longer part of the build, wildcard will still pick it up. Explicit
>>
>> Actually, in this case can "only" adds spurious prerequisites.
>
> Hmm... which spurious prerequisites will be added? I may miss something here.
If I touch the file scripts/qapi/foo.py, then that becomes a
prerequisite, and will rebuild my files even though it doesn't need to.
And if the definition of $(qapi-py) is ever applied to determining which
files to include in a tarball, then my tarball will include foo.py, even
though it is not essential to the tarball, while the next person, who
does not have foo.py lying around in their directory, produces a
different tarball. Non-deterministic results are bad, hence our rule of
thumb to avoid $(wildcard) when listing files in a Makefile.
>
>>
>>> lists are better. I'm inclined to NACK this, but Markus has final say
>>> since he maintains the qapi generator.
>>
>> I consider use of $(wildcard) for the purpose of collecting sources a
>> lazy mistake.
Which is another polite way of saying that this patch should not be applied.
If you WANT to factor things for less typing, you could use something like:
var=commands.py events.py introspect.py types.py visit.py common.py doc.py
$(addprefix $(SRC_PATH)/scripts/qapi/,$(var))
for some suitably-named var. Or even factor out the .py suffix as well.
That doesn't use the problematic $(wildcard), but still lets you get
away with easier maintenance of adding a new file to the explicit list
should we add a file in the future.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-05-22 1:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-21 8:12 [Qemu-devel] [PATCH] Makefile: simplify qapi-py definition with wildcard Wei Yang
2019-05-21 12:00 ` Eric Blake
2019-05-21 15:28 ` Markus Armbruster
2019-05-22 0:53 ` Wei Yang
2019-05-22 1:36 ` Eric Blake [this message]
2019-05-22 2:36 ` Wei Yang
2019-05-22 0:52 ` Wei Yang
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=09538032-9453-9d09-2823-1515005b5516@redhat.com \
--to=eblake@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=kraxel@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richardw.yang@linux.intel.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).