[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XEN PATCH for-4.17 v5 16/17] tools/golang/xenlight: Rework gengotypes.py and generation of *.gen.go
- To: George Dunlap <George.Dunlap@xxxxxxxxxx>
- From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
- Date: Fri, 14 Oct 2022 11:51:30 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=7tJ3oaM3I3DHrV/kwEG9eudAEl4Y4kaFHd4Y00Al7BQ=; b=SVS95ieKrzIA/L2iDPaFqkujwKQA3mQbHMdCXlOgyrKpu53YnBxKLu7BBcOzq4RKSulshQVXKPHVgj/7iEngmqND1tz1kA+6oCuHZpl9sR2bJNqfqLjKbCIjMco48Vw9Z7h9VliElOPNb67c7o8M3gvJLcxSmROB4dBqUTT/eA7oGU3G+BwS6bzi2q+zknO/tBQLQqHDbm+QxwXIYqpK1cl+Mw3QdQR5zl4RjkfpUTyci8BslUo4Zzoui9nmfuE6hp9qyqZgGT3CRrvQC91Xk8mtlscYteaAeYdfwcGhzuYDT35fuumBOQM0O+D4sCkeSt/3fv0L1Y8fWmWLl+criQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cmzje8WrT5qm7JnXdYBL+6oT4Tu8M5S0PxvaK0O3Rd/46A+TfShKeIlFRO7U9+eENN4SGTKSS2Z/8b0rBFKjpUFOfo5THV9a6BYirzcq3UNuBZx8KkFyUfya3mMEh8Ze5Wj8Cscv0d0Bho8QN1BGsEhwjegXA7VKVZQ6+2RFQUUo/4CXG3mOsbjxVRG4bmc1PnBzecURtXCfDRB597Q1I9uJh4vW4TQ5HIVIJWK6etSIMHCz7KIoKAkMALVUqCT+TQCpBxONXyQnYuzo9LbzBmAWmT1vJwT4cfsvjJgJyb7BtlSDcn/j6kA8m/6k9eCnToLTPOZ0Eg5PnCA8juoFdw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Anthony Perard <anthony.perard@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Henry Wang <Henry.Wang@xxxxxxx>, Nick Rosbrook <rosbrookn@xxxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Fri, 14 Oct 2022 11:51:59 +0000
- Ironport-data: A9a23:9QwFf60D/h9h4JtsnvbD5e9wkn2cJEfYwER7XKvMYLTBsI5bp2MFz WMdX2iBPf3eNDT1c40lbIiz80sHvZTVzYQ3HQc9pC1hF35El5HIVI+TRqvS04F+DeWYFR46s J9OAjXkBJppJpMJjk71atANlVEliefSAOKU5NfsYkhZXRVjRDoqlSVtkus4hp8AqdWiCkaGt MiaT/f3YTdJ4BYpdDNJg06/gEk35q6r4GpE5gZWic1j5zcyqVFEVPrzGonpR5fIatE8NvK3Q e/F0Ia48gvxl/v6Ior4+lpTWhRiro/6ZWBiuFIPM0SRqkEqShgJ+rQ6LJIhhXJ/0F1lqTzTJ OJl7vRcQS9xVkHFdX90vxNwS0mSNoUekFPLzOTWXWV+ACQqflO1q8iCAn3aMqUK3NpxIGZn7 McnayoGRReguuuczq6kH7wEasQLdKEHPas5k1Q5lXTzK6ljRprOBaLX+dVfwTE8wNhUGurTb NYYbjwpawncZxpIOREcD5dWcOWA3yGjNWEH7g3N4/NvuQA/zyQouFTpGPPTdsaHWoN+mUGAq 3id12/4HgsbJJqUzj/tHneE1rafwXOrAd16+LuQydx7rQOPxkEoLyYHRQGwv+GSlFOfRIcKQ 6AT0m90xUQoz2S7Q9+4UxCmrXqsuh8HR8EWA+A88BuKyKff/0CeHGdsZh5MbsY38vA/QzMC3 0WM2djuAFRHqrqOQ2ia8bSShTy3MCkRa2QFYEcsUg8t89Tl5oYpgXryos1LFae0ipj/H272y jXT9Cwm3exL14gMyrmx+k3Bj3S0vJ/VQwUp5wLRGGW48gd+Y43jbIutgbTG0ct9wE+iZgHpl BA5dwK2tYji0bnlePSxfdgw
- Ironport-hdrordr: A9a23:3SSBSKxWSGcNPuusIiFuKrPxmuskLtp133Aq2lEZdPULSKGlfp GV9sjziyWetN9IYgBapTiBUJPwIk80hqQFm7X5XI3SFjUO3VHFEGgM1/qE/9SNIUzDH6tmpN 9dmstFeZDN5DpB/KDHCWCDer5OruVvsprY/Ns2pE0dLz2CHpsQizuRfTzrd3GeKjMnObMJUL 6nouZXrTupfnoaKu6hAGMeYuTFr9rX0Lr7fB8vHXccmUazpALtzIS/PwmT3x8YXT8K66wl63 L5nwvw4bjmm+2nyyXby3TY4/1t6ZXcI5p4dY2xY/ouW3bRYzWTFcZcsnq5zXUISdSUmRYXeR /30lMd1opImjTslyqO0GbQMkHboUoTAjnZuBOlaDLY0LLErHhRMbs/uatJNhTe8EYup9d6ze ZC2H+YrYNeCVfakD36/MWgbWAiqqOYmwtUrQcotQ0obaIOLLtK6YAP9kJcF5kNWCr89YA8Ce FrSMXR/uxff1+WZ23Q+jAH+q3mYl0jWhOdBkQSsM2c1DZb2Hh/0ksD3cQa2nMN7og0RZVI7/ nNdq5oiLZNRMkLar8VPpZIfeKnTmjWBR7cOmObJlrqUKkBJnLWspbypK444em7EaZ4uKfaWK 6xJW+wmVRCCH4GU/f+raGj2iq9MFmVTHDq1txU4YR/t/n1WKfrWBfzOmwTrw==
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHY3wYExc++jpfrd0yvyakMPv5Mw64MavoAgAFV9YCAAAOmAIAAAXCAgAAChwA=
- Thread-topic: [XEN PATCH for-4.17 v5 16/17] tools/golang/xenlight: Rework gengotypes.py and generation of *.gen.go
On 14/10/2022 12:42, George Dunlap wrote:
On
14/10/2022 12:24, George Dunlap wrote:
On 13 Oct 2022, at 16:00, Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx> wrote:
On 13/10/2022 14:05, Anthony Perard wrote:
diff --git a/tools/golang/xenlight/gengotypes.py b/tools/golang/xenlight/gengotypes.py
index ac1cf060dd..ff4c2ad216 100644
--- a/tools/golang/xenlight/gengotypes.py
+++ b/tools/golang/xenlight/gengotypes.py
@@ -723,7 +723,13 @@ def xenlight_golang_fmt_name(name, exported = True):
return words[0] + ''.join(x.title() for x in words[1:])
if __name__ == '__main__':
+ if len(sys.argv) != 4:
+ print("Usage: gengotypes.py <idl> <types.gen.go> <helpers.gen.go>", file=sys.stderr)
This breaks with Py2.7. Needs a
from __future__ import print_function
inserting at the top.
Out of curiosity, did you notice this by inspection, or because you specifically tested Python 2.7, or because a system you were using is still actually using Python 2.7?
Xen's
build system can't actually create a build which supports Py2 and
Py3,
because xen.lowlevel.{xc,xs} only get built once. It would be nice
to
fix this, but -ETUITS, so we state a specific version in the specfile
and
mock ensures there is no trace of the other one.
XenServer
is in the process of trying to retire Py2, but it turns out
that
Xen isn't actually fully Py3 clean yet, so we use Py2 for Xen.
The
build breaks because the libxl build writes the .go files even when
we
don't actually want go bindings in the end.
I think the generation code is looped in even when golang is disabled so that we can detect IDL changes during development, even on systems which don’t have golang installed. In theory if libxl.idl doesn’t change, it shouldn’t trigger the build?
Alternately we could consider skipping the code generation on non-debug builds, since we only really need to detect changes during development.
This is a "clean" mock build, from a git archive'd tarball. Any logic like this is going to trigger unconditionally.
It's not a problem IMO - writing out one extra text file is not the slow bit of a Xen build.
~Andrew
|