[MacPorts] #32306: glib2, glib2-devel: build fails when "python" is not 2.5 thru 2.7
MacPorts
noreply at macports.org
Wed Nov 30 11:20:02 PST 2011
#32306: glib2, glib2-devel: build fails when "python" is not 2.5 thru 2.7
---------------------------------+------------------------------------------
Reporter: gotyaoi@… | Owner: ryandesign@…
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.0.3
Keywords: | Port: glib2, glib2-devel
---------------------------------+------------------------------------------
Comment(by gale@…):
I am stuck on this one too. Here are some details:
I am on Mac OS X 10.6.8 on an Intel MacBook.
I am trying to upgrade:
glib2 2.28.8_0 < 2.30.2_1
I get the following error:
{{{
Making all in tests
make[4]: Entering directory
`/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_glib2/glib2/work/glib-2.30.2/gio/tests'
...
UNINSTALLED_GLIB_SRCDIR=../.. \
UNINSTALLED_GLIB_BUILDDIR=../.. \
/opt/local/bin/python ../../gio/gdbus-2.0/codegen/gdbus-
codegen \
--interface-prefix org.project. \
--generate-c-code gdbus-test-codegen-generated \
--c-generate-object-manager \
--c-namespace Foo_iGen \
--generate-docbook gdbus-test-codegen-generated-doc \
--annotate "org.project.Bar" Key1 Value1 \
--annotate "org.project.Bar" org.gtk.GDBus.Internal Value2
\
--annotate "org.project.Bar.HelloWorld()" Key3 Value3 \
--annotate "org.project.Bar::TestSignal" Key4 Value4 \
--annotate "org.project.Bar:ay" Key5 Value5 \
--annotate
"org.project.Bar.TestPrimitiveTypes()[val_int32]" Key6 Value6 \
--annotate
"org.project.Bar.TestPrimitiveTypes()[ret_uint32]" Key7 Value7 \
--annotate "org.project.Bar::TestSignal[array_of_strings]"
Key8 Value8 \
./test-codegen.xml \
Traceback (most recent call last):
File "../../gio/gdbus-2.0/codegen/gdbus-codegen", line 41, in <module>
sys.exit(codegen_main.codegen_main())
File
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_glib2/glib2/work/glib-2.30.2/gio/gdbus-2.0/codegen/codegen_main.py",
line 171, in codegen_main
parsed_ifaces = parser.parse_dbus_xml(xml_data)
File
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_glib2/glib2/work/glib-2.30.2/gio/gdbus-2.0/codegen/parser.py",
line 289, in parse_dbus_xml
parser = DBusXMLParser(xml_data)
File
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_glib2/glib2/work/glib-2.30.2/gio/gdbus-2.0/codegen/parser.py",
line 57, in __init__
self._parser.Parse(xml_data)
File
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_glib2/glib2/work/glib-2.30.2/gio/gdbus-2.0/codegen/parser.py",
line 155, in handle_start_element
if attrs.has_key('name') and self.doc_comment_last_symbol ==
attrs['name']:
AttributeError: 'dict' object has no attribute 'has_key'
}}}
Note that the syntax
{{{ attrs.has_key('name') }}}
is an old synonym for
{{{ 'name' in attrs }}}
that was removed in Python 3.
So this particular error is easy to fix. But I'm
not sure how easy it would be to go through
the python code in glib2 ourselves and ensure
that it is all compatible with Python 3.
That's a job for upstream.
The real issue is that since this port does still
require Python 2 only, we need to make sure
that is what it uses. (And we need a dependency
to make sure that we actually have an appropriate
version of Python around somewhere.)
We have run across this issue for a number of
other ports. This one is pretty important though,
because glib2 is a direct or indirect dependency
for many, many ports.
Thanks!
--
Ticket URL: <https://trac.macports.org/ticket/32306#comment:3>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
More information about the macports-tickets
mailing list