Snapcraft lifecycle


#1

The process of building a snap is made up of running each part through a lifecycle of steps. These steps are, in order:

  1. pull
    Fetch the part’s source, as well as its stage-packages

  2. build
    Build this part (e.g. compile it) and install it to a designated area

  3. stage
    Put the material installed by the build step in the common staging area for potential use by other parts(eg. providing the required library for building it)

  4. prime
    Migrate this part’s staged material into the final priming area

After all of these steps have run for each part, the final step is the pack step, which packs the priming area into the final snap (a squashfs image).


Snapcraft filesets
Snapcraft plugin API
Troubleshoot snap building
Snap documentation
Release notes: Snapcraft 3.0
Iterating over a build
Snapcraft overview
Snapcraft parts metadata
Snapcraft.yaml reference
Defining a command
#2

@Lin-Buo-Ren all those paths are implementation details, I suggest leaving them off or this will easily get out of date.


#3

OK, I’ve now drop the paths.


#4

What is executed during those steps? Where can we override them? Where should I put the build results for different architectures?