Call for testing: snapcraft 3.1

Hello Snapcrafters! The Snapcraft team is delighted to announce that version 3.1 is now available.

The release notes are currently being drafted, but should give a sufficient view of what is included in this release.

The snapcraft snap for 3.1 currently available in the candidate channel, to try it out run:

$ sudo snap install --candidate --classic snapcraft

Of, if you already have it installed, to try it out run:

$ sudo snap refresh --candidate snapcraft
$ time snapcraft version
snapcraft, version 3.1

real    0m0.341s
user    0m0.295s
sys     0m0.048s
$ snap refresh snapcraft --stable
snapcraft 3.0.1 from Canonicalβœ“ refreshed
$ time snapcraft version
snapcraft, version 3.0.1

real    0m1.305s
user    0m0.838s
sys     0m0.383s

Yay! I’m guessing that’s due to bug 1808199 being fixed.

Any plans to address that (generate pyc files) generically in the Python plugin?

@sparkiegeek the reason we removed this in the python was becuase of user complaints from folks building using multiple python based parts. Cosidering that we added override- for stage and prime, I suspect we can relax some rules a bit and allow plugins to meddle in those directories, but I am weary of this as stage and prime are not private to parts.

1 Like

Ack, I think we just need to be mindful that this adds to the perception of snaps being slow - Python based snaps will be in trouble if they don’t go out of their way to compile the PYCs, since Python will try at every opportunity to cache the PYCs and fail, leading to a re-parse/compile for every import.

I wrote a script to automate testing a bunch of snaps. I fed it a load from snapcrafters and some others. Most use lxd (due to them being core16) but a few use multipass as they’re core18. Here’s the diff between two runs.

snapcraft on host:						snapcraft on host:
snapcraft, version 3.0.1						snapcraft, version 3.1
multipass on host:						multipass on host:
multipass  v0.5							multipass  v0.5
multipassd v0.5							multipassd v0.5
lxd on host:							lxd on host:
3.9								3.9
πŸ—™ - evince(multipass)					      |	βœ“ - evince(multipass)
βœ“ - gedit(multipass)						βœ“ - gedit(multipass)
πŸ—™ - eog(multipass)					      |	βœ“ - eog(multipass)
βœ“ - quadrapassel(multipass)					βœ“ - quadrapassel(multipass)
βœ“ - dosbox-jz-snap(multipass)					βœ“ - dosbox-jz-snap(multipass)
βœ“ - android-studio(lxd)						βœ“ - android-studio(lxd)
βœ“ - android-studio-canary(lxd)					βœ“ - android-studio-canary(lxd)
βœ“ - atom(lxd)							βœ“ - atom(lxd)
βœ“ - axel(lxd)							βœ“ - axel(lxd)
βœ“ - brackets(lxd)						βœ“ - brackets(lxd)
βœ“ - brave(lxd)							βœ“ - brave(lxd)
βœ“ - cassandra(lxd)						βœ“ - cassandra(lxd)
βœ“ - corebird(lxd)						βœ“ - corebird(lxd)
βœ“ - corsixth(lxd)						βœ“ - corsixth(lxd)
βœ“ - ddgr(lxd)							βœ“ - ddgr(lxd)
βœ“ - discord(lxd)						βœ“ - discord(lxd)
βœ“ - discord-ptb(lxd)						βœ“ - discord-ptb(lxd)
βœ“ - duckmarines(lxd)						βœ“ - duckmarines(lxd)
βœ“ - eclipse(lxd)						βœ“ - eclipse(lxd)
βœ“ - ffmpeg(lxd)							βœ“ - ffmpeg(lxd)
βœ“ - fkill(lxd)							βœ“ - fkill(lxd)
βœ“ - get-iplayer(lxd)						βœ“ - get-iplayer(lxd)
βœ“ - ghost-desktop(lxd)						βœ“ - ghost-desktop(lxd)
βœ“ - gimp(multipass)						βœ“ - gimp(multipass)
βœ“ - googler(lxd)						βœ“ - googler(lxd)
βœ“ - helm(lxd)							βœ“ - helm(lxd)
βœ“ - inadyn(lxd)							βœ“ - inadyn(lxd)
βœ“ - irccloud-desktop(lxd)					βœ“ - irccloud-desktop(lxd)
βœ“ - irssi(lxd)							βœ“ - irssi(lxd)
βœ“ - jenkins(lxd)						βœ“ - jenkins(lxd)
βœ“ - links(lxd)							βœ“ - links(lxd)
βœ“ - magic-wormhole(lxd)						βœ“ - magic-wormhole(lxd)
βœ“ - mattermost-desktop(lxd)					βœ“ - mattermost-desktop(lxd)
βœ“ - mdl(lxd)							βœ“ - mdl(lxd)
βœ“ - minetest(lxd)						βœ“ - minetest(lxd)
πŸ—™ - mosaic(lxd)						      |	βœ“ - mosaic(lxd)
βœ“ - mrrescue(lxd)						βœ“ - mrrescue(lxd)
βœ“ - mumble(lxd)							βœ“ - mumble(lxd)
βœ“ - mumble-stable(lxd)						βœ“ - mumble-stable(lxd)
βœ“ - mutt(lxd)							βœ“ - mutt(lxd)
βœ“ - newsboat(lxd)						βœ“ - newsboat(lxd)
βœ“ - obs-studio(lxd)						βœ“ - obs-studio(lxd)
βœ“ - offlineimap(lxd)						βœ“ - offlineimap(lxd)
βœ“ - opentoonz(multipass)					βœ“ - opentoonz(multipass)
βœ“ - opentyrian(lxd)						βœ“ - opentyrian(lxd)
βœ“ - pypy(lxd)							βœ“ - pypy(lxd)
βœ“ - pypy3(lxd)							βœ“ - pypy3(lxd)
βœ“ - pyradio(lxd)						βœ“ - pyradio(lxd)
βœ“ - scummvm(lxd)						βœ“ - scummvm(lxd)
βœ“ - sdlpop(lxd)							βœ“ - sdlpop(lxd)
βœ“ - sentry(lxd)							βœ“ - sentry(lxd)
βœ“ - simplenote(lxd)						βœ“ - simplenote(lxd)
βœ“ - slack-term(lxd)						βœ“ - slack-term(lxd)
βœ“ - spelunky(lxd)						βœ“ - spelunky(lxd)
βœ“ - storjshare-gui(lxd)						βœ“ - storjshare-gui(lxd)
βœ“ - sublime-text(lxd)						βœ“ - sublime-text(lxd)
βœ“ - tcpie(lxd)							βœ“ - tcpie(lxd)
βœ“ - teleconsole(lxd)						βœ“ - teleconsole(lxd)
βœ“ - term2048(lxd)						βœ“ - term2048(lxd)
βœ“ - vault(lxd)							βœ“ - vault(lxd)
βœ“ - vscode(lxd)							βœ“ - vscode(lxd)
βœ“ - warzone2100(lxd)						βœ“ - warzone2100(lxd)
βœ“ - wethr(lxd)							βœ“ - wethr(lxd)
βœ“ - wire(lxd)							βœ“ - wire(lxd)
βœ“ - wordpress-desktop(lxd)					βœ“ - wordpress-desktop(lxd)
βœ“ - xonotic(lxd)						βœ“ - xonotic(lxd)
βœ“ - yakyak(lxd)							βœ“ - yakyak(lxd)

The script needs a bit of work, and sometimes builds seem to fail where they normally work fine under normal circumstances. But the above indicates to me that snapcraft 3.1 works as well if not better than 3.0.1 at building stuff we rely on regularly.

1 Like

@popey Am I missing something? Both columns show snapcraft version 3.1 being used?

That was a copy/paste error.

3.1 is now available on the stable channel and the release notes have left their draft status

snapcraft snap is broken.

$ snapcraft version
snapcraft, version 3.1
$ which snapcraft
$ snapcraft -d
Sorry, an error occurred in Snapcraft.
We would appreciate it if you anonymously reported this issue.
No other data than the traceback ('/tmp/tmpfzqf2osp/trace.txt') and the version of snapcraft in use will be sent.
Would you like to send this error data? (Yes/No/Always) [no]: n
$ # cat /tmp/tmpfzqf2osp/trace.txt 
Traceback (most recent call last):
  File "/snap/snapcraft/2496/legacy_snapcraft/bin/snapcraft", line 11, in <module>
    load_entry_point('snapcraft==2.43.1', 'console_scripts', 'snapcraft')()
  File "/snap/snapcraft/2496/legacy_snapcraft/lib/python3.5/site-packages/click/", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/snap/snapcraft/2496/legacy_snapcraft/lib/python3.5/site-packages/click/", line 697, in main
    rv = self.invoke(ctx)
  File "/snap/snapcraft/2496/legacy_snapcraft/lib/python3.5/site-packages/click/", line 1043, in invoke
    return Command.invoke(self, ctx)
  File "/snap/snapcraft/2496/legacy_snapcraft/lib/python3.5/site-packages/click/", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)

It says 3.1, and loads legacy_snapcraft 2.43.1.

I didn’t include actual error at the end, because it is fixed in 3.1 in Legacy version tries to create snap/.snapcraft and it fails in my case, because I run snapcraft on r/o volume to test Out-of-tree builds with snapcraft,

All the fixes mentioned apply to when the base keyword is being used, unless they have a 2.44 milestone task attached to them.

snapcraft could be more explicit when falling back to old codebase.

1 Like