Core22 gnome extension and broken symlinks

The fix is now available in the stable release. It will be available in Snapcraft 7.4, for now it’s still available only in edge.

@tcab The workarounds for python3 + gnome extension may not be needed anymore with this new snapcraft release.

Is the stable release 7.3.1 without the suffix? because thats the latest version that snap refresh snapcraft gives me, and that’s the version that appears in my github action snapcore/action-build@v1 run.

I hope the answer is no, and there is another version coming, because 7.3.1 doesn’t fix my problem pushing to snapcraft store:

Status: processing
Status: error while processing
Issues while processing snap:
- package contains external symlinks: bin/python -> python3, bin/python3 -> /snap/gnome-42-2204-sdk/83/usr/bin/python3.10, bin/python3.10 -> python3

Using snapcraft from the edge channel You will need check the GitHub Actions update with the PR fix the issue

It should have been fixed in this release, could you post a copy of the yaml or the relevant parts so we can understand what’s happening?

My project is https://github.com/abulka/pynsource - a Python UML tool. The snapfile is https://github.com/abulka/pynsource/blob/master/snap/snapcraft.yaml

I tried snapcraft 7.3.1 and even 7.3.1.post20+git13719604 from edge - which build the snap ok but I still get the error trying to push to the store with snapcraft upload *.snap --release edge.

Interestingly a fork of my project with the @goldstar611 workarounds does publish to the store ok https://github.com/goldstar611/atestsnap

@tigarmo You may want to have a look at @tcab’s project above, where the Python interpreter from the gnome extension still seems to be causing problems.

The python fixes are only on edge, should be available in Snapcraft 7.4.0 once we tag it

Ah, that explains the situation. Updated my previous comment about availability.

I’ve just packed pynsource with Snapcraft 7.3.1.post21+gitfa823013 and workarounds commented out, and it seems that Python links are correct:

$ ls -l bin/python*
lrwxrwxrwx 1 claudio claudio  7 Mar 16 12:48 bin/python -> python3
lrwxrwxrwx 1 claudio claudio 19 Mar 16 12:48 bin/python3 -> /usr/bin/python3.10
lrwxrwxrwx 1 claudio claudio  7 Mar 16 12:48 bin/python3.10 -> python3

This is what I commented out:

diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
index 28ee110..57f845d 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -36,9 +36,9 @@ apps:
       - network-bind
       - removable-media
 
-environment:
-  # WORKAROUND: Add python modules in Snap to search path
-  PYTHONPATH: ${SNAP}/lib/python3.10/site-packages:${SNAP}/usr/lib/python3/dist-packages
+#environment:
+#  # WORKAROUND: Add python modules in Snap to search path
+#  PYTHONPATH: ${SNAP}/lib/python3.10/site-packages:${SNAP}/usr/lib/python3/dist-packages
 
 parts:
   copy-stuff:
@@ -63,7 +63,7 @@ parts:
       # https://forum.snapcraft.io/t/python-plugin-gnome-3-extension-error/33396/8?u=oleksis
       # Seem to need this otherwise get ERROR: Can not execute `setup.py` since setuptools is not available in the build environment.
       - PATH: ${CRAFT_PART_INSTALL}/bin:${PATH:+:$PATH}
-      - PYTHONPATH: /usr/lib/python310.zip:/usr/lib/python3.10:/usr/lib/python3.10/lib-dynload:/root/.local/lib/python3.10/site-packages:/usr/local/lib/python3.10/dist-packages:/usr/lib/python3/dist-packages:/root/project${PYTHONPATH:+:$PYTHONPATH}
+      #- PYTHONPATH: /usr/lib/python310.zip:/usr/lib/python3.10:/usr/lib/python3.10/lib-dynload:/root/.local/lib/python3.10/site-packages:/usr/local/lib/python3.10/dist-packages:/usr/lib/python3/dist-packages:/root/project${PYTHONPATH:+:$PYTHONPATH}
     build-packages:
       - freeglut3
       - freeglut3-dev

Updated snap manifest:

  • Comment PYTHONPATH environment variable
  • Install pip and update setuptools

For Build number 37

➜ sudo snap refresh
➜ snapcraft --version
snapcraft 7.3.1.post21+gitfa823013
➜ snapcraft clean
Cleaned build provider 
➜ snapcraft --debug
➜ unsquashfs yt-dlg_1.8.5-0-g1c7dbf0_amd64.snap
➜ ls -l squashfs-root/bin/python*
lrwxrwxrwx 1 oleksis oleksis  7 Mar 17 05:30 squashfs-root/bin/python -> python3
lrwxrwxrwx 1 oleksis oleksis 19 Mar 17 05:33 squashfs-root/bin/python3 -> /usr/bin/python3.10
lrwxrwxrwx 1 oleksis oleksis  7 Mar 17 05:30 squashfs-root/bin/python3.10 -> python3
➜ sudo snap install yt-dlg_1.8.5-0-g1c7dbf0_amd64.snap --dangerous
➜ snapcraft upload --release=edge yt-dlg_1.8.5-0-g1c7dbf0_amd64.snap
Revision 37 created for 'yt-dlg' and released to 'edge'  

Conected to to the repo the build number 38 failed to release. Is the lint warnings ?

I just tested my snap (Calaboka) built with snapcraft from latest edge as of now (7.3.1.post22+gitc64123e8). I can confirm that it builds and runs successfully. It looks like core22 + python + gnome finally work together! Thank you.

2 Likes

I can’t access this build 38 logs, but the linter warnings should be only warnings. Maybe it’s just a transient glitch?

Buildlog snap Ubuntu Jammy amd64 - Logs

From your logs you’re running the stable 7.3.1, instead of the 7.3.post-something from the edge channel.

The logs is from Build #2053750 snap is linked to: oleksis/youtube-dl-gui

When snapcraft.io Build process update to the latest fixed snap ?

Confirmed - with snapcraft 7.3.1.post21+gitfa823013 from edge, not only does pynsource build without workarounds, it also pushes to the store correctly.

I also managed to remove the build-packages: section entirely and everything from stage-packages: except for libsdl2-2.0-0, reducing the size of the snap from 300Mb to 150Mb. :tada:

Here is the new (pithy - at least I think so) pysnource snapcraft.yaml in case it helps anyone.

1 Like

Same here re: snap size after removing no-longer-needed build/stage packages: 31 MB -> 7.5 MB (76% reduction!).

31M Dec 22 17:35 calaboka_1.3.2_amd64.snap
7.5M Mar 17 22:12 calaboka_1.4.0_amd64.snap
1 Like

Updated snap manifest:

  • Remove build-environment, build-packages
  • Updated stage-packages
  • Size 51.60% reduction
  • Use snapcraft 7.3.1.post23+git24640301
➜ du -sh yt-dlg_1.8.5-0-g1c7dbf0_amd64.orig.snap 
281M yt-dlg_1.8.5-0-g1c7dbf0_amd64.orig.snap

➜ sudo snap refresh
➜ snapcraft --version
snapcraft 7.3.1.post23+git24640301
➜ snapcraft clean
Cleaned build provider 
➜ snapcraft --debug

➜ du -sh yt-dlg_1.8.5-0-g1c7dbf0_amd64.snap 
145M    yt-dlg_1.8.5-0-g1c7dbf0_amd64.snap

➜ sudo snap install yt-dlg_1.8.5-0-g1c7dbf0_amd64.snap --dangerous
➜ snapcraft upload --release=edge yt-dlg_1.8.5-0-g1c7dbf0_amd64.snap
Revision 39 created for 'yt-dlg' and released to 'edge'  
3 Likes