$ 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.
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.
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.
$ 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)
...