Opened 12 years ago

Closed 12 years ago

#19717 closed defect (fixed)

gtk-builder-convert from gtk2 @2.16.4 fails with Python 3

Reported by: christophe.haro@… Owned by: nox@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: gale@…, dbevans (David B. Evans)
Port: gtk2

Description (last modified by dbevans (David B. Evans))

When I try to upgrade gnome-keyring with this command :

sudo port -u upgrade gnome-keyring

the reponse is :

--->  Fetching gnome-keyring
--->  Verifying checksum(s) for gnome-keyring
--->  Extracting gnome-keyring
--->  Configuring gnome-keyring
--->  Building gnome-keyring
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_gnome_gnome-keyring/work/gnome-keyring-2.26.1" && make all " returned error 2
Command output: /bin/sh ../libtool --tag=CC   --mode=link /usr/bin/gcc-4.0 -DPKCS11_MODULE_PATH=\""/opt/local/lib/gnome-keyring/gnome-keyring-pkcs11.so"\" -DGCR_API_SUBJECT_TO_CHANGE -DUIDIR=\""/opt/local/share/gcr/ui/"\" -Wall 	-Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes 	-Wnested-externs -Wpointer-arith 	-Wcast-align -Wsign-compare 	-O2 -Wno-strict-aliasing -Wno-sign-compare -version-info 0:0:0 -no-undefined -export-symbols-regex 'gcr_*' -L/opt/local/lib -o libgcr.la -rpath /opt/local/lib libgcr_la-gcr-certificate.lo libgcr_la-gcr-certificate-basics-widget.lo libgcr_la-gcr-certificate-details-widget.lo libgcr_la-gcr-import-dialog.lo libgcr_la-gcr-importer.lo libgcr_la-gcr-library.lo libgcr_la-gcr-parser.lo libgcr_la-gcr-simple-certificate.lo libgcr_la-gcr-marshal.lo ../egg/libegg.la ../egg/libegg-secure-entry.la ../gp11/libgp11.la -L/opt/local/lib -lgobject-2.0 -lglib-2.0 -lintl -liconv   -L/opt/local/lib -lglib-2.0 -lintl -liconv   -L/opt/local/lib -lgcrypt -lgpg-error -L/opt/local/lib -ltasn1   -L/opt/local/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lgio-2.0 -lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lpangoft2-1.0 -lXext -lXfixes -lcairo -lpixman-1 -lpng12 -lXrender -lX11 -lXau -lXdmcp -lpango-1.0 -lm -lfontconfig -lexpat -lfreetype -lz -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv   
libtool: link: /usr/bin/nm -p  .libs/libgcr_la-gcr-certificate.o .libs/libgcr_la-gcr-certificate-basics-widget.o .libs/libgcr_la-gcr-certificate-details-widget.o .libs/libgcr_la-gcr-import-dialog.o .libs/libgcr_la-gcr-importer.o .libs/libgcr_la-gcr-library.o .libs/libgcr_la-gcr-parser.o .libs/libgcr_la-gcr-simple-certificate.o .libs/libgcr_la-gcr-marshal.o   ../egg/.libs/libegg.a ../egg/.libs/libegg-secure-entry.a | sed -n -e 's/^.*[	 ]\([BCDEGRST][BCDEGRST]*\)[	 ][	 ]*_\([_A-Za-z][_A-Za-z0-9]*\)$/\1 _\2 \2/p' | /opt/local/bin/gsed 's/.* //' | sort | uniq > .libs/libgcr.exp
libtool: link: /usr/bin/grep -E -e "gcr_*" ".libs/libgcr.exp" > ".libs/libgcr.expT"
libtool: link: mv -f ".libs/libgcr.expT" ".libs/libgcr.exp"
libtool: link: (cd .libs/libgcr.lax/libegg.a && ar x "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_gnome_gnome-keyring/work/gnome-keyring-2.26.1/gcr/../egg/.libs/libegg.a")
libtool: link: (cd .libs/libgcr.lax/libegg-secure-entry.a && ar x "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_gnome_gnome-keyring/work/gnome-keyring-2.26.1/gcr/../egg/.libs/libegg-secure-entry.a")
libtool: link: sed 's,^,_,' < .libs/libgcr.exp > .libs/libgcr-symbols.expsym
libtool: link: /usr/bin/gcc-4.0 -dynamiclib  -o .libs/libgcr.0.dylib  .libs/libgcr_la-gcr-certificate.o .libs/libgcr_la-gcr-certificate-basics-widget.o .libs/libgcr_la-gcr-certificate-details-widget.o .libs/libgcr_la-gcr-import-dialog.o .libs/libgcr_la-gcr-importer.o .libs/libgcr_la-gcr-library.o .libs/libgcr_la-gcr-parser.o .libs/libgcr_la-gcr-simple-certificate.o .libs/libgcr_la-gcr-marshal.o   .libs/libgcr.lax/libegg.a/libegg_la-egg-asn1.o .libs/libgcr.lax/libegg.a/libegg_la-egg-buffer.o .libs/libgcr.lax/libegg.a/libegg_la-egg-hex.o .libs/libgcr.lax/libegg.a/libegg_la-egg-libgcrypt.o .libs/libgcr.lax/libegg.a/libegg_la-egg-oid.o .libs/libgcr.lax/libegg.a/libegg_la-egg-openssl.o .libs/libgcr.lax/libegg.a/libegg_la-egg-secure-memory.o .libs/libgcr.lax/libegg.a/libegg_la-egg-symkey.o .libs/libgcr.lax/libegg.a/libegg_la-egg-unix-credentials.o  .libs/libgcr.lax/libegg-secure-entry.a/libegg_secure_entry_la-egg-secure-entry.o   -L/opt/local/lib ../gp11/.libs/libgp11.dylib /opt/local/lib/libgthread-2.0.dylib /opt/local/lib/libgcrypt.dylib /opt/local/lib/libgpg-error.dylib /opt/local/lib/libtasn1.dylib /opt/local/lib/libgtk-x11-2.0.dylib /opt/local/lib/libgdk-x11-2.0.dylib /opt/local/lib/libatk-1.0.dylib /opt/local/lib/libgdk_pixbuf-2.0.dylib /opt/local/lib/libpangocairo-1.0.dylib /opt/local/lib/libgio-2.0.dylib /opt/local/lib/libXinerama.dylib /opt/local/lib/libXi.dylib /opt/local/lib/libXrandr.dylib /opt/local/lib/libXcursor.dylib /opt/local/lib/libXcomposite.dylib /opt/local/lib/libXdamage.dylib /opt/local/lib/libpangoft2-1.0.dylib /opt/local/lib/libXext.dylib /opt/local/lib/libXfixes.dylib /opt/local/lib/libcairo.dylib /opt/local/lib/libpixman-1.dylib /opt/local/lib/libpng12.dylib /opt/local/lib/libXrender.dylib /opt/local/lib/libX11.dylib /opt/local/lib/libXau.dylib /opt/local/lib/libXdmcp.dylib /opt/local/lib/libpango-1.0.dylib -lm /opt/local/lib/libfontconfig.dylib /opt/local/lib/libexpat.dylib /opt/local/lib/libfreetype.dylib -lz /opt/local/lib/libgobject-2.0.dylib /opt/local/lib/libgmodule-2.0.dylib /opt/local/lib/libglib-2.0.dylib /opt/local/lib/libintl.dylib -lc /opt/local/lib/libiconv.dylib    -framework Carbon -install_name  /opt/local/lib/libgcr.0.dylib -compatibility_version 1 -current_version 1.0 -Wl,-single_module -Wl,-exported_symbols_list,.libs/libgcr-symbols.expsym
libtool: link: dsymutil .libs/libgcr.0.dylib || :
warning: no debug symbols in executable (-arch i386)
libtool: link: (cd ".libs" && rm -f "libgcr.dylib" && ln -s "libgcr.0.dylib" "libgcr.dylib")
libtool: link: rm -fr .libs/libgcr.lax
libtool: link: ( cd ".libs" && rm -f "libgcr.la" && ln -s "../libgcr.la" "libgcr.la" )
cp gcr.pc gcr-0.pc
gtk-builder-convert --skip-windows gcr-certificate-basics-widget.glade gcr-certificate-basics-widget.ui
Traceback (most recent call last):
  File "/opt/local/bin/gtk-builder-convert", line 756, in <module>
    sys.exit(main(sys.argv))
  File "/opt/local/bin/gtk-builder-convert", line 744, in main
    conv.parse_file(input_filename)
  File "/opt/local/bin/gtk-builder-convert", line 161, in parse_file
    self._parse()
  File "/opt/local/bin/gtk-builder-convert", line 279, in _parse
    root_objects.sort(lambda a, b: cmp(b.getAttribute('id'),
TypeError: must use keyword argument for key function
make[4]: *** [gcr-certificate-basics-widget.ui] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Error: Unable to upgrade port: 1

I do not figure out what is the problem. Can someone help me ?

Here you can find my configuration :

Mac OS X 10.5.7
callisto:~ haro$ uname -a
Darwin callisto.local 9.7.0 Darwin Kernel Version 9.7.0: Tue Mar 31 22:52:17 PDT 2009; root:xnu-1228.12.14~1/RELEASE_I386 i386

Thanks

Christophe HARO


Change History (18)

comment:1 Changed 12 years ago by blb@…

Description: modified (diff)
Port: @2.26.1 removed

What is the installed version of your gtk2 port? port installed gtk2

comment:2 Changed 12 years ago by christophe.haro@…

Port installed gtk2 is :

gtk2 @2.16.1_4X11 (active)

comment:3 Changed 12 years ago by jmroot (Joshua Root)

Owner: changed from macports-tickets@… to nox@…

Looks like another python version incompatibility (gtk-builder-convert runs with 'python', so python_select affects it).

comment:4 Changed 12 years ago by nox@…

What does python --version report?

comment:5 in reply to:  4 ; Changed 12 years ago by christophe.haro@…

Replying to nox@…:

What does python --version report?

callisto:~ haro$ python --version Python 3.0.1 callisto:~ haro$

comment:6 in reply to:  5 Changed 12 years ago by christophe.haro@…

Replying to christophe.haro@…:

Replying to nox@…:

What does python --version report?

callisto:~ haro$ python --version Python 3.0.1 callisto:~ haro$

Hi all,

The problem was the version of python. Here is how I solved the problem.

callisto:~ haro$ sudo python_select python26 callisto:~ haro$ python --version Python 2.6.2 callisto:~ haro$

and then :

callisto:~ haro$ sudo port -u upgrade gnome-keyring ---> Fetching gnome-keyring ---> Verifying checksum(s) for gnome-keyring ---> Extracting gnome-keyring ---> Configuring gnome-keyring ---> Building gnome-keyring ---> Staging gnome-keyring into destroot ---> Deactivating gnome-keyring @2.24.1_0 ---> Installing gnome-keyring @2.26.1_0 ---> Activating gnome-keyring @2.26.1_0 ---> Cleaning gnome-keyring ---> Uninstalling gnome-keyring @2.24.1_0

Thanks all,

comment:7 Changed 12 years ago by nox@…

Status: newassigned

Yes I know the problem was the version of Python. I'll patch the script to be compatible with Python ≥2.4 and will issue a warning if python --version returns a version of 2.3 or older

comment:8 Changed 12 years ago by gale@…

That is one of many incompatibilities with Python 3.

There are a number of breaking changes between Python 2 and Python 3. One is this. Another is that print is now a function and requires parens. There are others.

In the upcoming version of Python, the string format operator % will be removed, in favor of the totally incompatible format method. That will break many things in this port.

The bottom line is that upstream is just not supporting Python 3 yet. If you want to take on that responsibility until they do, that's great. Otherwise, we may need this port to depend on some specific Python 2 version, and hard-code all the shell bangs (and other places where the python interpreter is invoked) to refer to it.

Or perhaps we need some enhancement to the python_select system that will easily allow a port to avoid Python 3 when needed.

comment:9 Changed 12 years ago by gale@…

Cc: gale@… added

Cc Me!

comment:10 Changed 12 years ago by gale@…

Cc: gale@… removed

Cc Me!

comment:11 Changed 12 years ago by gale@…

Cc: gale@… added

Cc Me!

comment:12 Changed 12 years ago by dbevans (David B. Evans)

Cc: devans@… added
Description: modified (diff)
Keywords: gnome-keyring added
Port: gtk2 added; gnome-keyring removed
Summary: gnome-keyring @2.26.1 build failuregtk-builder-convert fails when building gnome-keyring @2.26.1 if default python version >= 3.0

The problem here is not one with gnome-keyring specifically but with the python script

/opt/local/bin/gtk-builder-convert

which is provided by port gtk2.

gtk-builder-convert starts with

#!/usr/bin/env python

which should be patched/reinplaced (in gtk2) to directly specify a particular safe python binary.

Most current gtk/gnome ports use python25 although a few gnome ports (alacarte, gnome-menus) now require python26. So using python25 as the currently most prevalently used python port

#!/usr/bin/env ${prefix)/bin/python2.5

where ${prefix} of course is replaced by the installed MacPorts prefix

This will make the choice of python for the script independent of the current python selection.

comment:13 Changed 12 years ago by nox@…

Or we could fix the incompatibilies. I don't want to depend on python25 for just a single script.

comment:14 Changed 12 years ago by dbevans (David B. Evans)

Well, its up to you but you need to make sure in that case that your fix is compatible with ALL python versions that may be installed and selected as default.

As I said anyone installing GNOME/GTK ports probably has python installed already as most of those who use python depend upon it, but if you don't want to do this you could patch to use the system python (2.3?) if that will work for this script.

In any case, it would be IMO better (simpler, easier to maintain) to have the script use a specific version of python that is known to work rather than trying to accomodate many potentially incompatible versions.

comment:15 Changed 12 years ago by dbevans (David B. Evans)

By the way, regarding 'just this one script', this script can be used potentially by any GTK port and will be seen much more frequently as upstream developers move from glade to gtk-builder (as is the current theme in the GNOME project).

comment:16 Changed 12 years ago by nox@…

Keywords: gnome-keyring removed
Summary: gtk-builder-convert fails when building gnome-keyring @2.26.1 if default python version >= 3.0gtk-builder-convert from gtk2 @2.16.4 fails with Python 3
Version: 1.7.1

gnome-keyring does not use gtk-builder-convert.

comment:17 Changed 12 years ago by nox@…

comment:18 Changed 12 years ago by nox@…

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.