Some times snapcrafting is frustrating 🤯 Let's make it better!

Hi, I’m very happy with what snaps offer, but working on them is often very frustrating.

Many of the pain points amount to the documentation, which is sometimes incomplete or outdated. Also, there are many approaches, and this further complicates both reading and maintaining the docs.

Sorry for the rant, but I’m really trying to enhance a snap of mine, but so far I could only report bugs… (And not everything is due to Snapcraft/Canonical, like the Travis issue, but many things indeed are)

I began reaching the tutorial page, which for some reason only lists six tutorials. I remember there were more in the past, but maybe some have been deprecated, I don’t know. Nevertheless, I chose Continuous snap delivery from Travis CI. I follow the tutorial, only running the commands that are needed to enable CI on my snap.

At step 5 it’s suggested to use snapcraft enable-ci travis, but it turns out no such option exists (bug). :hushed:

So I think I will just try first to package it locally and leave the travis integration for later. Hence I run the snapcraft command:

$ snapcraft
Support for 'multipass' needs to be set up. Would you like to do it now? [y/N]: y
multipass 1.5.0 from Canonical✓ installed
Waiting for multipass...
Launching a VM.
Build environment is in unknown state, cleaning first.
delete failed: The following errors occurred:
instance "snapcraft-folding-at-home-fcole90" does not exist
An error occurred with the instance when trying to delete with 'multipass': returned exit code 2.
Ensure that 'multipass' is setup correctly and try again.

So it failed… :face_with_head_bandage: Running it again, magically fixed the issue. (bug) :astonished:

Later I discover that travis is available also as a snap, so I install it but it reports:

$ travis
Outdated CLI version, run `gem install travis`.

So I file a bug also to Travis.

I notice that they bump manually the Gemfile to refer to the latest version, which they likely forgot to do on the snap. So I think if there is a way to run some script to get such information. I remember that there is a thing called Scriptlets, so I think if it can work here. I go to check the docs, but I don’t find them mentioned anywhere. I’m surprised! So I google them and I find them. I report yet another bug. :sweat:

Why this post?

Because papercuts happen, but this feels like someone forgot bear traps on a garden and then invited me for a barbeque :face_with_head_bandage::dizzy_face::exploding_head:

I think something went wrong with the developers onboarding strategy, but I can’t say where did it start :confused: I can only say that while I like the snaps concept, I feel the creation process to be very cumbersome, heavy on resources (Multipass), and generally frustrating.

Bring back the fun

I think programming and creating stuff is really fun, and I think also snapcrafting could be much more engaging… Please, make this happen and we (developers) will make many snaps


New issue

Sorry, an error occurred in Snapcraft:
Failed to reuse files from previous run: The 'pull' step of 'travis' is out of date:
The source has changed on disk.
To continue, clean that part's 'pull' step by running `snapcraft clean travis -s pull`.

Which is an appropriate error so far, but

$ snapcraft clean travis -s pull
Usage: snapcraft clean [OPTIONS] <part>...
Try "snapcraft clean -h" for help.

Error: no such option: -s

So the suggestion was wrong :man_facepalming::woman_facepalming:

I ended up cleaning everything: snapcraft clean

The Travis doc could use some love. It’s outdated and feels convoluted. Nowadays, people seem to mostly use the LXD build option or destructive mode on Travis.

I think the documentation in general needs some love :slight_smile: It’s often sparse, refers to links which sometimes are outdated and so on. I think especially in the past it has been challenging, with Snapcraft being such a moving target. But now many things settled down, and I think some coherent guide from zero to hero could be very helpful :smiley:

About the most common method, I don’t know what it is, if LXD, Multipass, Docker or what, that’s quite challenging to follow so many things, and you also need to know a bit of each :dizzy_face:

I’ve seen that before and it’s a bit tough to reproduce - but I believe I sorted it out. A fix PR is up:

1 Like

Which version of snapcraft are you running? That’s a really old error…

1 Like

Hi, and thanks for taking care of such issues :slight_smile:

My version is snapcraft, version 4.4.2 :slight_smile:

I think also this (no destructive mode) is an old error :confused:

Oh! Your snapcraft.yaml must not specify a base!!

You should be seeing a warning like: This snapcraft project does not specify the base keyword, explicitly setting the base keyword enables the latest snapcraft features.

When run against an old snapcraft.yaml format (without a base), it runs in legacy mode which effectively falls back to an old version of snapcraft and would explain your errors. I should have thought of that before… :man_facepalming:

1 Like

Oh I get it :sweat_smile: well, at least I’m happy we discussed my weird adventure so that things can get fixed and be better for new people to come :blush:

1 Like