GNOME Bugzilla – Bug 648863
incompatible python-2.7 not detected during gobject-introspection configure
Last modified: 2018-01-25 14:13:34 UTC
Hi - I try to do: $ git clone git://git.gnome.org/gobject-introspection $ cd gobject-introspection $ ./autogen.sh --prefix=/usr --libdir=/usr/lib64 --enable-shared --with-pic $ make clean distclean $ cd /tmp/gobject-introspection $ /usr/src/gobject-introspection/configure --prefix=/usr --libdir=/usr/lib64 --enable-shared --with-pic $ make ... sed -e s,@libdir\@,/usr/lib64, -e s,@PYTHON\@,/usr/bin/python, /usr/src/gobject-introspection/tools/g-ir-annotation-tool.in > g-ir-annotation-tool.tmp && mv g-ir-annotation-tool.tmp g-ir-annotation-tool env LPATH=.libs PYTHONPATH=.:/usr/src/gobject-introspection UNINSTALLED_INTROSPECTION_SRCDIR=/usr/src/gobject-introspection UNINSTALLED_INTROSPECTION_BUILDDIR=. ./g-ir-scanner --verbose -I/usr/src/gobject-introspection --add-include-path=/usr/src/gobject-introspection --add-include-path=/usr/src/gobject-introspection/gir --add-include-path=. --add-include-path=. --namespace=GLib --nsversion=2.0 --libtool="/bin/sh ./libtool" --pkg=glib-2.0 --library=glib-2.0 --external-library --reparse-validate --identifier-prefix=G --symbol-prefix=g --symbol-prefix=glib --c-include="glib.h" -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -DGETTEXT_PACKAGE=Dummy -DGLIB_COMPILATION -D__G_I18N_LIB_H__ /usr/lib64/glib-2.0/include/glibconfig.h /usr/include/glib-2.0/glib/gdir.h /usr/include/glib-2.0/glib/gtypes.h /usr/include/glib-2.0/glib/gfileutils.h /usr/include/glib-2.0/glib/gthreadpool.h /usr/include/glib-2.0/glib/galloca.h /usr/include/glib-2.0/glib/gspawn.h /usr/include/glib-2.0/glib/gshell.h /usr/include/glib-2.0/glib/gcompletion.h /usr/include/glib-2.0/glib/gprintf.h /usr/include/glib-2.0/glib/gcache.h /usr/include/glib-2.0/glib/gtree.h /usr/include/glib-2.0/glib/ghook.h /usr/include/glib-2.0/glib/garray.h /usr/include/glib-2.0/glib/gdatetime.h /usr/include/glib-2.0/glib/gmappedfile.h /usr/include/glib-2.0/glib/gerror.h /usr/include/glib-2.0/glib/gi18n-lib.h /usr/include/glib-2.0/glib/gqueue.h /usr/include/glib-2.0/glib/gsequence.h /usr/include/glib-2.0/glib/gnode.h /usr/include/glib-2.0/glib/goption.h /usr/include/glib-2.0/glib/gstring.h /usr/include/glib-2.0/glib/gscanner.h /usr/include/glib-2.0/glib/gbase64.h /usr/include/glib-2.0/glib/gdataset.h /usr/include/glib-2.0/glib/gmacros.h /usr/include/glib-2.0/glib/ghostutils.h /usr/include/glib-2.0/glib/gvariant.h /usr/include/glib-2.0/glib/gurifuncs.h /usr/include/glib-2.0/glib/grand.h /usr/include/glib-2.0/glib/gslice.h /usr/include/glib-2.0/glib/gquark.h /usr/include/glib-2.0/glib/gmain.h /usr/include/glib-2.0/glib/ghash.h /usr/include/glib-2.0/glib/gi18n.h /usr/include/glib-2.0/glib/gtimezone.h /usr/include/glib-2.0/glib/glist.h /usr/include/glib-2.0/glib/gmessages.h /usr/include/glib-2.0/glib/gdate.h /usr/include/glib-2.0/glib/gpoll.h /usr/include/glib-2.0/glib/gtestutils.h /usr/include/glib-2.0/glib/gwin32.h /usr/include/glib-2.0/glib/gregex.h /usr/include/glib-2.0/glib/gbitlock.h /usr/include/glib-2.0/glib/gbookmarkfile.h /usr/include/glib-2.0/glib/gprimes.h /usr/include/glib-2.0/glib/gbacktrace.h /usr/include/glib-2.0/glib/gmarkup.h /usr/include/glib-2.0/glib/gqsort.h /usr/include/glib-2.0/glib/gslist.h /usr/include/glib-2.0/glib/gstrfuncs.h /usr/include/glib-2.0/glib/gutils.h /usr/include/glib-2.0/glib/gconvert.h /usr/include/glib-2.0/glib/gpattern.h /usr/include/glib-2.0/glib/gthread.h /usr/include/glib-2.0/glib/gstdio.h /usr/include/glib-2.0/glib/gatomic.h /usr/include/glib-2.0/glib/giochannel.h /usr/include/glib-2.0/glib/gtimer.h /usr/include/glib-2.0/glib/gchecksum.h /usr/include/glib-2.0/glib/gkeyfile.h /usr/include/glib-2.0/glib/grel.h /usr/include/glib-2.0/glib/gvarianttype.h /usr/include/glib-2.0/glib/gunicode.h /usr/include/glib-2.0/glib/gmem.h /usr/include/glib-2.0/glib/gasyncqueue.h /usr/src/gobject-introspection/gir/glib-2.0.c g-ir-scanner g-ir-compiler --output GLib-2.0.gir ./g-ir-compiler --includedir=/usr/src/gobject-introspection --includedir=/usr/src/gobject-introspection/gir --includedir=. --includedir=. --includedir=. /usr/src/gobject-introspection/gir/DBus-1.0.gir -o gir/DBus-1.0.typelib ./g-ir-compiler --includedir=/usr/src/gobject-introspection --includedir=/usr/src/gobject-introspection/gir --includedir=. --includedir=. --includedir=. /usr/src/gobject-introspection/gir/fontconfig-2.0.gir -o gir/fontconfig-2.0.typelib ./g-ir-compiler --includedir=/usr/src/gobject-introspection --includedir=/usr/src/gobject-introspection/gir --includedir=. --includedir=. --includedir=. /usr/src/gobject-introspection/gir/freetype2-2.0.gir -o gir/freetype2-2.0.typelib Traceback (most recent call last):
+ Trace 226920
from giscanner.scannermain import scanner_main
from giscanner.dumper import compile_introspection_binary
from .gdumpparser import IntrospectionBinary
from .transformer import TransformerException
./g-ir-compiler --includedir=/usr/src/gobject-introspection --includedir=/usr/src/gobject-introspection/gir --includedir=. --includedir=. --includedir=. /usr/src/gobject-introspection/gir/GL-1.0.gir -o gir/GL-1.0.typelib from .config import DATADIR, GIR_DIR, GIR_SUFFIX
make[2]: *** [GLib-2.0.gir] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory `/tmp/gobject-introspection' I think configure should have picked up that I am missing some python modules here. Please bear in mind that some people may not be using RPM to build ! Thanks & Regards, Jason
No - I guess this is not "missing dependencies" - this is python that is not working with my (fairly recent) python-2.7 - $ python --version Python 2.7 $ ls -l /usr/bin/python -rwxr-xr-x 2 root root 11605 Jul 4 2010 /usr/bin/python hmm... does python have some option where it prints its build date and configuration arguments like perl does ? seems not ... If I go into the /tmp/gobject-instrospection directory, configured for my own self-maintained linux distro, in a Fedora 14 chroot (FC-14 all up-to-date and unmodified) , and run FC-14 's python with the same command that fails under my distro : $ env LPATH=.libs PYTHONPATH=.:/usr/src/gobject-introspection UNINSTALLED_INTROSPECTION_SRCDIR=/usr/src/gobject-introspection UNINSTALLED_INTROSPECTION_BUILDDIR=. ./g-ir-scanner --verbose -I/usr/src/gobject-introspection --add-include-path=/usr/src/gobject-introspection --add-include-path=/usr/src/gobject-introspection/gir --add-include-path=. --add-include-path=. --namespace=GLib --nsversion=2.0 --libtool="/bin/sh ./libtool" --pkg=glib-2.0 --library=glib-2.0 --external-library --reparse-validate --identifier-prefix=G --symbol-prefix=g --symbol-prefix=glib --c-include="glib.h" -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -DGETTEXT_PACKAGE=Dummy -DGLIB_COMPILATION -D__G_I18N_LIB_H__ /usr/lib64/glib-2.0/include/glibconfig.h /usr/include/glib-2.0/glib/gdir.h /usr/include/glib-2.0/glib/gtypes.h /usr/include/glib-2.0/glib/gfileutils.h /usr/include/glib-2.0/glib/gthreadpool.h /usr/include/glib-2.0/glib/galloca.h /usr/include/glib-2.0/glib/gspawn.h /usr/include/glib-2.0/glib/gshell.h /usr/include/glib-2.0/glib/gcompletion.h /usr/include/glib-2.0/glib/gprintf.h /usr/include/glib-2.0/glib/gcache.h /usr/include/glib-2.0/glib/gtree.h /usr/include/glib-2.0/glib/ghook.h /usr/include/glib-2.0/glib/garray.h /usr/include/glib-2.0/glib/gdatetime.h /usr/include/glib-2.0/glib/gmappedfile.h /usr/include/glib-2.0/glib/gerror.h /usr/include/glib-2.0/glib/gi18n-lib.h /usr/include/glib-2.0/glib/gqueue.h /usr/include/glib-2.0/glib/gsequence.h /usr/include/glib-2.0/glib/gnode.h /usr/include/glib-2.0/glib/goption.h /usr/include/glib-2.0/glib/gstring.h /usr/include/glib-2.0/glib/gscanner.h /usr/include/glib-2.0/glib/gbase64.h /usr/include/glib-2.0/glib/gdataset.h /usr/include/glib-2.0/glib/gmacros.h /usr/include/glib-2.0/glib/ghostutils.h /usr/include/glib-2.0/glib/gvariant.h /usr/include/glib-2.0/glib/gurifuncs.h /usr/include/glib-2.0/glib/grand.h /usr/include/glib-2.0/glib/gslice.h /usr/include/glib-2.0/glib/gquark.h /usr/include/glib-2.0/glib/gmain.h /usr/include/glib-2.0/glib/ghash.h /usr/include/glib-2.0/glib/gi18n.h /usr/include/glib-2.0/glib/gtimezone.h /usr/include/glib-2.0/glib/glist.h /usr/include/glib-2.0/glib/gmessages.h /usr/include/glib-2.0/glib/gdate.h /usr/include/glib-2.0/glib/gpoll.h /usr/include/glib-2.0/glib/gtestutils.h /usr/include/glib-2.0/glib/gwin32.h /usr/include/glib-2.0/glib/gregex.h /usr/include/glib-2.0/glib/gbitlock.h /usr/include/glib-2.0/glib/gbookmarkfile.h /usr/include/glib-2.0/glib/gprimes.h /usr/include/glib-2.0/glib/gbacktrace.h /usr/include/glib-2.0/glib/gmarkup.h /usr/include/glib-2.0/glib/gqsort.h /usr/include/glib-2.0/glib/gslist.h /usr/include/glib-2.0/glib/gstrfuncs.h /usr/include/glib-2.0/glib/gutils.h /usr/include/glib-2.0/glib/gconvert.h /usr/include/glib-2.0/glib/gpattern.h /usr/include/glib-2.0/glib/gthread.h /usr/include/glib-2.0/glib/gstdio.h /usr/include/glib-2.0/glib/gatomic.h /usr/include/glib-2.0/glib/giochannel.h /usr/include/glib-2.0/glib/gtimer.h /usr/include/glib-2.0/glib/gchecksum.h /usr/include/glib-2.0/glib/gkeyfile.h /usr/include/glib-2.0/glib/grel.h /usr/include/glib-2.0/glib/gvarianttype.h /usr/include/glib-2.0/glib/gunicode.h /usr/include/glib-2.0/glib/gmem.h /usr/include/glib-2.0/glib/gasyncqueue.h gir/glib-2.0.c g-ir-scanner g-ir-compiler --output GLib-2.0.gir Traceback (most recent call last):
+ Trace 226921
from .girparser import GIRParser
from .girwriter import COMPATIBLE_GIR_VERSION
from .xmlwriter import XMLWriter
from _giscanner import collect_attributes
mod = imp.load_module(name, open(realpath), realpath, (extension, 'rb', 3))
[ I guess I need to rebuild my distro's Python - doing this now and retesting.
So title of this bug should be : "incompatible python not found during gobject-introspection configure"
I guess testing this bug is now dependant on there being a release of Python-2.7 that can pass its own test suite on my system . I'm not installing the python that resulted from Python-2.7.1.tar.bz2 because it cannot pass its own test suite - the previous python-2.7 from Python-2.7.tar.bz2 did. I'll see if it is a problem caused by how some python dependency is installed on my system, but I can't see how . $ make test ... test_colorsys test_commands test test_commands failed -- Traceback (most recent call last):
+ Trace 226922
self.assertTrue(re.match(pat, commands.getstatus("/."), re.VERBOSE))
I don't want a python around that can't run commands ! I see if this is due to some error in the test script - but I can't see how it could be if Python-2.7.1 is meant to pass its test suite - is it ?
Can anyone please advise : what special modern Python features (preferably what Python version with reference to python git commit or tarball) is required to build gobject-introspection ?
I think you're more likely running into the fact that I don't actively maintain srcdir != builddir support in this module.
Thanks for responding Colin! OK, I had noticed that previously, and I did : $ (cd /usr/src/gobject-introspection; tar -cpf - .) | tar -xpf - $ make but I hadn't re-run configure. So now I do that, and the build gets a bit further, but still fails : g-ir-scanner: compile: /usr/bin/gcc -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -fno-strict-aliasing -Wsign-compare -Wcast-align -Wpointer-arith -Wnested-externs -Wmissing-prototypes -Wmissing-declarations -Wchar-subscripts -Wall -march=x86-64 -mtune=k8 -O2 -g -fPIC -DPIC -pipe -I. -I./girepository -I. -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -c -o /tmp/gobject-introspection/tmp-introspectmc369B/GIRepository-2.0.o /tmp/gobject-introspection/tmp-introspectmc369B/GIRepository-2.0.c /usr/include/glib-2.0/gio/gdirectorymonitor.h:65: syntax error, unexpected '*', expecting ')' or ',' in ' void (* changed) (GDirectoryMonitor* monitor,' at '*' /usr/include/glib-2.0/gio/gdirectorymonitor.h:67: syntax error, unexpected typedef-name, expecting identifier or '(' or '*' in ' GFile *other_file,' at 'GFile' /usr/include/glib-2.0/gio/gdirectorymonitor.h:68: syntax error, unexpected typedef-name, expecting identifier or '(' or '*' in ' GFileMonitorEvent event_type);' at 'GFileMonitorEvent' /usr/include/glib-2.0/gio/gdirectorymonitor.h:71: syntax error, unexpected '*', expecting ')' or ',' in ' gboolean (*cancel)(GDirectoryMonitor* monitor);' at '*' /usr/include/glib-2.0/gio/gdirectorymonitor.h:80: syntax error, unexpected '}' in '};' at '}' /usr/include/glib-2.0/gio/gdirectorymonitor.h:84: syntax error, unexpected '*', expecting ')' or ',' in 'gboolean g_directory_monitor_cancel (GDirectoryMonitor *monitor);' at '*' /usr/include/glib-2.0/gio/gdirectorymonitor.h:85: syntax error, unexpected '*', expecting ')' or ',' in 'gboolean g_directory_monitor_is_cancelled (GDirectoryMonitor *monitor);' at '*' /usr/include/glib-2.0/gio/gdirectorymonitor.h:86: syntax error, unexpected '*', expecting ')' or ',' in 'void g_directory_monitor_set_rate_limit (GDirectoryMonitor *monitor,' at '*' /usr/include/glib-2.0/gio/gdirectorymonitor.h:90: syntax error, unexpected '*', expecting ')' or ',' in 'void g_directory_monitor_emit_event (GDirectoryMonitor *monitor,' at '*' /usr/include/glib-2.0/gio/gdirectorymonitor.h:92: syntax error, unexpected typedef-name, expecting identifier or '(' or '*' in ' GFile *other_file,' at 'GFile' /usr/include/glib-2.0/gio/gdirectorymonitor.h:93: syntax error, unexpected typedef-name, expecting identifier or '(' or '*' in ' GFileMonitorEvent event_type);' at 'GFileMonitorEvent' I have glib freshly built and installed @2011-04-14 from glib git tag : 2.28.5 do I need some other glib version for gobject-introspection ? ( this is all so I can compile gconf, which is required by mozilla xulrunner ).
Hmm ... I couldn't see how this code in /usr/include/glib-2.0/gio/gdirectorymonitor.h could ever compile : struct _GDirectoryMonitor { ... }; struct _GDirectoryMonitorClass { ... void (* changed) (GDirectoryMonitor* ... where is this GDirectoryMonitor defined ? So I changed it to : struct _GDirectoryMonitor { ... } GDirectoryMonitor; struct _GDirectoryMonitorClass { ... void (* changed) (GDirectoryMonitor* ... And the above g-ir-scanner command now succeeds . A glib/gio bug ?
but the link fails : g-ir-scanner: link: /bin/sh ./libtool --mode=link --tag=CC --silent /usr/bin/gcc -o /tmp/gobject-introspection/tmp-introspectxTb71H/Gio-2.0 -export-dynamic -march=x86-64 -mtune=k8 -O2 -g -fPIC -DPIC -pipe -pthread -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 -lgio-2.0 /tmp/gobject-introspection/tmp-introspectxTb71H/Gio-2.0.o /tmp/gobject-introspection/tmp-introspectxTb71H/Gio-2.0.o:(.data.rel+0x548): undefined reference to `g_directory_monitor_get_type' collect2: ld returned 1 exit status what is this g_directory_monitor_get_type ? because it is not in the current glib or gobject-introspection source : $ grep -RI /usr/src/{glib,gobject-introspection} g_directory_monitor_get_type $ (no results) and indeed no glib library defines that symbol . Where is it coming from ?
Aha ! I see, you are scanning all header files that exist in the /usr/include/glib-2.0/gio/ directory and this includes an old gdirectorymonitor.h file . Probably best in future to check for the value some version symbol in each header and only scan the header if the version matches the pkg-config modversion for the module or something. What if the user had stored some other header in one the directories scanned by g-ir-scanner ? That would probably cause the build to fail also. It's not very safe to be including every header file in any given directory.
Generally gobject-introspection matches glib from git. Patches to ensure this definitely accepted. I've been meaning to version gobject-introspection with the corresponding glib release, but it just hasn't happened yet.
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
gobject-introspection has been building in a CI environment using Git, and this has reduced the chances of breakage like this.