On 26/03/13 22:27, Jamie Nguyen wrote:
> On 26/03/13 21:49, Alan Robertson wrote:
>> I don't see this problem on my systems...
>>
>> I'm running both of these systems from the pip-extracted versions of
>> ctypesgen.py. Don't know if it matters...
>>
>> Just to make sure, I removed the source I had, and re-extracted it and
>> rebuilt it. Same results.
>
>
> Hmm ok so I did a build outside of mock and it doesn't have the error,
> so it seems to be something different happening inside mock. Haven't
> quite figured out why this is the case, but I guess something to do with
> ctypesgen.
It appears the ordering of *.h files is the problem, which is related to
this line in buildtools/genpybindings.py:
hdrfiles=os.listdir(includedir)
As I understand, the ordering of listdir is arbitrary (and things like
the filesystem affect it). Here are the orders I'm getting, the first
set is working and the second set is giving the parsing error.
[no errors]
>>> os.listdir('include')
['proj_classes.h', 'packetdecoder.h', 'compressframe.h', 'cryptframe.h',
'fsqueue.h', 'projectcommon.h.in', 'jsondiscovery.h', 'server_dump.h',
'hbsender.h', 'assimobj.h', 'listener.h', 'cmalib.h', 'nanoprobe.h',
'frameset.h', 'signframe.h', 'reliableudp.h', 'netio.h', 'seqnoframe.h',
'netaddr.h', 'pcap_min.h', 'address_family_numbers.h', 'pcap_GSource.h',
'addrframe.h', 'netgsource.h', 'generic_tlv_min.h', 'unknownframe.h',
'tlvhelper.h', 'hblistener.h', 'tlv_valuetypes.h', 'misc.h',
'intframe.h', 'discovery.h', 'configcontext.h', 'switchdiscovery.h',
'CMakeLists.txt', 'nvpairframe.h', 'cdp.h', 'cstringframe.h',
'netioudp.h', 'authlistener.h', 'ipportframe.h', 'frame.h',
'fsprotocol.h', 'lldp.h']
[parsing error]
>>> os.listdir('include')
['fsqueue.h', 'listener.h', 'packetdecoder.h', 'netaddr.h',
'nanoprobe.h', 'jsondiscovery.h', 'cstringframe.h', 'tlvhelper.h',
'hbsender.h', 'proj_classes.h', 'switchdiscovery.h', 'hblistener.h',
'configcontext.h', 'misc.h', 'authlistener.h', 'pcap_min.h',
'generic_tlv_min.h', 'addrframe.h', 'pcap_GSource.h',
'projectcommon.h.in', 'ipportframe.h', 'nvpairframe.h', 'netio.h',
'seqnoframe.h', 'unknownframe.h', 'assimobj.h', 'compressframe.h',
'signframe.h', 'intframe.h', 'reliableudp.h', 'fsprotocol.h',
'netgsource.h', 'cryptframe.h', 'cmalib.h', 'discovery.h', 'cdp.h',
'server_dump.h', 'netioudp.h', 'CMakeLists.txt', 'lldp.h',
'tlv_valuetypes.h', 'address_family_numbers.h', 'frameset.h', 'frame.h']
It would appear that certain orders cause problems, so I guess the fix
would be to either sort or specify an explicit order manually.
Manually writing the arguments for ctypesgen to match the order of
header files in the first set made the errors disappear. I also tried
just sorting them and the errors disappeared after I applied this patch:
--- a/buildtools/genpybindings.py
+++ b/buildtools/genpybindings.py
@@ -97,7 +97,7 @@
# Starting with the full pathname to glib.h
args.append(findincfile(glibincdirs, glibheaderfile))
# Add on the pathnames of all our header files
- hdrfiles=os.listdir(includedir)
+ hdrfiles=sorted(os.listdir(includedir))
hfileset={}
for hfile in hdrfiles:
if not hfile.endswith('.h'):
Kind regards,
--
Jamie Nguyen
_______________________________________________
Assimilation mailing list - Discovery-Driven Monitoring
[email protected]
http://lists.community.tummy.com/cgi-bin/mailman/listinfo/assimilation
http://assimmon.org/