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
4 Likes
$ 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
/snap/bin/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/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/snap/snapcraft/2496/legacy_snapcraft/lib/python3.5/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/snap/snapcraft/2496/legacy_snapcraft/lib/python3.5/site-packages/click/core.py", line 1043, in invoke
    return Command.invoke(self, ctx)
  File "/snap/snapcraft/2496/legacy_snapcraft/lib/python3.5/site-packages/click/core.py", 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 https://bugs.launchpad.net/snapcraft/+bug/1806746 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