Should I refresh my snap


#1

Hi, all.

I created a snap last December. It was mainly an experiment to see if someone without programming experience could successfully create a snap. (The answer is yes, if it is a simple program.)

My question is: are there any benefits to recreating the snap with the latest snapcraft software besides getting an updated version of the program I’m snapping? To be clear, I’d just grab the yaml file and run ‘snapcraft’ again.

Thanks and keep up the great work.


#2

You’ll also get updated versions of all the dependencies of your program (for example Python itself). Ubuntu constantly receives security fixes, but unless you re-run snapcraft, your application won’t get these fixes.

Note: If you use build.snapcraft.io, you’ll actually get notifications when dependencies of your application receive security updates.


#3

The snap publisher email should receive these notifications even if you don’t use build.snapcraft.io, just FYI


#4

Can I used build.snapcraft if all I created is the snapcraft.yaml file? I am snapping someone else’s app.


#5

That should work. Your snapcraft.yaml file contains this:

parts:
  dosage:
    source: https://github.com/webcomics/dosage.git

Snapcraft will clone the https://github.com/webcomics/dosage.git for you and build the actual application from that. As long as the source is publicly accessible, of course.


#6

Just a small clarification. This is true generally, but isn’t Python shipped in the core snap? In either case, any dependencies that are pulled from the base snap will be updated when that base is updated on the device where the snap is installed. So you do not need to rebuild your snap to get those updates.


#7

I was able to setup it up. According to the build page, amd64 and i386 built successfully. However, s390x, ppc64el, arm64, and armhf failed to build. It looks like the build system thinks the build failed because those three architectures failed. Is there anyway to limit the build to only amd64 and i386?


#8

Good question! I think this might help you: https://snapcraft.io/docs/architectures

Although the snaps for the architectures that succeeded should be pushed to the edge channel, I think.

$ snap info dosage
name:      dosage
summary:   dosage is a comic strip downloader and archiver
publisher: John Paul Wohlscheid (johnblood378)
contact:   https://github.com/JohnBlood/dosage
license:   MIT
description: |
  This is not an official snap.
  
  Dosage is designed to keep a local copy of specific webcomics and other
  picture-based content such as Picture of the Day sites. With the dosage
  command line script you can get the latest strip of a webcomic, or catch-up
  to the last strip downloaded, or download a strip for a particular
  date/index (if the webcomic's site layout allows this).
  
  For advanced options and features execute `dosage --help`.
snap-id: ZIycqrKDoEOJicp3hwaAvMyvN1vZxMkC
channels:
  stable:    2.15+git 2018-12-20 (1) 14MB -
  candidate: 2.15+git 2018-12-20 (1) 14MB -
  beta:      ↑                            
  edge:      2.15+git 2019-09-04 (5) 14MB -

could it be that revision 5 is the one that just built?


#9

Yes, put this in your snapcraft.yaml:

architectures:
  - build-on: amd64
  - build-on: i386

#10

Isn’t this dependent on setting SNAPCRAFT_BUILD_INFO=1 for the build? Without it, the snap won’t contain snap/manifest.yaml, which means those tools won’t know the versions of any staged .deb packages in the snap.


#11

Yes, that’s true, sorry I had forgotten that env var wasn’t used by default with snapcraft…


#12

I just got an email that some of the packags included in my snap needed to be updated. All of them have python in the name.


#13

those will be in response to USN 4127-1:

https://usn.ubuntu.com/4127-1/


#14

@daniel
Yes, I mentioned it because @ryanjyoder didn’t thing I would get a notification about an out of date python because he thought python came bundled with the core snap.


#15

I noticed that the snap that the build server creates is put in the edge channel. How do I move it to stable once testing is complete?


#16

You can publish it to a different channel with either the CLI (snapcraft release $SNAPNAME $BUILD_NUMBER $CHANNEL) or the dashboard at https://snapcraft.io/snaps