pygtk apps fail with gnome-3-34 extension

Bug #1893262 reported by Ken VanDine
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snapcraft
Triaged
Medium
Heather Ellsworth

Bug Description

For reference: https://forum.snapcraft.io/t/gnome-3-34-extension-and-python-segfault/19650

The gnome-3-34-1804 content snap includes a python3 interpreter. For snaps that build python parts there is another python3 interpreter bundled as well. At runtime the bundled interpreter doesn't seem to be compatible with the version of python the modules were built with.

This can be worked around with a combination of build-environment and environment. Here's an excerpt:

apps:
  app:
    environment:
      PATH: $SNAP_DESKTOP_RUNTIME/usr/bin:$PATH
      PYTHONPATH: $PYTHONPATH:$SNAP_DESKTOP_RUNTIME/usr/lib/python3.6/site-packages:$SNAP/usr/lib/python3.6/site-packages:$SNAP/lib/python3.6/site-packages
    ...

parts:
  part:
    plugin: meson
    source: .
    build-environment:
      - PATH: /snap/gnome-3-34-1804-sdk/current/usr/bin:$PATH
    ...

Revision history for this message
Ken VanDine (ken-vandine) wrote :

And example of a PR which works around this issue https://github.com/Unrud/video-downloader/pull/38

Revision history for this message
Ken VanDine (ken-vandine) wrote :

It looks like the only thing needed here is adding PYTHONPATH to environment in the extension

Changed in snapcraft:
assignee: nobody → Heather Ellsworth (hellsworth)
Changed in snapcraft:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Heather Ellsworth (hellsworth) wrote :
Revision history for this message
Gold Star (goldstar611) wrote :

This is not fixed in core20 or core22.

https://forum.snapcraft.io/t/core22-gnome-extension-and-broken-symlinks/32900
https://forum.snapcraft.io/t/python-plugin-gnome-3-38-extension-error/33396

Here's a minimized snapcraft.yaml recipe that produces a broken snap.

```yaml
name: test
summary: summary
description: |
  description

version: '0.1'
base: core20
confinement: strict
grade: stable

apps:
  test:
    command: usr/bin/python
    extensions: [gnome-3-38]

parts:
  test:
    plugin: python
    source: https://github.com/psf/requests.git
```

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.