GNOME Bugzilla – Bug 423110
pyspi fails to build with pyrex 0.9.5.1a
Last modified: 2007-08-21 21:41:05 UTC
Please describe the problem: I'm building pyspi on suse i586 with pyrex version 0.9.5.1a and getting the failure below (also attached full build log). If I substitute pyrex version 0.9.4.1 pyspi builds fine. This happens with both with 0.6.1 and svn. Steps to reproduce: Actual results: building 'atspi' extension /usr/src/packages/BUILD/pyspi-0.6.1/cspi.pxd:52:107: Exception value incompatible with function return type /usr/src/packages/BUILD/pyspi-0.6.1/cspi.pxd:53:108: Exception value incompatible with function return type /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:1538:118: Exception value incompatible with function return type /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:1554:64: Invalid operand types for '|' (AccessibleDeviceEventType; AccessibleDeviceEventType) /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:163:7: 'Display' is not declared /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:163:7: 'Display' is not a type identifier /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:164:30: Cannot convert 'void (*)' to Python object /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:164:29: Cannot convert Python object to '<error>' /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:168:22: Cannot convert '<error>' to Python object /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:189:27: Type '__pyx_t_5atspi_bool' not acceptable as a boolean /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:321:42: Cannot assign type 'SPIBoolean' to '__pyx_t_5atspi_bool' /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:507:35: Type 'SPIBoolean' not acceptable as a boolean /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:778:44: Type 'SPIBoolean' not acceptable as a boolean /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:845:42: Type 'SPIBoolean' not acceptable as a boolean /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:889:45: Type 'SPIBoolean' not acceptable as a boolean /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:897:42: Type 'SPIBoolean' not acceptable as a boolean /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:905:44: Type 'SPIBoolean' not acceptable as a boolean /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:918:53: Type 'SPIBoolean' not acceptable as a boolean /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:926:51: Type 'SPIBoolean' not acceptable as a boolean /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:934:48: Type 'SPIBoolean' not acceptable as a boolean /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:1118:35: Type 'SPIBoolean' not acceptable as a boolean /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:1342:7: 'Display' is not declared /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:1342:7: 'Display' is not a type identifier /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:1345:7: 'KeySym' is not declared /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:1345:7: 'KeySym' is not a type identifier /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:1347:7: 'KeyCode' is not declared /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:1347:7: 'KeyCode' is not a type identifier /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:1343:30: Cannot convert 'void (*)' to Python object /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:1343:29: Cannot convert Python object to '<error>' /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:1348:31: Cannot convert '<error>' to Python object /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:1352:21: Cannot convert '<error>' to Python object /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:1378:40: Type 'SPIBoolean' not acceptable as a boolean /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:1439:37: Type 'SPIBoolean' not acceptable as a boolean /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:1482:47: Type 'SPIBoolean' not acceptable as a boolean /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:1523:19: Type 'SPIBoolean' not acceptable as a boolean /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:1544:8: Cannot assign type '__pyx_t_5atspi_bool' to 'SPIBoolean' /usr/src/packages/BUILD/pyspi-0.6.1/pyspi.pyx:1574:55: Type 'SPIBoolean' not acceptable as a boolean Expected results: Does this happen every time? Yes Other information:
I'm not sure how, but I didn't see this report until now, I'm sorry. Ugh, I'm not sure why Pyrex has a problem with pyspi now. I spent a few minutes looking into it but didn't make much progress. I'm currently working on making pyspi obsolete anyway... :)
The problem was caused by the update of pyrex from version 0.9.4.1 to 0.9.5.1a. Pyrex is now apparently much stricter about requiring matching return types from c functions. In short python booleans are int but /opt/gnome/include/at-spi-1.0/cspi/spi-impl.h (from the at-spi-devel package) has 'typedef unsigned int SPIBoolean'. So it appears to be the difference between unsigned int and int that is causing pyrex to fail.
Oh! I have SPIBoolean declared as an enum, which means it'll be signed; spi-impl.h just declares it as an unsigned int.
Created attachment 94076 [details] [review] Patch to make pyspi build with Pyrex 0.9.5.1a I just committed this patch that makes pyspi build with the new Pyrex. Build tested on F7.