* golang bindings dirty in tree after libxl build
@ 2020-06-12 11:00 Andrew Cooper
2020-06-12 11:59 ` George Dunlap
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cooper @ 2020-06-12 11:00 UTC (permalink / raw)
To: xen-devel, George Dunlap, rosbrookn
Hello,
I've just done a libxl build and got things such as:
--- a/tools/golang/xenlight/helpers.gen.go
+++ b/tools/golang/xenlight/helpers.gen.go
@@ -431,14 +431,14 @@ x.Evtch = int(xc.evtch)
x.Rref = int(xc.rref)
x.Connection = ChannelConnection(xc.connection)
switch x.Connection{
-case ChannelConnectionUnknown:
-x.ConnectionUnion = nil
case ChannelConnectionPty:
var connectionPty ChannelinfoConnectionUnionPty
if err := connectionPty.fromC(xc);err != nil {
return fmt.Errorf("converting field connectionPty: %v", err)
}
x.ConnectionUnion = connectionPty
+case ChannelConnectionUnknown:
+x.ConnectionUnion = nil
case ChannelConnectionSocket:
x.ConnectionUnion = nil
default:
dirty in tree. They are all case labels, and only their order in the
switch has changed.
Does the current binding generation rely on the order of entries in a
python dictionary by any chance?
~Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: golang bindings dirty in tree after libxl build
2020-06-12 11:00 golang bindings dirty in tree after libxl build Andrew Cooper
@ 2020-06-12 11:59 ` George Dunlap
2020-06-12 12:15 ` Andrew Cooper
0 siblings, 1 reply; 4+ messages in thread
From: George Dunlap @ 2020-06-12 11:59 UTC (permalink / raw)
To: Andrew Cooper; +Cc: xen-devel, rosbrookn
> On Jun 12, 2020, at 12:00 PM, Andrew Cooper <Andrew.Cooper3@citrix.com> wrote:
>
> Hello,
>
> I've just done a libxl build and got things such as:
>
> --- a/tools/golang/xenlight/helpers.gen.go
> +++ b/tools/golang/xenlight/helpers.gen.go
> @@ -431,14 +431,14 @@ x.Evtch = int(xc.evtch)
> x.Rref = int(xc.rref)
> x.Connection = ChannelConnection(xc.connection)
> switch x.Connection{
> -case ChannelConnectionUnknown:
> -x.ConnectionUnion = nil
> case ChannelConnectionPty:
> var connectionPty ChannelinfoConnectionUnionPty
> if err := connectionPty.fromC(xc);err != nil {
> return fmt.Errorf("converting field connectionPty: %v", err)
> }
> x.ConnectionUnion = connectionPty
> +case ChannelConnectionUnknown:
> +x.ConnectionUnion = nil
> case ChannelConnectionSocket:
> x.ConnectionUnion = nil
> default:
>
> dirty in tree. They are all case labels, and only their order in the
> switch has changed.
>
> Does the current binding generation rely on the order of entries in a
> python dictionary by any chance?
Not explicitly, but obviously somewhat implicitly.
Is this a python2/3 issue, or would different versions of python within 2/3 end up with different sort orders?
If python3 will always put them in the same order, then we might consider just switching the script to being explicitly python3. Otherwise, we’ll probably have to add sorts.
-George
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: golang bindings dirty in tree after libxl build
2020-06-12 11:59 ` George Dunlap
@ 2020-06-12 12:15 ` Andrew Cooper
2020-06-12 13:38 ` Nick Rosbrook
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cooper @ 2020-06-12 12:15 UTC (permalink / raw)
To: George Dunlap; +Cc: xen-devel, rosbrookn
On 12/06/2020 12:59, George Dunlap wrote:
>
>> On Jun 12, 2020, at 12:00 PM, Andrew Cooper <Andrew.Cooper3@citrix.com> wrote:
>>
>> Hello,
>>
>> I've just done a libxl build and got things such as:
>>
>> --- a/tools/golang/xenlight/helpers.gen.go
>> +++ b/tools/golang/xenlight/helpers.gen.go
>> @@ -431,14 +431,14 @@ x.Evtch = int(xc.evtch)
>> x.Rref = int(xc.rref)
>> x.Connection = ChannelConnection(xc.connection)
>> switch x.Connection{
>> -case ChannelConnectionUnknown:
>> -x.ConnectionUnion = nil
>> case ChannelConnectionPty:
>> var connectionPty ChannelinfoConnectionUnionPty
>> if err := connectionPty.fromC(xc);err != nil {
>> return fmt.Errorf("converting field connectionPty: %v", err)
>> }
>> x.ConnectionUnion = connectionPty
>> +case ChannelConnectionUnknown:
>> +x.ConnectionUnion = nil
>> case ChannelConnectionSocket:
>> x.ConnectionUnion = nil
>> default:
>>
>> dirty in tree. They are all case labels, and only their order in the
>> switch has changed.
>>
>> Does the current binding generation rely on the order of entries in a
>> python dictionary by any chance?
> Not explicitly, but obviously somewhat implicitly.
>
> Is this a python2/3 issue, or would different versions of python within 2/3 end up with different sort orders?
>
> If python3 will always put them in the same order, then we might consider just switching the script to being explicitly python3. Otherwise, we’ll probably have to add sorts.
Python 3.6 now guarantees that the insert order of elements will be
preserved. Before that, there are no guarantees at all.
It sounds like some sprinkling of sorted() will be needed.
~Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: golang bindings dirty in tree after libxl build
2020-06-12 12:15 ` Andrew Cooper
@ 2020-06-12 13:38 ` Nick Rosbrook
0 siblings, 0 replies; 4+ messages in thread
From: Nick Rosbrook @ 2020-06-12 13:38 UTC (permalink / raw)
To: Andrew Cooper; +Cc: xen-devel, George Dunlap
On Fri, Jun 12, 2020 at 8:15 AM Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>
> On 12/06/2020 12:59, George Dunlap wrote:
> >
> >> On Jun 12, 2020, at 12:00 PM, Andrew Cooper <Andrew.Cooper3@citrix.com> wrote:
> >>
> >> Hello,
> >>
> >> I've just done a libxl build and got things such as:
> >>
> >> --- a/tools/golang/xenlight/helpers.gen.go
> >> +++ b/tools/golang/xenlight/helpers.gen.go
> >> @@ -431,14 +431,14 @@ x.Evtch = int(xc.evtch)
> >> x.Rref = int(xc.rref)
> >> x.Connection = ChannelConnection(xc.connection)
> >> switch x.Connection{
> >> -case ChannelConnectionUnknown:
> >> -x.ConnectionUnion = nil
> >> case ChannelConnectionPty:
> >> var connectionPty ChannelinfoConnectionUnionPty
> >> if err := connectionPty.fromC(xc);err != nil {
> >> return fmt.Errorf("converting field connectionPty: %v", err)
> >> }
> >> x.ConnectionUnion = connectionPty
> >> +case ChannelConnectionUnknown:
> >> +x.ConnectionUnion = nil
> >> case ChannelConnectionSocket:
> >> x.ConnectionUnion = nil
> >> default:
> >>
> >> dirty in tree. They are all case labels, and only their order in the
> >> switch has changed.
> >>
> >> Does the current binding generation rely on the order of entries in a
> >> python dictionary by any chance?
> > Not explicitly, but obviously somewhat implicitly.
> >
> > Is this a python2/3 issue, or would different versions of python within 2/3 end up with different sort orders?
> >
> > If python3 will always put them in the same order, then we might consider just switching the script to being explicitly python3. Otherwise, we’ll probably have to add sorts.
>
> Python 3.6 now guarantees that the insert order of elements will be
> preserved. Before that, there are no guarantees at all.
>
> It sounds like some sprinkling of sorted() will be needed.
George,
Unless you have a burning desire, I can take care of this patch today
or tomorrow.
-NR
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-06-12 13:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-12 11:00 golang bindings dirty in tree after libxl build Andrew Cooper
2020-06-12 11:59 ` George Dunlap
2020-06-12 12:15 ` Andrew Cooper
2020-06-12 13:38 ` Nick Rosbrook
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).