From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Thomas Huth" <thuth@redhat.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Alex Bennée" <alex.bennee@linaro.org>,
qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com
Subject: Re: [PATCH] qapi: Fix code generation with Python 3.5
Date: Sun, 19 Jan 2020 12:23:30 +0100 [thread overview]
Message-ID: <4179b4ec-00cd-6e09-7a98-fab422075d72@amsat.org> (raw)
In-Reply-To: <b8976470-1fe3-f380-8bde-af2d7c29c9ab@redhat.com>
On 1/18/20 9:33 AM, Philippe Mathieu-Daudé wrote:
> On 1/17/20 11:49 AM, Markus Armbruster wrote:
>> Thomas Huth <thuth@redhat.com> writes:
>>
>>> On 16/01/2020 21.25, Markus Armbruster wrote:
>>>> Recent commit 3e7fb5811b "qapi: Fix code generation for empty modules"
>>>> modules" switched QAPISchema.visit() from
>>>>
>>>> for entity in self._entity_list:
>>>>
>>>> effectively to
>>>>
>>>> for mod in self._module_dict.values():
>>>> for entity in mod._entity_list:
>>>>
>>>> Visits in the same order as long as .values() is in insertion order.
>>>> That's the case only for Python 3.6 and later. Before, it's in some
>>>> arbitrary order, which results in broken generated code.
>>>>
>>>> Fix by making self._module_dict an OrderedDict rather than a dict.
>>>>
>>>> Fixes: 3e7fb5811baab213dcc7149c3aa69442d683c26c
>>>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>>>> ---
>>>> scripts/qapi/schema.py | 2 +-
>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
>>>> index 0bfc5256fb..5100110fa2 100644
>>>> --- a/scripts/qapi/schema.py
>>>> +++ b/scripts/qapi/schema.py
>>>> @@ -795,7 +795,7 @@ class QAPISchema(object):
>>>> self.docs = parser.docs
>>>> self._entity_list = []
>>>> self._entity_dict = {}
>>>> - self._module_dict = {}
>>>> + self._module_dict = OrderedDict()
>>>> self._schema_dir = os.path.dirname(fname)
>>>> self._make_module(None) # built-ins
>>>> self._make_module(fname)
>>>>
>>>
>>> Thanks, this fixes the problems on Travis for me!
>>>
>>> Tested-by: Thomas Huth <thuth@redhat.com>
>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
And per https://www.mail-archive.com/qemu-devel@nongnu.org/msg671745.html:
Tested-by: BALATON Zoltan <balaton@eik.bme.hu>
>>> Peter, could you maybe apply this directly to the master branch as a
>>> build fix?
>>
>> The commit message isn't quite right: s/Visits in the same order/Visits
>> modules in the same order/. Peter, want me to respin for that?
>
> Since it is a single patch, it shouldn't be too much work to respin :)
>
> I agree this patch is candidate for direct fix on /master.
>
> Thanks,
>
> Phil.
>
>
next prev parent reply other threads:[~2020-01-19 11:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-16 20:25 [PATCH] qapi: Fix code generation with Python 3.5 Markus Armbruster
2020-01-16 21:17 ` John Snow
2020-01-17 7:07 ` Markus Armbruster
2020-01-17 19:41 ` John Snow
2020-01-18 6:54 ` Markus Armbruster
2020-02-07 21:54 ` Eduardo Habkost
2020-01-18 8:29 ` Philippe Mathieu-Daudé
2020-01-20 5:46 ` [Qemu-devel] Xenial in Travis (was: qapi: Fix code generation with Python 3.5) Thomas Huth
2020-01-17 9:34 ` [PATCH] qapi: Fix code generation with Python 3.5 Thomas Huth
2020-01-17 10:49 ` Markus Armbruster
2020-01-18 8:33 ` Philippe Mathieu-Daudé
2020-01-19 11:23 ` Philippe Mathieu-Daudé [this message]
2020-01-20 10:52 ` Alex Bennée
2020-01-20 12:53 ` 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=4179b4ec-00cd-6e09-7a98-fab422075d72@amsat.org \
--to=f4bug@amsat.org \
--cc=alex.bennee@linaro.org \
--cc=armbru@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.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).