Hello! I think the core22 gnome extension is maybe creating broken python symlinks (to /snap/gnome-42-2204-sdk/48/usr/bin/python3.10) causing a review-tools linter to fail:
I can manually remove those symlinks and everything will work.
Contents of squashfs-root/usr/bin:
lrwxrwxrwx 1 graham graham 7 Nov 29 09:11 python -> python3
lrwxrwxrwx 1 graham graham 45 Nov 29 09:11 python3 -> /snap/gnome-42-2204-sdk/48/usr/bin/python3.10
lrwxrwxrwx 1 graham graham 7 Nov 29 09:11 python3.10 -> python3
Snapcraft, gnome-42-2204 and core 22 all from edge:
I thought it was interesting that things still work if you remove the symlinks, but it looks like the Python code has no (Python) dependencies other than the standard library (so the broken virtual-env isn’t an issue).
Hello, does the work include improving interoperability between the python plugin and the gnome extension? I’ve recently tried to update a snap from core20+python plugin+gnome-3-38 extension to core22 and gave up due the problem reported in this post, but I suspect I’d run into other issues, since the gnome extension sets PYTHONPATH. Thank you.
Hi, I am encountering the same issue with symlinks breaking my python app when using core22 + python plugin + gnome extension.
I’m also open to trying out any workarounds such as I can manually remove those symlinks and everything will work. Would something like that be best placed in an override-stage or override-prime section?
Could you please point me to a PR or files/repo so I can follow progress? I’d like to try my upgrade from core20+gnome+python -> core22+gnome+python once I know the fix is released. Thank you.
The fix involves changes in Craft-parts and Snapcraft. The Craft-parts change has already landed and we’re now working on the Snapcraft side (no PR yet).
Recently I tried to make two libadwaita based apps, but both gave me this kind of error.
Failed to load shared library 'libpango-1.0.so.0' referenced by the typelib: /snap/metadata-cleaner/x2/gnome-platform/usr/lib/x86_64-linux-gnu/libpango-1.0.so.0: undefined symbol: hb_ot_layout_get_horizontal_baseline_tag_for_script
The snapcraft.yaml for this is
snapcraft.yaml
name: metadata-cleaner # you probably want to 'snapcraft register <name>'
base: core22 # the base snap is the execution environment for this snap
version: '2.4.0' # just for humans, typically '1.2+git' or '1.3.2'
summary: View and clean metadata in files # 79 char long summary
description: |
Metadata within a file can tell a lot about you. Cameras record data about when and where a picture was taken and which camera was used. Office applications automatically add author and company information to documents and spreadsheets. This is sensitive information and you may not want to disclose it. This tool allows you to view metadata in your files and to get rid of it, as much as possible.
license: GPL-3.0+
architectures:
- build-on: amd64
grade: stable # must be 'stable' to release into candidate/stable channels
confinement: strict # use 'strict' once you have the right plugs and slots
compression: lzo
layout:
/usr/lib:
bind: $SNAP/usr/lib
/usr/share/locale:
bind: $SNAP/usr/share/locale
/usr/share/metadata-cleaner:
bind: $SNAP/usr/share/metadata-cleaner
environment:
# WORKAROUND: Add python modules in Snap to search path
PYTHONPATH: ${SNAP}/lib/python3.10/site-packages:${SNAP}/usr/lib/python3/dist-packages
parts:
mutagen:
after: [ffmpeg]
plugin: python
source: https://github.com/quodlibet/mutagen.git
source-tag: release-1.46.0
source-type: git
python-packages:
- mat2
- importlib-metadata
- importlib-resources
- PyGObject
build-packages:
- gir1.2-poppler-0.18
- gir1.2-gdkpixbuf-2.0
- libimage-exiftool-perl
stage-packages:
- libimage-exiftool-perl
- gir1.2-gdkpixbuf-2.0
- gir1.2-poppler-0.18
ffmpeg:
# WORKAROUND:
# Build from source because the ffmpeg package installs libraries as dependencies
# that conflict with the Gnome extension
plugin: autotools
source: https://ffmpeg.org/releases/ffmpeg-5.1.2.tar.xz
source-checksum: sha256/619e706d662c8420859832ddc259cd4d4096a48a2ce1eefd052db9e440eef3dc
autotools-configure-parameters:
# WORKAROUND: Install to /usr instead of /usr/local because it's not in search paths
- --prefix=/usr
- --disable-debug
- --disable-doc
- --disable-static
- --enable-gpl
- --enable-shared
- --disable-ffplay
- --disable-devices
- --enable-gnutls
- --enable-libmp3lame
- --enable-libvorbis
build-packages:
- nasm
- libgnutls28-dev
- libmp3lame-dev
- libvorbis-dev
stage-packages:
- libmp3lame0
stage:
- -usr/include
metadata-cleaner:
# See 'snapcraft plugins'
plugin: meson
after:
- ffmpeg
source: https://gitlab.com/rmnvgr/metadata-cleaner.git
source-tag: v${SNAPCRAFT_PROJECT_VERSION}
meson-parameters:
- --prefix=/usr
build-environment:
# WORKAROUND: The python plugin is broken with gnome extension
- PATH: ${CRAFT_PART_INSTALL}/bin:${PATH}
- PYTHONPATH: ""
stage-packages:
- perl
- libpoppler118
- libpoppler-glib8
- libpng-tools
- python3-gi-cairo
- gir1.2-poppler-0.18
- gir1.2-gdkpixbuf-2.0
- gir1.2-rsvg-2.0
- libimage-exiftool-perl
override-pull: |
craftctl default
sed -e 's|Icon=fr.romainvigier.MetadataCleaner|Icon=usr/share/icons/hicolor/scalable/apps/fr.romainvigier.MetadataCleaner.svg|g' -i application/data/fr.romainvigier.MetadataCleaner.desktop.in
override-stage: |
craftctl default
#sed -e 's|/usr/share/locale|/snap/metadata-cleaner/current/usr/share/locale|g' -i $SNAPCRAFT_STAGE/usr/bin/metadata-cleaner
#sed -e 's|/usr/share/metadata-cleaner/data|/snap/metadata-cleaner/current/usr/share/metadata-cleaner/data|g' -i $SNAPCRAFT_STAGE/usr/bin/metadata-cleaner
#sed -e 's|/usr/share/metadata-cleaner/src|/snap/metadata-cleaner/current/usr/share/metadata-cleaner/src|g' -i $SNAPCRAFT_STAGE/usr/bin/metadata-cleaner
#mkdir -p gnome-platform/usr/lib/x86_64-linux-gnu/
#ln -sf /snap/metadata-cleaner/current/usr/lib/x86_64-linux-gnu/libpango-1.0.so.0.5000.6 $CRAFT_PART_INSTALL/usr/lib/x86_64-linux-gnu/libpango-1.0.so.0
cleanup:
after: # Make this part run last; list all your other parts here
- metadata-cleaner
- ffmpeg
plugin: nil
build-snaps: # List all content-snaps and base snaps you're using here
- gnome-42-2204
- gnome-42-2204-sdk
- core22
override-prime: |
set -eux
for snap in "core22" "gnome-42-2204" "gnome-42-2204-sdk"; do # List all content-snaps and base snaps you're using here
cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$SNAPCRAFT_PRIME/{}" \;
done
apps:
metadata-cleaner:
command: usr/bin/metadata-cleaner
desktop: usr/share/applications/fr.romainvigier.MetadataCleaner.desktop
extensions: [gnome]
plugs:
- home
common-id: fr.romainvigier.MetadataCleaner
```
And this error I got in another one;
/snap/audio-sharing/x2/usr/bin/audio-sharing: symbol lookup error: /snap/audio-sharing/x2/gnome-platform/usr/lib/x86_64-linux-gnu/libpango-1.0.so.0: undefined symbol: hb_ot_layout_get_horizontal_baseline_tag_for_script
The snapcraft.yaml file is
snapcraft.yaml
name: audio-sharing # you probably want to 'snapcraft register ’
base: core22 # the base snap is the execution environment for this snap
version: ‘0.2.1’ # just for humans, typically ‘1.2+git’ or ‘1.3.2’
summary: Single-line elevator pitch for your amazing snap # 79 char long summary
description: |
This is my-snap’s description. You have a paragraph or two to tell the
most important story about your snap. Keep it under 100 words though,
we live in tweetspace and your description wants to look good in the snap
store.
grade: devel # must be ‘stable’ to release into candidate/stable channels
confinement: strict # use ‘strict’ once you have the right plugs and slots