Discussion:
[Xcb] [Bug 96395] New: libxcb 1.12 does not build with python3
b***@freedesktop.org
2016-06-05 19:39:40 UTC
Permalink
https://bugs.freedesktop.org/show_bug.cgi?id=96395

Bug ID: 96395
Summary: libxcb 1.12 does not build with python3
Product: XCB
Version: 1.12
Hardware: Other
OS: All
Status: NEW
Severity: normal
Priority: medium
Component: Library
Assignee: ***@lists.freedesktop.org
Reporter: ***@freedesktop.org
QA Contact: ***@lists.freedesktop.org

libxcb 1.12 and master (65b298c7ca317d7e4316aa2b9e0499e13047c65c) fails to
build with python3.

The first issue with python3 was the tabs/spaces inconsistency. Once that was
addressed, the build continued to fail with:

Traceback (most recent call last):
File "./c_client.py", line 3294, in <module>
from xcbgen.state import Module
File "/opt/local/lib/python3.4/site-packages/xcbgen/state.py", line 7, in
<module>
from xcbgen import matcher
File "/opt/local/lib/python3.4/site-packages/xcbgen/matcher.py", line 12, in
<module>
from xcbgen.xtypes import *
File "/opt/local/lib/python3.4/site-packages/xcbgen/xtypes.py", line 504
print "Explicit start-align for %s: %s\n" % (self,
self.required_start_align)
^

Originally reported at https://trac.macports.org/ticket/51514#no3

Full log:
https://gist.github.com/cdeil/eac3b160a5b6475eac3b4e0b129e7bb6#file-gistfile1-txt-L393
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
b***@freedesktop.org
2016-06-05 19:39:53 UTC
Permalink
https://bugs.freedesktop.org/show_bug.cgi?id=96395

Jeremy Huddleston Sequoia <***@freedesktop.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://trac.macports.org/t
| |icket/51514
--
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
b***@freedesktop.org
2016-06-05 19:40:28 UTC
Permalink
https://bugs.freedesktop.org/show_bug.cgi?id=96395

Jeremy Huddleston Sequoia <***@freedesktop.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Summary|libxcb 1.12 does not build |libxcb 1.12 does not build
|with python3 |with python 3.4
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
b***@freedesktop.org
2016-06-05 20:06:22 UTC
Permalink
https://bugs.freedesktop.org/show_bug.cgi?id=96395

--- Comment #1 from Josh Triplett <***@freedesktop.org> ---
It's clear from the line in the traceback that that's a print statement, not a
print function. For compatibility, XCB would need to use "from __future__
import print_function" and then switch to using print as a function.

I'm all for making xcbgen work with Python 3, but for the moment, until that
works, could we explicitly use Python 2 to prevent this breakage?

The scripts use "/usr/bin/env python". "python" should not refer to Python 3,
per PEP 394 (https://www.python.org/dev/peps/pep-0394/), which says "for the
time being, all distributions should ensure that python refers to the same
target as python2"; however, some distributions (including Arch, and apparently
including macports in some configurations) go against that recommendation and
knowingly cause breakage. To avoid that, we could use "python2" in the shebang
lines.

Similarly, in configure.ac, after calling AM_PATH_PYTHON, we should check that
$PYTHON_VERSION starts with "2.".
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
b***@freedesktop.org
2016-06-06 00:26:38 UTC
Permalink
https://bugs.freedesktop.org/show_bug.cgi?id=96395

--- Comment #2 from Jeremy Huddleston Sequoia <***@freedesktop.org> ---
The very next line states:

however, end users should be aware that python refers to python3 on at least
Arch Linux (that change is what prompted the creation of this PEP), so python
should be used in the shebang line only for scripts that are source compatible
with both Python 2 and 3.

So should we change the shbang to python2 for better compatibility?
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
b***@freedesktop.org
2016-06-06 00:30:30 UTC
Permalink
https://bugs.freedesktop.org/show_bug.cgi?id=96395

--- Comment #3 from Jeremy Huddleston Sequoia <***@freedesktop.org> ---
Crap, saved too soon...

I'd bet there's an autoconf macro out there somewhere to handle finding an
appropriate python2 interpreter.

On systems where python2 doesn't exist, we'd still want to fallback on python.
I see on OS X that /usr/bin/python2.7 and /usr/bin/python exist, but there is
no /usr/bin/python2.
--
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
b***@freedesktop.org
2016-06-06 00:51:43 UTC
Permalink
https://bugs.freedesktop.org/show_bug.cgi?id=96395

--- Comment #4 from Josh Triplett <***@freedesktop.org> ---
(In reply to Jeremy Huddleston Sequoia from comment #2)
Post by b***@freedesktop.org
So should we change the shbang to python2 for better compatibility?
Yes, that's one of the things I'm suggesting. But I'd also suggest that
MacPorts should not install Python 3 as "python", in any configuration.
Post by b***@freedesktop.org
I'd bet there's an autoconf macro out there somewhere to handle finding an appropriate python2 interpreter.
We'd need one, yes. It should check for "python2", fall back to "python", and
otherwise act like AM_PATH_PYTHON.
--
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
b***@freedesktop.org
2016-06-06 02:57:38 UTC
Permalink
https://bugs.freedesktop.org/show_bug.cgi?id=96395

--- Comment #5 from Jeremy Huddleston Sequoia <***@freedesktop.org> ---
(In reply to Josh Triplett from comment #4)
Post by b***@freedesktop.org
(In reply to Jeremy Huddleston Sequoia from comment #2)
Post by b***@freedesktop.org
So should we change the shbang to python2 for better compatibility?
Yes, that's one of the things I'm suggesting. But I'd also suggest that
MacPorts should not install Python 3 as "python", in any configuration.
MacPorts doesn't. Users control that themselves (to their own detriment).
--
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
b***@freedesktop.org
2016-06-06 03:02:43 UTC
Permalink
https://bugs.freedesktop.org/show_bug.cgi?id=96395

--- Comment #6 from Josh Triplett <***@freedesktop.org> ---
(In reply to Jeremy Huddleston Sequoia from comment #5)
Post by b***@freedesktop.org
(In reply to Josh Triplett from comment #4)
Post by b***@freedesktop.org
(In reply to Jeremy Huddleston Sequoia from comment #2)
Post by b***@freedesktop.org
So should we change the shbang to python2 for better compatibility?
Yes, that's one of the things I'm suggesting. But I'd also suggest that
MacPorts should not install Python 3 as "python", in any configuration.
MacPorts doesn't. Users control that themselves (to their own detriment).
That's what I meant; thanks for filing https://trac.macports.org/ticket/51572 .

(Note, for instance, that Debian's Python packages intentionally do not manage
/usr/bin/python via the alternatives mechanism.)
--
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
b***@freedesktop.org
2016-06-06 15:43:19 UTC
Permalink
https://bugs.freedesktop.org/show_bug.cgi?id=96395

--- Comment #7 from Chí-Thanh Christopher Nguyễn <***@gentoo.org> ---
All python-3 failures that I was seeing have been addressed in git already.
--
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
b***@freedesktop.org
2016-06-06 16:03:09 UTC
Permalink
https://bugs.freedesktop.org/show_bug.cgi?id=96395

--- Comment #8 from Jeremy Huddleston Sequoia <***@freedesktop.org> ---
Oh, this is actually in xcb-proto, not libxcb.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
b***@freedesktop.org
2016-06-06 16:09:13 UTC
Permalink
https://bugs.freedesktop.org/show_bug.cgi?id=96395

Jeremy Huddleston Sequoia <***@freedesktop.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED

--- Comment #9 from Jeremy Huddleston Sequoia <***@freedesktop.org> ---
commit bea5e1c85bdc0950913790364e18228f20395a3d
Author: Thomas Klausner <***@NetBSD.org>
Date: Thu May 19 17:30:05 2016 +0200
--
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
Loading...