Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Hypexed

macrumors newbie
Original poster
Aug 24, 2023
11
6
Hi guys I'm back again! :-D

An issue Ubuntu Xenial PPC has is broken Nautilus extensions. Specifically attempting to install packages like nautilis-admin results in Nautilus silently crashing on startup loading the extension. This can be seen by running "sudo nautilus" from a terminal and seeing it trying to open an i386 binary! I thought I had caused this pollution myself when trying to get "Open as Administrator" working as the official packages couldn't be download from apt. But as it turns out it wasn't me but an official package was broken!

Bash:
sudo nautilus

(nautilus:5941): Gtk-WARNING **: Failed to register client: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

(nautilus:5941): Nautilus-Python-WARNING **: g_module_open libpython failed: /usr/lib/i386-linux-gnu//libpython2.7.so.1.0: cannot open shared object file: No such file or directory

After taking a deep dive figuring out why Nautilus kept crashing on my Xenial system I tracked it down to the "libnautilus-python.so" included in the python-nautilus package. Likely caused by multiarch support on i386/x64 platforms, they broke the binary compilation by causing the extension library to attempt opening an i386-linux-gnu python library. On PowerPC of course this fails instantly. But it doesn't end there. I checked other non-x86 based packages like ppc64el and arm and they are all polluted! Looks like no one bothered to check or no one uses Nautilus extensions on anything but a common PC. :lol:

Bash:
damien@ubuntu:~$ dpkg -S libnautilus-python.so
python-nautilus: /usr/lib/nautilus/extensions-3.0/libnautilus-python.so
damien@ubuntu:~$ file /usr/lib/nautilus/extensions-3.0/libnautilus-python.so
/usr/lib/nautilus/extensions-3.0/libnautilus-python.so: ELF 32-bit MSB shared object, PowerPC or cisco 4500, version 1 (SYSV), dynamically linked, BuildID[sha1]=2d95bd18b76fd32d6e1b5268d22e0f5600306e02, stripped
damien@ubuntu:~$ strings /usr/lib/nautilus/extensions-3.0/libnautilus-python.so | grep i386
nautilus-python:g_module_open /usr/lib/i386-linux-gnu//libpython2.7.so.1.0
/usr/lib/i386-linux-gnu//libpython2.7.so.1.0
damien@ubuntu:~$ strings /usr/lib/nautilus/extensions-3.0/libnautilus-python.so | grep powerpc
damien@ubuntu:~$


Well now I can offer a fix. It was fairly trivial to fix. The culprit was the libdirsuffix in the m4/python.m4 file. The libdirsuffix was set to "i386-linux-gnu" so I changed it to "powerpc-linux-gnu". The hard coding was what broke it really as i386 shouldn't have been inserted into a generic build file for cross platform use, so this is really the result of a faulty patch, that wasn't cross checked. To fix it I simply changed i386 to powerpc. Since my intent is to produce a powerpc specific binary I didn't spent time on a generic fix. It looks to be fixed in the version 4 builds, but only by default it looks, as they changed the build system.

So what does this all mean? It means you can install nautilis-admin and the menu extensions for "Open as Administrator" or "Edit as Administrator" can work again! :-D

Here's the fixed package and source:
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.