Pluma: unable to enable plugins External tools, Python Console, Quick Open, Snippets) because of missed /usr/lib/x86_64-linux-gnu/libpeas-1.0/loaders/libpythonloader.so

Bug #1846890 reported by Norbert on 2019-10-05
30
This bug affects 6 people
Affects Status Importance Assigned to Milestone
libpeas (Ubuntu)
Medium
Unassigned

Bug Description

Steps to reproduce:
1. Install Ubuntu 19.10
2. Launch Pluma
3. Go to Edit -> Preferences, switch to Plugins tab
4. Try enable all plugins by checking their checkmarks

Expected results:
* all plugins are enabled without errors or warnings;

Actual results:
* plugin(s) are not enabled, show the following errors in `pluma`'s terminal:

```
$ pluma

(pluma:1685): libpeas-WARNING **: 19:20:59.204: Failed to load module 'pythonloader': /usr/lib/x86_64-linux-gnu/libpeas-1.0/loaders/libpythonloader.so: cannot open shared object file: No such file or directory

(pluma:1685): libpeas-WARNING **: 19:20:59.205: Could not load plugin loader 'python'
```

Note: in previous releases the `libpythonloader.so` was located in libpeas-1.0-python2loader package (see https://packages.ubuntu.com/search?suite=disco&arch=amd64&mode=exactfilename&searchon=contents&keywords=libpythonloader.so ) but this file is missed in 19.10 repository.

ProblemType: Bug
DistroRelease: Ubuntu 19.10
Package: pluma 1.22.2-0ubuntu1
ProcVersionSignature: Ubuntu 5.3.0-13.14-generic 5.3.0
Uname: Linux 5.3.0-13-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu7
Architecture: amd64
CurrentDesktop: MATE
Date: Sat Oct 5 19:23:02 2019
InstallationDate: Installed on 2019-10-05 (0 days ago)
InstallationMedia: Ubuntu-MATE 19.10 "Eoan Ermine" - Beta amd64 (20191004)
SourcePackage: pluma
UpgradeStatus: No upgrade log present (probably fresh install)

Norbert (nrbrtx) wrote :

Quick and dirty has is to create a symlink between new file name `libpython2loader.so` (see https://packages.ubuntu.com/eoan/amd64/libpeas-1.0-python2loader/filelist ) and expected old one (see https://packages.ubuntu.com/disco/amd64/libpeas-1.0-python2loader/filelist ):

```
sudo ln -s /usr/lib/x86_64-linux-gnu/libpeas-1.0/loaders/libpython2loader.so /usr/lib/x86_64-linux-gnu/libpeas-1.0/loaders/libpythonloader.so
```

summary: - Unable to enable plugins 9External tools, Python Console, Quick Open,
+ Unable to enable plugins External tools, Python Console, Quick Open,
Snippets) because of missed /usr/lib/x86_64-linux-
gnu/libpeas-1.0/loaders/libpythonloader.so
description: updated
Vlad Orlov (monsta) wrote :
affects: pluma (Ubuntu) → libpeas (Ubuntu)
summary: - Unable to enable plugins External tools, Python Console, Quick Open,
- Snippets) because of missed /usr/lib/x86_64-linux-
+ Pluma: unable to enable plugins External tools, Python Console, Quick
+ Open, Snippets) because of missed /usr/lib/x86_64-linux-
gnu/libpeas-1.0/loaders/libpythonloader.so
Martin Wimpress (flexiondotorg) wrote :

This issue is due to an upstream (erroneous) change in libpeas 1.24.

The only reference to python loader is at https://github.com/mate-desktop/pluma/blob/1.22/pluma/pluma-plugins-engine.c#L63

```
pluma/pluma-plugins-engine.c:63
    peas_engine_enable_loader (PEAS_ENGINE (engine), "python");
```

Looking at the blibpeas code here's that function: https://github.com/GNOME/libpeas/blob/master/libpeas/peas-engine.c#L943

```
libpeas/peas-engine.c:943
 * peas_engine_enable_loader:
```

It still references `python` as Python 2 loader and then it calls peas_utils_get_loader_id to get loader id by name https://github.com/GNOME/libpeas/blob/master/libpeas/peas-utils.c#L257

```
libpeas/peas-utils.c:257
peas_utils_get_loader_id (const gchar *loader)
```

That function looks at all_plugin_loaders array with all known loaders names

```
static const gchar *all_plugin_loaders[] = {
  "c", "lua5.1", "python", "python3"
};
```

The Python 2 loader is still named `python` this means, if we change python loader name to python2 in Pluma, libpeas won't find it.

This is where the loader library name was changed without changing the loader name in the list of loaders: https://github.com/GNOME/libpeas/commit/dabb83a2e217694220a55c2019a081365a4a1288#diff-ad34de593e22ad307274456f3b4724a3

After that, they dropped autotools build files where you can see that the library was called libpythonloader in the makefile: https://github.com/GNOME/libpeas/commit/eadd10dbdd5b9b6b0488aeb41d4bf1592ba9d5d2#diff-f2abb793309b0ed9d8e63c1e038b1e31

Here is a test case:

```
#include <libpeas/peas-engine.h>

int
main (int argc, char **argv) {
    PeasEngine *engine = peas_engine_get_default ();
    peas_engine_enable_loader (engine, "python2");
    return 0;
}
```

Build the above with:

```
gcc -Wall -o peas-test peas-test.c `pkg-config --cflags libpeas-1.0` `pkg-config --libs libpeas-1.0`
```

And run it:

```
$ ./peas-test
```

You'll get this output:

```
(process:13201): libpeas-WARNING **: 13:25:09.920: Failed to enable unknown plugin loader 'python2'
```

And with that, we can confirm that the `python2` loader won't be found by libpeas and that the debdiff above is the correct way to fix this issue.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in libpeas (Ubuntu):
status: New → Confirmed

The attachment "Debdiff to fix Python 2 loader name" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Changed in libpeas (Ubuntu):
importance: Undecided → Medium
Changed in libpeas (Ubuntu):
status: Confirmed → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libpeas - 1.24.0-2ubuntu1

---------------
libpeas (1.24.0-2ubuntu1) eoan; urgency=medium

  * Add fix-python2-loader-name.patch to fix Python 2 loader name.
    Fixes loading Python plugins in Pluma. (LP: #1846890)

 -- Vlad Orlov <email address hidden> Mon, 07 Oct 2019 10:32:09 +0200

Changed in libpeas (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers