FS#72606 - terminator no longer working with GTK version >3

Attached to Project: Community Packages
Opened by Heterology (Heterology) - Monday, 01 November 2021, 21:25 GMT
Last edited by Antonio Rojas (arojas) - Monday, 01 November 2021, 22:13 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To No-one
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: I just upgraded my system today with a complete system upgrade. Terminator is now complaining about dependencies not being installed.

Specifically, I see this when I run `terminator`:
`You need to install the python bindings for gobject, gtk and pango to run Terminator.`

I read the first bit of the Terminator source code and this is the first bit of the Python file that's causing this to throw:
```py
import sys
import os
import psutil
import pwd
try:
ORIGCWD = os.getcwd()
except OSError:
ORIGCWD = os.path.expanduser("~")

# Check we have simple basics like Gtk+ and a valid $DISPLAY
try:
import gi
gi.require_version('Gtk','3.0')
# pylint: disable-msg=W0611
from gi.repository import Gtk, Gdk

if Gdk.Display.get_default() == None:
print('You need to run terminator in an X environment. ' \
'Make sure $DISPLAY is properly set')
sys.exit(1)

except ImportError:
print('You need to install the python bindings for ' \
'gobject, gtk and pango to run Terminator.')
sys.exit(1)

```

It appears that the import to `import gi` is checking for `gi.require_version('Gtk','3.0')` and I now have version 4.0 (as of my most recent `-Syu`). It does _also_ appear that I have GTK version 3 installed, so maybe this is an upstream bug in Terminator?

I'm not sure what the best fix for this is for Arch users. Maybe somehow forcing GTK3 as a dependency for Terminator is possible? Or maybe this is a bug for upstream to Terminator to support GTK 4?

Regardless, it's annoying and that's why I wanted to file this bug report. I'll update this post if I figure out a workaround (besides uninstalled GTK4). Thank you!

Additional info:
* package version(s):
- terminator-2.1.1-2
- python-configobj-5.0.6.r110.g3e2f4cc-1
- gtk4-1:4.4.1-1
- gtk3-1:3.24.30+90+g20be04f7ac-1
- pango-1:1.48.10-1

* config and/or log files etc.
* link to upstream bug report, if any

Steps to reproduce:
- Update your Arch system to latest
- Install `gtk4` and `gtk3`
- Install `terminator`
- Try running `terminator` in a command line. You should see this error:
`You need to install the python bindings for gobject, gtk and pango to run Terminator.`
This task depends upon

Closed by  Antonio Rojas (arojas)
Monday, 01 November 2021, 22:13 GMT
Reason for closing:  Not a bug
Additional comments about closing:  Your system is partially updated. Please use the forum if you need support.
Comment by Antonio Rojas (arojas) - Monday, 01 November 2021, 21:33 GMT
What is the output of

python -c "import gi; gi.require_version('Gtk','3.0'); from gi.repository import Gtk, Gdk"
Comment by Heterology (Heterology) - Monday, 01 November 2021, 22:08 GMT
Looks like that's the culprit.

```
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/USER/.local/lib/python3.9/site-packages/gi/__init__.py", line 42, in <module>
from . import _gi
ImportError: libffi.so.7: cannot open shared object file: No such file or directory
```

(I saw this exception in my manual Python debugging of logging the exception in Terminator, but your command is a shorter reproduction of it)

I'm not sure how to resolve this one. Is this indicative of a problem with my general system? I couldn't fix it in a few minutes of searching the internet. I'll keep trying though, unless you have any ideas.

Earlier today, I was underclocking my system and it crashed. My `~/.zsh_history` file was corrupted. Maybe some other files were too? I've run an `fsck` on my machine by performing the following:
- Booting into GRUB, setting my disk to `ro`, and adding `fsck.mode=force fsck.repair=true`
- Verifying that my `/etc/fstab` is set to check the disk
- Booting and watching it check my disks
- Checking the output of `journalctl -b | grep fsck` to see that it checked my disks

Unfortunately, the issue with GTK and Python still persists after another reboot, so I'm not sure if it's related to my system reboot.

Any thoughts on why `libffi.so.7` would be causing a problem here? I'm not super familiar with what that is (besides likely being some compiled C dependency that Python uses to talk with GTK).
Comment by Heterology (Heterology) - Monday, 01 November 2021, 22:12 GMT
Alright, so I manually installed `libffi7` on my system like so:
`pikaur -S libffi7`

Now both your Python script and Terminator work properly.

This returns nothing now: `python -c "import gi; gi.require_version('Gtk','3.0'); from gi.repository import Gtk, Gdk"`

And `terminator` just runs Terminator as usual.

This is fixed for me now, but I'm not exactly sure what the fix is. Requiring that `libffi7` be a dependency of Terminator isn't possible because `libffi7` is an AUR package.

Loading...