After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 656048 - glib-codegen requires Python >= 2.5
glib-codegen requires Python >= 2.5
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.29.x
Other Solaris
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-08-05 18:13 UTC by declanw
Modified: 2011-08-06 13:37 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description declanw 2011-08-05 18:13:18 UTC
configure.ac contains the following test:

# Some systems have both statfs and statvfs, pick the most "native" for these
AS_IF([test x$ac_cv_func_statfs = xyes && test x$ac_cv_func_statvfs = yes],
   [
   # on solaris and irix, statfs doesn't even have the f_bavail field
   AS_IF([test $ac_cv_member_struct_statfs_f_bavail = yes],
      [ac_cv_func_statfs=no],
   # else, at least on linux, statfs is the actual syscall
      [ac_cv_func_statvfs=no])
   ])

Notice that "test x$ac_cv_func_statvfs = yes" will always test false due to a missing "x"
Comment 1 declanw 2011-08-05 18:27:10 UTC
BTW this causes compilation failure in glocalfile.c

FWIW glib/tests/checksum.c didn't compile either due to GCC-only C syntax "case '0' ... '9'"

glib/tests/Makefile.am also has "atomic_CFLAGS = -Wstrict-aliasing=2 $(INCLUDES)" which is again GCC-only

Zlib based compilation blows up obscurely if you have an old zlib.h (may want a minimum version check for the gz_header struct existance)
Comment 2 declanw 2011-08-05 19:21:10 UTC
AND the logic in the inner IF is inverted and doesn't match the comments

   # on solaris and irix, statfs doesn't even have the f_bavail field
   AS_IF([test $ac_cv_member_struct_statfs_f_bavail = yes],
      [ac_cv_func_statfs=no],
   # else, at least on linux, statfs is the actual syscall
      [ac_cv_func_statvfs=no])

If $ac_cv_member_struct_statfs_f_bavail is no, it disables statvfs, which was the working one. 
Also I think the x = x test armour is missing.
Comment 3 declanw 2011-08-05 21:36:31 UTC
Ow, and configure has chosen python2.4, and then fed it code syntax only supported in python 2.5:

PYTHONPATH=../../../gio/gdbus-codegen:../../../gio/gdbus-codegen:$PYTHONPATH /usr/bin/env python2.4 ../../../gio/gdbus-codegen/codegen_main.py          \
>         --interface-prefix org.gtk.GDBus.Example.ObjectManager.         \
>         --c-namespace Example                                           \
>         --c-generate-object-manager                                     \
>         --generate-c-code gdbus-example-objectmanager-generated         \
>         --generate-docbook gdbus-example-objectmanager-generated        \
>         gdbus-example-objectmanager.xml                                 \
> 
Traceback (most recent call last):
  • File "../../../gio/gdbus-codegen/codegen_main.py", line 31 in ?
    import codegen
  • File "/home/foo/glib-2.29.14/gio/gdbus-codegen/codegen.py", line 807
    %(m.name_hyphen, 'TRUE' if unix_fd else 'FALSE'))
SyntaxError: invalid syntax

Comment 4 declanw 2011-08-05 22:48:43 UTC
When trying to 'make install-codegenPYTHON' in gio/gdbus-codegen it has had configure set:
PYTHON = /usr/bin/env python2.4

in the Makefile, but again uses python2.5 syntax in :
__init__.pycodegen.py  File "/tmp/glib-2.29.14/lib/gdbus-codegen/codegen.py", line 807
    %(m.name_hyphen, 'TRUE' if unix_fd else 'FALSE'))
                             ^
SyntaxError: invalid syntax

It also uses "PYTHON=$(PYTHON) $(py_compile) ..." which explodes when $(PYTHON) is more than one word.
Comment 5 Colin Walters 2011-08-06 13:23:49 UTC
(In reply to comment #0)
 
> Notice that "test x$ac_cv_func_statvfs = yes" will always test false due to a
> missing "x"

Good catch, I've pushed a commit which fixes this; thank you!
Comment 6 Colin Walters 2011-08-06 13:30:03 UTC
(In reply to comment #3)
> Ow, and configure has chosen python2.4, and then fed it code syntax only
> supported in python 2.5:
> 
> PYTHONPATH=../../../gio/gdbus-codegen:../../../gio/gdbus-codegen:$PYTHONPATH
> /usr/bin/env python2.4 ../../../gio/gdbus-codegen/codegen_main.py          \
> >         --interface-prefix org.gtk.GDBus.Example.ObjectManager.         \
> >         --c-namespace Example                                           \
> >         --c-generate-object-manager                                     \
> >         --generate-c-code gdbus-example-objectmanager-generated         \
> >         --generate-docbook gdbus-example-objectmanager-generated        \
> >         gdbus-example-objectmanager.xml                                 \
> > 
> Traceback (most recent call last):

This is a separate bug, but since we fixed the first one I'll retitle this.

We should either hard require 2.5 for support 2.4.
Comment 7 Colin Walters 2011-08-06 13:37:45 UTC
(In reply to comment #6)

> We should either hard require 2.5 for support 2.4.

I've pushed a commit to require 2.5.