Cant package Thonny Snap

Hey Snapcrafters Community, recently i decided to contribute something to Snaps and Ubuntu, so as a starter in building snaps i picked up Thonny, initial stages went fine but in the prime time i cant package my snap, the output is as follows :

usr/bin/thonny" does not exist

2023/02/27 05:00:51.795475 container.go:215: in snap “thonny”: path “usr/bin” does not exist

2023/02/27 05:00:51.795484 container.go:215: in snap “thonny”: path “usr” does ** not exist

error: cannot pack “/root/prime”: snap is unusable due to missing files)

Here is my YAML :

name: thonny

base: core22

version: ‘4.0.2’

summary: Beginner Friendly Python IDE.

description: | Easy to use beginner friendly Python IDE.

grade: devel confinement: devmode compression: lzo

apps: thonny:

command: usr/bin/thonny

environment: GTK_USE_PORTAL: 1

  plugs:
       - home
       - desktop
       - desktop-launch

parts: thonny-tar:

source: https://github.com/thonny/thonny/releases/download/v4.0.2/thonny-4.0.2-x86_64.tar.gz 

plugin: python

I did a thonny snap some years ago, but just for personal use ( never went to the store)… perhaps my old work can serve as a start for you:

1 Like

Thanks for Checking out and even offering the launchpad for my rocket :blush: ,Should i fork it or contribute directly ??

Feel free to fork and take it over, this was really only a personal experiment…

1 Like

Hey do you have any idea for the following output after several builds (modified) and even yours, snapcraft cant build the snap :-

Cannot pack snap file: Command '['snap', 'pack', '--filename', 'thonny_4.0.2_amd64.snap', '--compression', 'lzo', PosixPath('/build/thonny-ide/prime'), PosixPath('/build/thonny-ide')]' returned non-zero exit status 1. (container.go:215: in snap "thonny": path "bin/thonny" does not exist
error: cannot pack "/build/thonny-ide/prime": snap is unusable due to missing files)
Full execution log: '/root/.cache/snapcraft/log/snapcraft-20230227-130109.177634.log'
Build failed

the patch in my tree is outdated (20.04 moved to python3.10 meanwhile and the u2fdialog.py file changed) … if i drop that patch from my tree to just do a test build, it builds fine and i find bin/thonny in the prime dir …

It again fails new output :

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Failed to run 'override-pull': Exit code was 2.
Build failed

This time i removed the patch and used your unmodified file, i am using snapcraft automatic github builder…

Do you have the full log ? Looks like the wget did not work…

Sorry for the link of a new mod, here is the one of previous : https://launchpadlibrarian.net/653629613/buildlog_snap_ubuntu_focal_amd64_d039718c571eae1377ef56fa7560def4_BUILDING.txt.gz

Issues while validating snapcraft.yaml: The 'parts/thonny/plugin' property does not match the required schema: ['dump', 'python'] is not of type 'string'

That looks more like wrong syntax in your snapcraft.yaml

It was the one of a new mod , sorry for it, i have put it again

/bin/bash: line 34: wget: command not found

Add wget to your build-packages

Anything else to add in build-packages ??

not from the top of my head :slight_smile:

Ok i also added build-essential, rerunning waiting for the result…

Sadly it again failed, output --> https://launchpadlibrarian.net/653631909/buildlog_snap_ubuntu_focal_amd64_d039718c571eae1377ef56fa7560def4_BUILDING.txt.gz

well, you removed the patch but not the command in snapcraft.yaml that tries to apply it … comment the patch -p ... line

I commented all line related to hostfs patch and rerunning, hope this time it builds, :blush:

This time it says built but failed to release ?? Output --> https://launchpadlibrarian.net/653633399/buildlog_snap_ubuntu_focal_amd64_d039718c571eae1377ef56fa7560def4_BUILDING.txt.gz