[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: golang bindings dirty in tree after libxl build


  • To: George Dunlap <George.Dunlap@xxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 12 Jun 2020 13:15:53 +0100
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "rosbrookn@xxxxxxxxx" <rosbrookn@xxxxxxxxx>
  • Delivery-date: Fri, 12 Jun 2020 12:16:01 +0000
  • Ironport-sdr: NKcKlwxWljgx+R7dtt4YKZaLPoc8WwgO0grQBfms08EHwOvRVo/Re1r/aeWKE1Lp6SMmGWjTsk rz3i0PvaauRETPH7fV/gT2gmP90EqzVIJtJ6MJP+rQbw1SwTuNdOXW0wgHdEPD2fpgJLG7tcxX asq7VXhpNxaN4OT/6wZa/bcTob/zvf+amuLYBWKNrpfHVS0ffQk2Dap7dWznIwQyyztKzwQFY+ 8jL8sQYvLK9yam0gNtfNpx9Y7ul/aJX/rIt0/0TiP5EIqr6RcBEszuwnFYry8Kc53ht9sSdPkK yqU=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 12/06/2020 12:59, George Dunlap wrote:
>
>> On Jun 12, 2020, at 12:00 PM, Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx> 
>> 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



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.