[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Making QEMU build with Python 3
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] Making QEMU build with Python 3 |
Date: |
Wed, 9 Aug 2017 15:11:28 +0100 |
On Wed, Aug 9, 2017 at 1:53 PM, Philippe Mathieu-Daudé <address@hidden> wrote:
> On 08/09/2017 07:16 AM, Stefan Hajnoczi wrote:
> [...]> Python scripts needed to build QEMU are the highest priority. They
>>
>> are invoked by ./configure or make. I've identified the following:
>>
>> scripts/signrom.py
>> scripts/qapi*.py
>> scripts/modules/module_block.py
>> scripts/tracetool*
>>
> [...]
>>
>> The fundamentals of adding Python 3 support are:
>>
>> 1. The script must work correctly under both Python 2.6+ and Python 3.
>
> [...]
>>
>> 3. Avoid third-party package dependencies - QEMU currently has none!
>
>
> This seems true for the "invoked by ./configure or make" set. However:
>
> scripts/qemu-gdb.py:20:import gdb
> scripts/qemugdb/aio.py:13:import gdb
> scripts/qemugdb/coroutine.py:16:import gdb
> scripts/qemugdb/mtree.py:18:import gdb
>
> I just checked gdb8 and can't confirm python3 build works.
Yes, this is a GDB extension written in Python. The gdb module is
available in the interpreter environment that GDB sets up.
Even if GDB doesn't support Python 3 yet, they will eventually. It's
okay if we cannot add Python 3 support to these scripts yet.
> Also another 3rd party (python3 compliant):
>
> scripts/analyze-migration.py:20:import numpy as np
Weird, this script seems to use numpy APIs for unpacking binary data
instead of the standard library struct module. As far as I can tell
the usual numpy functionality isn't actually used. It should be easy
to drop the numpy dependency.
> Off-topic but we might document how to install dependencies for those
> scripts?
The analyze-migration.py script doesn't have any documentation, AFAIK.
Stefan