无法在 debian 拉伸上构建 gobject--introspection-1.70.0
Posted
技术标签:
【中文标题】无法在 debian 拉伸上构建 gobject--introspection-1.70.0【英文标题】:Can't build gobject--introspection-1.70.0 on debian stretch 【发布时间】:2021-11-18 20:21:55 【问题描述】:因为 debian stretch 有 gobject-introspection 的旧包,我需要更新它。 但是当我尝试构建时,我收到了下一条消息:
FAILED: gir/GLib-2.0.gir
/home/user/gobject-introspection-1.70.0/_build/tools/g-ir-scanner --output=gir/GLib-2.0.gir --no-libtool --quiet --reparse-validate --add-include-path /home/user/gobject-introspection-1.70.0/_build/gir --add-include-path /home/user/gobject-introspection-1.70.0/gir --identifier-prefix=G --symbol-prefix=g --symbol-prefix=glib --c-include=glib.h --namespace=GLib --nsversion=2.0 --library=glib-2.0 --library=gobject-2.0 --external-library --pkg=glib-2.0 --cflags-begin -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -DGLIB_COMPILATION -D__G_I18N_LIB_H__ -DGETTEXT_PACKAGE=Dummy --cflags-end /usr/include/glib-2.0/gobject/glib-types.h /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h /usr/include/glib-2.0/glib-unix.h /usr/include/glib-2.0/glib/galloca.h /usr/include/glib-2.0/glib/garray.h /usr/include/glib-2.0/glib/gasyncqueue.h /usr/include/glib-2.0/glib/gatomic.h /usr/include/glib-2.0/glib/gbacktrace.h /usr/include/glib-2.0/glib/gbase64.h /usr/include/glib-2.0/glib/gbitlock.h /usr/include/glib-2.0/glib/gbookmarkfile.h /usr/include/glib-2.0/glib/gbytes.h /usr/include/glib-2.0/glib/gcharset.h /usr/include/glib-2.0/glib/gchecksum.h /usr/include/glib-2.0/glib/gconvert.h /usr/include/glib-2.0/glib/gdataset.h /usr/include/glib-2.0/glib/gdate.h /usr/include/glib-2.0/glib/gdatetime.h /usr/include/glib-2.0/glib/gdir.h /usr/include/glib-2.0/glib/genviron.h /usr/include/glib-2.0/glib/gerror.h /usr/include/glib-2.0/glib/gfileutils.h /usr/include/glib-2.0/glib/ggettext.h /usr/include/glib-2.0/glib/ghash.h /usr/include/glib-2.0/glib/ghmac.h /usr/include/glib-2.0/glib/ghook.h /usr/include/glib-2.0/glib/ghostutils.h /usr/include/glib-2.0/glib/gi18n-lib.h /usr/include/glib-2.0/glib/gi18n.h /usr/include/glib-2.0/glib/giochannel.h /usr/include/glib-2.0/glib/gkeyfile.h /usr/include/glib-2.0/glib/glib-typeof.h /usr/include/glib-2.0/glib/glist.h /usr/include/glib-2.0/glib/gmacros.h /usr/include/glib-2.0/glib/gmain.h /usr/include/glib-2.0/glib/gmappedfile.h /usr/include/glib-2.0/glib/gmarkup.h /usr/include/glib-2.0/glib/gmem.h /usr/include/glib-2.0/glib/gmessages.h /usr/include/glib-2.0/glib/gnode.h /usr/include/glib-2.0/glib/goption.h /usr/include/glib-2.0/glib/gpattern.h /usr/include/glib-2.0/glib/gpoll.h /usr/include/glib-2.0/glib/gprimes.h /usr/include/glib-2.0/glib/gprintf.h /usr/include/glib-2.0/glib/gqsort.h /usr/include/glib-2.0/glib/gquark.h /usr/include/glib-2.0/glib/gqueue.h /usr/include/glib-2.0/glib/grand.h /usr/include/glib-2.0/glib/grcbox.h /usr/include/glib-2.0/glib/grefcount.h /usr/include/glib-2.0/glib/grefstring.h /usr/include/glib-2.0/glib/gregex.h /usr/include/glib-2.0/glib/gscanner.h /usr/include/glib-2.0/glib/gsequence.h /usr/include/glib-2.0/glib/gshell.h /usr/include/glib-2.0/glib/gslice.h /usr/include/glib-2.0/glib/gslist.h /usr/include/glib-2.0/glib/gspawn.h /usr/include/glib-2.0/glib/gstdio.h /usr/include/glib-2.0/glib/gstrfuncs.h /usr/include/glib-2.0/glib/gstring.h /usr/include/glib-2.0/glib/gstringchunk.h /usr/include/glib-2.0/glib/gstrvbuilder.h /usr/include/glib-2.0/glib/gtestutils.h /usr/include/glib-2.0/glib/gthread.h /usr/include/glib-2.0/glib/gthreadpool.h /usr/include/glib-2.0/glib/gtimer.h /usr/include/glib-2.0/glib/gtimezone.h /usr/include/glib-2.0/glib/gtrashstack.h /usr/include/glib-2.0/glib/gtree.h /usr/include/glib-2.0/glib/gtypes.h /usr/include/glib-2.0/glib/gunicode.h /usr/include/glib-2.0/glib/guri.h /usr/include/glib-2.0/glib/gurifuncs.h /usr/include/glib-2.0/glib/gutils.h /usr/include/glib-2.0/glib/guuid.h /usr/include/glib-2.0/glib/gvariant.h /usr/include/glib-2.0/glib/gvarianttype.h /usr/include/glib-2.0/glib/gversion.h /usr/include/glib-2.0/glib/gversionmacros.h /usr/include/glib-2.0/glib/gwin32.h ../gir/glib-2.0.c
Traceback (most recent call last):
File "/home/user/gobject-introspection-1.70.0/_build/tools/g-ir-scanner", line 98, in <module>
from giscanner.scannermain import scanner_main
File "/home/user/gobject-introspection-1.70.0/_build/giscanner/scannermain.py", line 35, in <module>
from giscanner.ast import Include, Namespace
File "/home/user/gobject-introspection-1.70.0/_build/giscanner/ast.py", line 29, in <module>
from .sourcescanner import CTYPE_TYPEDEF, CSYMBOL_TYPE_TYPEDEF
File "/home/user/gobject-introspection-1.70.0/_build/giscanner/sourcescanner.py", line 34, in <module>
from giscanner._giscanner import SourceScanner as CSourceScanner
ImportError: /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0: undefined symbol: g_date_copy
我知道 glib >= 2.56 所需的版本。 我也构建它并从最新(2.70)源安装,但错误仍然存在。
user@debian-stretch:/usr/lib/x86_64-linux-gnu$ cat /usr/lib/x86_64-linux-gnu/pkgconfig /gobject-2.0.pc
prefix=/usr
libdir=$prefix/lib/x86_64-linux-gnu
includedir=$prefix/include
Name: GObject
Description: GLib Type, Object, Parameter and Signal Library
Version: 2.70.0
Requires: glib-2.0
Requires.private: libffi >= 3.0.0
Libs: -L$libdir -lgobject-2.0
Cflags: -I$includedir
user@debian-stretch:/usr/lib/x86_64-linux-gnu$ cat /usr/lib/x86_64-linux-gnu/pkgconfig /glib-2.0.pc
prefix=/usr
libdir=$prefix/lib/x86_64-linux-gnu
includedir=$prefix/include
bindir=$prefix/bin
glib_genmarshal=$bindir/glib-genmarshal
gobject_query=$bindir/gobject-query
glib_mkenums=$bindir/glib-mkenums
Name: GLib
Description: C Utility Library
Version: 2.70.0
Requires.private: libpcre >= 8.31
Libs: -L$libdir -lglib-2.0
Libs.private: -pthread -lm
Cflags: -I$includedir/glib-2.0 -I$libdir/glib-2.0/include
你能帮忙解决一下吗?
UPD 我又读了一遍this post,我看到了下一件事: 默认 libglib2.0-0 软件包将一些库安装到另一个路径,在:/lib/x86_64-linux-gnu/
之后我尝试在我的实例上找到它,然后下一个:
user@debian-stretch:~$ sudo find / -iname '*glib-2.0.*'
/usr/lib/x86_64-linux-gnu/libglib-2.0.so
/usr/lib/x86_64-linux-gnu/girepository-1.0/GLib-2.0.typelib
/usr/lib/x86_64-linux-gnu/pkgconfig/glib-2.0.pc
/usr/lib/x86_64-linux-gnu/libglib-2.0.a
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7000.0
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7000.0-gdb.py
/usr/share/gir-1.0/GLib-2.0.gir
/usr/share/aclocal/glib-2.0.m4
/usr/local/share/gdb/auto-load/usr/local/lib/x86_64-linux-gnu/libglib-2.0.so.0.7000.0-gdb.py
/usr/local/share/aclocal/glib-2.0.m4
/lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3
/lib/x86_64-linux-gnu/libglib-2.0.so.0
/home/user/glib-2.70.0/m4macros/glib-2.0.m4
/home/user/glib-2.70.0/_build/glib/libglib-2.0.so.0.7000.0.p
/home/user/glib-2.70.0/_build/glib/libglib-2.0.so
/home/user/glib-2.70.0/_build/glib/libglib-2.0.so.0.7000.0-gdb.py
/home/user/glib-2.70.0/_build/glib/libglib-2.0.so.0
/home/user/glib-2.70.0/_build/meson-private/glib-2.0.pc
/home/user/gobject-introspection-1.70.0/gir/glib-2.0.c
/home/user/gobject-introspection-1.70.0/subprojects/glib/m4macros/glib-2.0.m4
/home/user/packaging-glib/glib-2.70.0/usr/lib/x86_64-linux-gnu/libglib-2.0.so
/home/user/packaging-glib/glib-2.70.0/usr/lib/x86_64-linux-gnu/pkgconfig/glib-2.0.pc
/home/user/packaging-glib/glib-2.70.0/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7000.0
/home/user/packaging-glib/glib-2.70.0/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
/home/user/packaging-glib/glib-2.70.0/usr/share/aclocal/glib-2.0.m4
删除此库后:/lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3/lib/x86_64-linux-gnu /libglib-2.0.so.0 建设继续。
【问题讨论】:
【参考方案1】:绝对不要删除/lib
中的GLib 库。由于您的包管理器将它们安装在那里,其他包可能希望在那里找到它们,因此这可能会破坏您的系统。 (而且由于 Debian Stretch 太老了,使用 2.50 的 GLib 版本,如果您在系统范围内安装 GLib 2.70,它甚至可能会导致问题。)
如果您必须在系统范围内安装 2.70,那么我建议您使用与系统版本完全相同的配置来构建它。您可以找到标准配置选项here 和特定于GLib 的选项here。您可以在类似的地方找到 gobject-introspection 的选项。
更好的是,如果您需要使用主机系统不支持的 GLib 和 gobject-introspection 版本来开发某些东西,那就是使用某种形式的容器技术。要么是像 Flatpak 这样的运行时,要么是带有开发环境的“宠物容器”,比如 Toolbox。
【讨论】:
感谢您的回答!下次我会尝试使用这些构建选项。以上是关于无法在 debian 拉伸上构建 gobject--introspection-1.70.0的主要内容,如果未能解决你的问题,请参考以下文章
QtGui.QSystemTrayIcon settooltip 在 debian 拉伸中不起作用