sahib / rmlint

Extremely fast tool to remove duplicates and other lint from your filesystem
http://rmlint.rtfd.org
GNU General Public License v3.0
1.86k stars 128 forks source link

GUI not starting #572

Closed Bira-oliverio closed 2 years ago

Bira-oliverio commented 2 years ago

I'm using Fedora 36 and Gnome 42.1, when I try to run rmlint with gui interface I receive the following message.

$ rmlint --gui Traceback (most recent call last): File "/tmp/.shredder-bootstrap.py.4QU8M1", line 18, in File "/usr/lib/python3.10/site-packages/shredder/init.py", line 11, in gi.require_version('GtkSource', '3.0') File "/usr/lib64/python3.10/site-packages/gi/init.py", line 129, in require_version raise ValueError('Namespace %s not available for version %s' % ValueError: Namespace GtkSource not available for version 3.0

Thanks.

cebtenzzre commented 2 years ago

How did you install rmlint? The GUI needs gtksourceview3 (it's looking for /usr/lib/girepository-1.0/GtkSource-3.0.typelib), but it seems like you don't have it installed.

Bira-oliverio commented 2 years ago

The installation was done via the fedora repositories, the list or required files in the repository are: glibc >= 2.33.9000-43.fc35 hicolor-icon-theme libblkid.so.1()(64bit) libblkid.so.1(BLKID_2.17)(64bit) libc.so.6()(64bit) libc.so.6(GLIBC_2.10)(64bit) libc.so.6(GLIBC_2.14)(64bit) libc.so.6(GLIBC_2.2.5)(64bit) libc.so.6(GLIBC_2.3)(64bit) libc.so.6(GLIBC_2.3.3)(64bit) libc.so.6(GLIBC_2.33)(64bit) libc.so.6(GLIBC_2.34)(64bit) libc.so.6(GLIBC_2.4)(64bit) libc.so.6(GLIBC_2.7)(64bit) libelf.so.1()(64bit) libelf.so.1(ELFUTILS_1.0)(64bit) libgio-2.0.so.0()(64bit) libglib-2.0.so.0()(64bit) libgobject-2.0.so.0()(64bit) libjson-glib-1.0.so.0()(64bit) libjson-glib-1.0.so.0(libjson-glib-1.0.so.0)(64bit) libm.so.6()(64bit) libm.so.6(GLIBC_2.2.5)(64bit) libm.so.6(GLIBC_2.29)(64bit) python(abi) = 3.10 rtld(GNU_HASH)

The installed files are: /usr/bin/rmlint /usr/lib/.build-id /usr/lib/.build-id/ce /usr/lib/.build-id/ce/37ae164fc4a0cd72f7c3b2ecbda6d60a8c4b28 /usr/lib/python3.10/site-packages/Shredder-2.10.1.Ludicrous.Lemur-py3.10.egg-info /usr/lib/python3.10/site-packages/shredder /usr/lib/python3.10/site-packages/shredder/init.py /usr/lib/python3.10/site-packages/shredder/main.py /usr/lib/python3.10/site-packages/shredder/pycache /usr/lib/python3.10/site-packages/shredder/pycache/init.cpython-310.opt-1.pyc /usr/lib/python3.10/site-packages/shredder/pycache/init.cpython-310.pyc /usr/lib/python3.10/site-packages/shredder/pycache/main.cpython-310.opt-1.pyc /usr/lib/python3.10/site-packages/shredder/pycache/main.cpython-310.pyc /usr/lib/python3.10/site-packages/shredder/pycache/about.cpython-310.opt-1.pyc /usr/lib/python3.10/site-packages/shredder/pycache/about.cpython-310.pyc /usr/lib/python3.10/site-packages/shredder/pycache/application.cpython-310.opt-1.pyc /usr/lib/python3.10/site-packages/shredder/pycache/application.cpython-310.pyc /usr/lib/python3.10/site-packages/shredder/pycache/chart.cpython-310.opt-1.pyc /usr/lib/python3.10/site-packages/shredder/pycache/chart.cpython-310.pyc /usr/lib/python3.10/site-packages/shredder/pycache/cmdline.cpython-310.opt-1.pyc /usr/lib/python3.10/site-packages/shredder/pycache/cmdline.cpython-310.pyc /usr/lib/python3.10/site-packages/shredder/pycache/logger.cpython-310.opt-1.pyc /usr/lib/python3.10/site-packages/shredder/pycache/logger.cpython-310.pyc /usr/lib/python3.10/site-packages/shredder/pycache/query.cpython-310.opt-1.pyc /usr/lib/python3.10/site-packages/shredder/pycache/query.cpython-310.pyc /usr/lib/python3.10/site-packages/shredder/pycache/runner.cpython-310.opt-1.pyc /usr/lib/python3.10/site-packages/shredder/pycache/runner.cpython-310.pyc /usr/lib/python3.10/site-packages/shredder/pycache/tree.cpython-310.opt-1.pyc /usr/lib/python3.10/site-packages/shredder/pycache/tree.cpython-310.pyc /usr/lib/python3.10/site-packages/shredder/pycache/util.cpython-310.opt-1.pyc /usr/lib/python3.10/site-packages/shredder/pycache/util.cpython-310.pyc /usr/lib/python3.10/site-packages/shredder/pycache/window.cpython-310.opt-1.pyc /usr/lib/python3.10/site-packages/shredder/pycache/window.cpython-310.pyc /usr/lib/python3.10/site-packages/shredder/about.py /usr/lib/python3.10/site-packages/shredder/application.py /usr/lib/python3.10/site-packages/shredder/chart.py /usr/lib/python3.10/site-packages/shredder/cmdline.py /usr/lib/python3.10/site-packages/shredder/logger.py /usr/lib/python3.10/site-packages/shredder/query.py /usr/lib/python3.10/site-packages/shredder/resources /usr/lib/python3.10/site-packages/shredder/resources/shredder.gresource /usr/lib/python3.10/site-packages/shredder/runner.py /usr/lib/python3.10/site-packages/shredder/tree.py /usr/lib/python3.10/site-packages/shredder/util.py /usr/lib/python3.10/site-packages/shredder/views /usr/lib/python3.10/site-packages/shredder/views/init.py /usr/lib/python3.10/site-packages/shredder/views/pycache /usr/lib/python3.10/site-packages/shredder/views/pycache/init.cpython-310.opt-1.pyc /usr/lib/python3.10/site-packages/shredder/views/pycache/init.cpython-310.pyc /usr/lib/python3.10/site-packages/shredder/views/pycache/editor.cpython-310.opt-1.pyc /usr/lib/python3.10/site-packages/shredder/views/pycache/editor.cpython-310.pyc /usr/lib/python3.10/site-packages/shredder/views/pycache/locations.cpython-310.opt-1.pyc /usr/lib/python3.10/site-packages/shredder/views/pycache/locations.cpython-310.pyc /usr/lib/python3.10/site-packages/shredder/views/pycache/runner.cpython-310.opt-1.pyc /usr/lib/python3.10/site-packages/shredder/views/pycache/runner.cpython-310.pyc /usr/lib/python3.10/site-packages/shredder/views/pycache/settings.cpython-310.opt-1.pyc /usr/lib/python3.10/site-packages/shredder/views/pycache/settings.cpython-310.pyc /usr/lib/python3.10/site-packages/shredder/views/editor.py /usr/lib/python3.10/site-packages/shredder/views/locations.py /usr/lib/python3.10/site-packages/shredder/views/runner.py /usr/lib/python3.10/site-packages/shredder/views/settings.py /usr/lib/python3.10/site-packages/shredder/window.py /usr/share/applications/shredder.desktop /usr/share/doc/rmlint /usr/share/doc/rmlint/README.rst /usr/share/glib-2.0/schemas/org.gnome.Shredder.gschema.xml /usr/share/icons/hicolor/scalable/apps/shredder.svg /usr/share/licenses/rmlint /usr/share/licenses/rmlint/COPYING /usr/share/locale/de/LC_MESSAGES/rmlint.mo /usr/share/locale/es/LC_MESSAGES/rmlint.mo /usr/share/locale/fr/LC_MESSAGES/rmlint.mo /usr/share/man/man1/rmlint.1.gz

Bira-oliverio commented 2 years ago

After installing gtksourceview3 I got a similar error.

$ rmlint --gui
Traceback (most recent call last):
  File "/tmp/.shredder-bootstrap.py.ED6SM1", line 18, in <module>
  File "/usr/lib/python3.10/site-packages/shredder/__init__.py", line 11, in <module>
    gi.require_version('GtkSource', '3.0')
  File "/usr/lib64/python3.10/site-packages/gi/__init__.py", line 129, in require_version
    raise ValueError('Namespace %s not available for version %s' %
ValueError: Namespace GtkSource not available for version 3.0

As you can see GtkSource-3.0.typelib is in the right place

$ ls /usr/lib/girepository-1.0/GtkSource-3.0.typelib -l
-rw-r--r--. 1 root root 72120 jan 20 09:14 /usr/lib/girepository-1.0/GtkSource-3.0.typelib
cebtenzzre commented 2 years ago

It seems like it finds some version of GtkSourceView, but not the right one. What does the output of these commands look like on your system? My results are provided for comparison.

$ g-ir-scanner --version
g-ir-scanner 1.72.0
$ python3.10 -m pip show PyGobject
Name: PyGObject
Version: 3.42.1
Summary: Python bindings for GObject Introspection
Home-page: https://pygobject.readthedocs.io
Author: James Henstridge
Author-email: james@daa.com.au
License: GNU LGPL
Location: /usr/lib/python3.10/site-packages
Requires: 
Required-by:
$ python -c 'import gi; print(gi.Repository.get_default().enumerate_versions("GtkSource"))'
['3.0', '4', '5']
$ cat get-search-path.c  # create this file
#include <stdio.h>
#include <girepository.h>

int main()
{
  g_irepository_get_default(); // initialize gi

  GSList *search_path = g_irepository_get_search_path();
  for (; search_path; search_path = search_path->next)
    puts(search_path->data);
}
$ gcc get-search-path.c -o get-search-path $(pkg-config --cflags --libs gobject-introspection-1.0)
$ ./get-search-path
/usr/lib/girepository-1.0
$ file $(./get-search-path)/GtkSource*
/usr/lib/girepository-1.0/GtkSource-3.0.typelib: G-IR binary database, v4.0, 174 entries/122 local
/usr/lib/girepository-1.0/GtkSource-4.typelib:   G-IR binary database, v4.0, 174 entries/123 local
/usr/lib/girepository-1.0/GtkSource-5.typelib:   G-IR binary database, v4.0, 175 entries/123 local
$ g-ir-inspect --print-shlibs --print-typelibs --version=3.0 GtkSource
shlib: libgtksourceview-3.0.so.1
typelib: xlib-2.0
typelib: GLib-2.0
typelib: Gdk-3.0
typelib: HarfBuzz-0.0
typelib: GdkPixbuf-2.0
typelib: Gtk-3.0
typelib: cairo-1.0
typelib: GObject-2.0
typelib: Pango-1.0
typelib: Gio-2.0
typelib: GModule-2.0
typelib: Atk-1.0
Bira-oliverio commented 2 years ago

Here you have the results, you are right the system is not finding the GtkSource-3.0.typelib, but I don't know how to fix this.

$ g-ir-scanner --version g-ir-scanner 1.72.0

$ python3.10 -m pip show PyGobject Name: PyGObject Version: 3.42.1 Summary: Python bindings for GObject Introspection Home-page: https://pygobject.readthedocs.io Author: James Henstridge Author-email: james@daa.com.au License: GNU LGPL Location: /usr/lib64/python3.10/site-packages Requires: Required-by:

$ python -c 'import gi; print(gi.Repository.get_default().enumerate_versions("GtkSource"))' ['4', '5']

$ ./get-search-path /usr/lib64/girepository-1.0

$ *file $(./get-search-path)/GtkSource /usr/lib64/girepository-1.0/GtkSource-4.typelib: G-IR binary database, v4.0, 174 entries/123 local /usr/lib64/girepository-1.0/GtkSource-5.typelib: G-IR binary database, v4.0, 175 entries/123 local**

$ g-ir-inspect --print-shlibs --print-typelibs --version=3.0 GtkSource Failed to load typelib: Typelib file for namespace 'GtkSource', version '3.0' not found

cebtenzzre commented 2 years ago

It seemed like that might be the issue, but I wasn't sure until now - /usr/lib64 and /usr/lib are different directories on Fedora, and GtkSource-3.0.typelib is installed in /usr/lib/girepository-1.0. Unless you've ended up with a 32-bit version of gtksourceview3 (dnf info gtksourceview3 | grep Arch ?), I assume the solution is as simple as setting GI_TYPELIB_PATH=/usr/lib/girepository-1.0 (or possibly GI_TYPELIB_PATH=/usr/lib64/girepository-1.0:/usr/lib/girepository-1.0) so that gi can find the typelib.

Bira-oliverio commented 2 years ago

Yes, you are right, I removed the previous gtksourceview3 and intelled the right architecture version and everything worked. Thanks..

cebtenzzre commented 2 years ago

I messaged the maintainer of the Fedora package about this. I'll post an update if I get a response. For now, you can close this issue since it's not an upstream problem.