Bug 40925 - [bisected] cairo failed to build with XCB enabled(it is default enable)
Summary: [bisected] cairo failed to build with XCB enabled(it is default enable)
Status: VERIFIED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: xcb backend (show other bugs)
Version: 1.10.3
Hardware: x86 (IA32) Linux (All)
: high critical
Assignee: Uli Schlachter
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-16 00:40 UTC by zhao jian
Modified: 2011-09-19 01:38 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Ugly workaround (588 bytes, patch)
2011-09-16 01:10 UTC, Uli Schlachter
Details | Splinter Review

Description zhao jian 2011-09-16 00:40:40 UTC
A commit in cairo using xcb_discard_reply caused cairo failed to build, and I don't know what is this function used for and where it is.  The commit is 

commit 968eb30bba1dc942ccd31e4450fdd3bb74c83cb6
Author: Uli Schlachter <psychon@znc.in>
Date:   Thu Sep 1 13:34:43 2011 +0200

    xcb: Steal from the pending list for GetImage

If I just comment that line it can build successfully. 

diff --git a/src/cairo-xcb-shm.c b/src/cairo-xcb-shm.c
index 6972720..949e515 100644
--- a/src/cairo-xcb-shm.c
+++ b/src/cairo-xcb-shm.c
@@ -514,7 +514,7 @@ _cairo_xcb_connection_allocate_shm_info (cairo_xcb_connection_t *connection,
                cairo_list_del (&shm_info->pending);
                CAIRO_MUTEX_UNLOCK (connection->shm_mutex);

-               xcb_discard_reply (connection->xcb_connection, shm_info->sync.sequence);
+//             xcb_discard_reply (connection->xcb_connection, shm_info->sync.sequence);
                shm_info->sync.sequence = XCB_NONE;

                *shm_info_out = shm_info;
Comment 1 Uli Schlachter 2011-09-16 01:10:18 UTC
Created attachment 51254 [details] [review]
Ugly workaround

xcb_discard_reply() was added in libxcb 1.6, released April 2010. Configure currently checks for xcb >= 1.1.92 since that is when xcb_take_socket() was added, although this function isn't used anymore.

Which version of libxcb do you have?

Attached is a patch which forces a round trip instead of using xcb_discard_reply(). I think a better fix would be to add a check for xcb_discard_reply() to configure and skip the whole "if (might_reuse)" block if we don't have that function. I guess I'll be building old xcb versions.
Comment 2 Uli Schlachter 2011-09-16 09:06:52 UTC
commit 7ba28ff563ab8a8e77213789860b2d412577a309 makes configure require libxcb 1.6 for cairo-xcb. This should mean that cairo-xcb gets disabled for your, but since this isn't a supported backend in any release yet, we better only start adding lots of #ifdefs later. ;-)


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.