GNOME Bugzilla – Bug 778912
jhbuild sysdeps install fails if `python-gobject` or `python-dbus` are not installed
Last modified: 2021-05-17 16:05:54 UTC
I just installed a fresh Ubuntu 17.04 iso in a virtual machine. I then proceeded to install jhbuild from git. When I ran the command `jhbuild sysdeps --install` I got two stack traces due to missing installed packages. Is there any way jhbuild can detect this and request the packages to be installed rather then failing and printing a stacktrace. The first error was this: > File "/home/sebastiangeiger/.local/lib/python2.7/site-packages/jhbuild/utils/systeminstall.py", line 254, in _get_new_transaction > import glib >ImportError: No module named glib This required me to install `python-gobject`. The second error was this: > File "/home/sebastiangeiger/.local/lib/python2.7/site-packages/jhbuild/utils/systeminstall.py", line 257, in _get_new_transaction > import dbus.glib >ImportError: No module named dbus.glib This required me to install `python-dbus`. Now the command works and tells me that several dozen packages need to be installed but then it just terminates without installing any of these packages. These are the last three lines before jhbuild terminates: I: Installing dependencies on system: libX11 libicu libXrandr libwebp libjpeg mesa-libGLES libXcomposite libxslt sqlite3 liboauth wavpack libXft libpng nss libproxy nspr bison libXrender libXt libXtst enchant wayland-egl p11-kit cairo xorg-macros libsystemd xorg-kbproto libtasn1 libtiff libdb polkit-gobject texinfo ppp libepoxy pulseaudio libXdamage libv4l py3cairo dbus dbus-glib libffi libvpx ragel libxklavier sm libgcrypt libxml2 libpcre xcb docbook-xml vala-bootstrap docbook-xsl xmlto gnutls zlib gperf gudev python3-devel hyphen intltool libxkbfile flac openldap gl flex doxygen fontconfig startup-notification freetype2 libcanberra egl libudev taglib libical xcb-xkb WebKit xorg-xproto xtrans I: Computing packages to install. This might be slow. Please wait. I: Nothing available to install I remembered from a while ago that on Ubuntu jhbuild might need `apt-file`, so I proceeded to install `apt-file` and ran `apt-file update`. Next I ran the `jhbuild sysdeps --install` command again. Now the output is different: I: Installing dependencies on system: libxslt vala-bootstrap texinfo libwebp mesa-libGLES xmlto sqlite3 liboauth libXrender startup-notification libpng taglib libproxy nspr bison wavpack docbook-xml openldap wayland-egl p11-kit cairo libicu xcb libsystemd libtasn1 libtiff libudev xcb-xkb gl libjpeg ppp pulseaudio libv4l py3cairo dbus dbus-glib libvpx ragel libxklavier sm egl libxml2 libX11 docbook-xsl libXdamage libXcomposite gnutls doxygen libXft enchant libXrandr gudev python3-devel libXt libXtst hyphen intltool xorg-macros xorg-kbproto libxkbfile flac zlib flex libdb fontconfig freetype2 libepoxy libcanberra gperf libffi nss libpcre libical polkit-gobject libgcrypt WebKit xorg-xproto xtrans I: Using apt-file to search for providers; this may be extremely slow. Please wait. Patience! And after a few minutes this line appeared and I was prompted for a password: I: Installing: libxslt1-dev libgles2-mesa-dev libsqlite3-dev liboauth-dev libxrender-dev libstartup-notification0-dev libpng-dev libtag1-dev libproxy-dev libnspr4-dev libwavpack-dev libegl1-mesa-dev libp11-kit-dev libcairo2-dev libicu-dev libxcb1-dev libsystemd-dev libtasn1-6-dev libudev-dev libxcb-xkb-dev libgl1-mesa-dev libpulse-dev libv4l-dev python3-cairo-dev dbus-1-dbg libdbus-glib-1-dev libvpx-dev libxklavier-dev libsm-dev libegl1-mesa-dev libxml2-dev libx11-dev libxdamage-dev libxcomposite-dev libgnutls28-dev libxft-dev libenchant-dev libxrandr-dev libgudev-1.0-dev python3-dev libxt-dev libxtst-dev xutils-dev x11proto-kb-dev libxkbfile-dev libflac-dev libz-mingw-w64-dev libfontconfig1-dev libfreetype6-dev libepoxy-dev libcanberra-gtk-dev libffi-dev libnss3-dev libpcre3-dev libical-dev libpolkit-gobject-1-dev libwebkit2gtk-4.0-dev x11proto-core-dev xtrans-dev valac texinfo xmlto bison ragel doxygen intltool flex gperf libwebp-dev libldap2-dev libtiff5-dev libjpeg-turbo8-dev ppp-dev libhyphen-dev libdb5.3-dev libgcrypt20-dev If jhbuild needs apt-file to be installed on Ubuntu to work correctly maybe it should state that at some point. The message 'Nothing available to install' is at best misleading.
So, for the first part of the bug (actually what the title says), this is kind of fixed in #781726. I mean, by running "sanitycheck" the user should know that they must install the needed libraries. That's what the doc says: https://developer.gnome.org/jhbuild/stable/getting-started.html.en However, we could be "nice" and do some error checking and printing a nice message to the user instead of showing them a python stacktrace.
Created attachment 350410 [details] [review] systeminstall: Show a "nice" message if some libraries are missing Instead of relying on the default python's stack trace.
Is it possible to determine the distribution specific package that needs to be installed by the user? I think I remember that jhbuild is already able to use apt-file on Ubuntu to determine the right packages. Also, from what I can see it seems the suggested packages are Fedora specific, at least for 'dbus-python' it seems to match, but then it does not look like 'pygtk' is a Fedora package. Searching the Fedoara package database for 'pygtk' reveals only a 'pygtk2' package but that does not seem to have any relationship to glib. While I am not a Fedora user I would guess, that 'pygobject2' would be the right package to install on Fedora. On Ubuntu however the right packages are 'python-gobject' and 'python-dbus'. If the message is going to hard code a package name at all, then I would prefer to include at least the package names for Fedora AND Ubuntu OR make it clear in the message that Fedoara package names are printed. Given a little more information the users will at least have a better chance of finding the corresponding package names for their distribution. However longer term wise, it would be nice if jhbuild was able to determine the distribution specific package names automatically using facilities such as 'apt-file' on Debian like distributions.
Of course it'd be nice to present distribution-specific package names, but presenting upstream names is better than the stacktrace we have now. But you're right, the right project is python-gobject, not pygtk. Accepted with that fixed.
Comment on attachment 350410 [details] [review] systeminstall: Show a "nice" message if some libraries are missing Patch committed with the suggestion. Not sure if we should close this bug.
Created attachment 350539 [details] [review] systeminstall: import GLib from gi.repository. I believe this patch can fix the problem.
Review of attachment 350539 [details] [review]: Could you briefly explain what this change does? ::: jhbuild/commands/sanitycheck.py @@ +146,3 @@ # check for "sysdeps --install" deps: try: + from gi.repository import GLib In systeminstall.py you have an extra ' as glib' at the end of this line, like this: from gi.repository import GLib as glib Did you forget to add that here or is it not necessary?
It is not necessary because it is not used afterward.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/jhbuild/-/issues/259.