Iterating on a skeleton snap with 'snap try'
Mark Shuttleworth
mark at ubuntu.com
Fri Jul 8 08:31:16 UTC 2016
There was a question on AskUbuntu today [0] about rapid iteration on
snaps, avoiding the squashfs compression and remounting.
As Daniel answered, this is what 'snap try' is for.
A snap is a filesystem that is mounted so it looks like a directory with
all of the app files (and dependencies etc) underneath a single
directory. 'snap try' lets you actually use a normal directory as a
snap. So you make a directory, put all the bits in that directory, then
'try' it. Now you can edit the snap directly just by changing things in
that directory, live, and see the immediate consequences of those changes.
I wonder if we shouldn't have a "sample snap" directory which snapcraft
can create, to walk people through this?
Something like:
$ snapcraft try-example
Unpacking into ./try-example/ ... Now you can 'snap try ./try-example'
After the 'snap try' command, the directory is mounted as a snap.
You can edit the contents of the try-example/ directory to live-edit the
try-example snap. Start with 'snap list' and the 'try-example' command.
I think all we need is a patch to snapcraft which includes the try-example
snap contents and that error message, and some checking to make sure we can
write the directory and are not over-writing a directory.
Thoughts? Anybody want to have a go at that?
NB there is currently a bug in snapd if you *remove* the directory while
'try'ing it, to be fixed in the next release.
Mark
[0]
http://askubuntu.com/questions/795882/how-can-i-iterate-more-quickly-when-creating-a-snap
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20160708/c61d37cf/attachment.html>
More information about the Snapcraft
mailing list