Bug 60502

Summary: xpyb: damage.py does not work: "NameError: global name 'RECTANGLE' is not defined"
Product: XCB Reporter: Dan McDougall <daniel.mcdougall>
Component: LibraryAssignee: xcb mailing list dummy <xcb>
Status: RESOLVED MOVED QA Contact: xcb mailing list dummy <xcb>
Severity: major    
Priority: medium    
Version: 1.1   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Output from make
config.log
Patch to fix RECTANGLE namespace.

Description Dan McDougall 2013-02-08 16:04:35 UTC
For whatever reason, the build process of xpyb results in an error in the damage.py module.  The two occurrences of RECTANGLE in the file should be xproto.RECTANGLE.  This problem seems to exist in all packages of xpyb that I've encountered (Debian/Ubuntu/pypi).

I tried looking at the Makefile and other areas of the build process to find the bug/make a patch but it is way over my head.  I don't know why damage.py is being generated incorrectly but something as simple as a search/replace at the end of the build process would work around the problem as a quick fix...

sed -i -e 's/RECTANGLE/xproto.RECTANGLE/g' damage.py

Let me know if I can be of any assistance in fixing this bug.  Thanks!
Comment 1 Daniel Martin 2013-02-09 15:57:27 UTC
Could you attach the config.log and output of make, please?

(I can't reproduce this on ArchLinux with Python 2.7. With Python 3.3 configure fires an "invalid syntax" error when searching for the include path. But, that should be a different bug.)
Comment 2 Dan McDougall 2013-02-12 18:25:12 UTC
Created attachment 74702 [details]
Output from make
Comment 3 Dan McDougall 2013-02-12 18:25:45 UTC
Created attachment 74703 [details]
config.log
Comment 4 Dan McDougall 2013-02-12 18:26:12 UTC
The make output as well as the config.log are attached.
Comment 5 Klee Dienes 2014-08-24 02:50:22 UTC
I ran into the same problem on Debian unstable using python-xcbgen 1.10-1.

I don't have convenient access to an Arch system, but it's hard for me to understand how it could be working.  Is damage.py on Arch ending up with references to xproto.RECTANGLE?  Or is RECTANGLE somehow getting loaded by damage.py?

From my brief scan, it looked to me like the problem is that py_client.py:_t is stripping the namespace information from types before emitting.  I was able to fix the problem for my purposes with the attached patch.  I undoubtedly missed some cases. I'm happy to clean it up for submission if it turns out I am on the right track.
Comment 6 Klee Dienes 2014-08-24 02:51:13 UTC
Created attachment 105182 [details] [review]
Patch to fix RECTANGLE namespace.
Comment 7 GitLab Migration User 2019-02-16 19:40:16 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/lib/libxcb/issues/6.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.