[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XEN PATCH v3 1/1] build: replace get-fields.sh by a python script
- To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
- From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
- Date: Tue, 17 Jan 2023 16:58:35 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MYdEvaRF12y9D6I+kU42P8nMQ/30uTiKnkvwqrx5g7Y=; b=MA0hpfWHtbptL5pCN/T4mw7H3OU3BDirHSSae5gvc32wIeEH8ywaiA4cGH3i8VIH3Wmc7iEHUrkc78BITQIhtd3ooM0NPEv0zMfHR7we3b3y6QB82uNgkxQ9q9KWklEutugOHXL3hLqViiRnb8OMQgQTAFrQWl7Ngs/G7XUheQSrGcfOjirH56rRuttt0qrQtrNBV+mekpqZI9yAYKWwAFaypSZIj3S8OMs5Vz55aEwSJCHc0J6gl1svDZr02jOx+bL9ZBrr6vw2Jj0X12J2Dbn0yBzydL/fvo7/SgaZ9QKwBQ+NOsqUissyDYEixilYjUalgPh2xwPg67sRHHwKdg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XJxuRSNWokEJETZGnpQ5fWidAlb15KgO2eeIgqlHqBD3/hQ4oGozXPpBYA8C+8SNCa7zEv6V/YxNiBkYHc6e//e92Bu5ogoNPHvBDwW7h2C9NoEJxClovKHjnFMmqiM7hx7w+4g5rclM5lTxAV2l0fLvFk6QSPfyRfE3J8hZPusSkY6+U3moRWzvtE5wo02ToiXZVNteFFNm8kA2xiSJ1iD5nOnAOFORXOaJXJaQrkUJHMIN8cVe6f2KVcDHx9nkgfaFhwxEu5YqOQJ5782vXrt+VwLObRZu41q0ckBktphnGLyKblkSJSo1nmNwRgXF4wtg941j12Mh8VM/562+pg==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Tue, 17 Jan 2023 16:59:20 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Thread-index: AQHZKdYEuIagcBo/xkCEsH1joQzNJq6ix9mAgAANiICAAADFAA==
- Thread-topic: [XEN PATCH v3 1/1] build: replace get-fields.sh by a python script
> On 17 Jan 2023, at 16:55, Anthony PERARD <anthony.perard@xxxxxxxxxx> wrote:
>
> On Tue, Jan 17, 2023 at 04:07:24PM +0000, Luca Fancellu wrote:
>>> On 16 Jan 2023, at 18:10, Anthony PERARD <anthony.perard@xxxxxxxxxx> wrote:
>>> diff --git a/xen/tools/compat-xlat-header.py
>>> b/xen/tools/compat-xlat-header.py
>>> new file mode 100644
>>> index 0000000000..c1b361ac56
>>> --- /dev/null
>>> +++ b/xen/tools/compat-xlat-header.py
>>> @@ -0,0 +1,468 @@
>>> +#!/usr/bin/env python
>>
>> Would it make sense to start with python3 since it is a new script?
>
> That shebang isn't even used as the script doesn't even have the
> execution bit set. So why do you say that the script isn't python3? Not
> really asking, just been pedantic :-)
Yes I didn’t pay attention to that
>
> Even if it's a new script, it isn't a new project. We can't depend on
> brand new functionality from our dependencies. We need to be able to
> build the hypervisor with old build toolchain / distribution.
>
> Anyway, I did start by writing a python3 script in all its glory (or at
> least some of the new part of the language that I know about), but I had
> to rework it to be able to use it on older distribution. Our centos7
> container in our GitLab CI seems to use python2.7.
That makes sense, thanks for the explanation.
>
> So I had to stop using str.removeprefix() and I introduce some function
> doing the same thing instead (so that works with older than python 3.9).
> Then I had to stop using f-strings and use %-formatting instead.
> Then use "m.groups()[0]" instead of "m[1]" where "m" is a match result
> from re.match() and other.
> And use the classing "from __future__ ..." preamble.
>
> Cheers,
>
> --
> Anthony PERARD
|