I have successfully created and uploaded a snap package (the tutorials are great). However, I am left wondering what exactly happens during each of the build steps and how I might take advantage of them.
The process seems to be pull -> build -> stage -> prime -> snap.
By my observation, it appears "pull" puts files in the parts/<part name>/src/ folder, "build" puts files in the parts/<part name>/build/ folder, "stage" puts files in the stage/ folder and "prime" puts files in the prime/ and parts/<part name>/install/ folder.
As a novice, I would tell you I start with a snapcraft.yaml file, I call snapcraft and I get a snap; a one step process. I know each "part" has a stage: and prime: section, but I don't know how or why to take advantage of these steps. The only thing I have found useful is install: along with $SNAPCRAFT_PART_INSTALL environment variable available to the snapcraft.yaml file.
What do the stage: and prime: sections allow me to do that can't achieve with install: and $SNAPCRAFT_PART_INSTALL?