What is the (pragmatic) difference between stage: and prime:?

In terms of file exclusion, I realize that you can use per-part “stage:” to identify content to not copy from that part to stage/; similarly, you can define “prime:” to identify content to exclude per-part from being copied from stage/ to prime/. But based on my testing, I see no practical difference in deferring file exclusion to the prime: step when you can do it in stage:.

Am I missing something? What is the possible rationale for including content to be staged, but then excluding it from being primed, unless its purpose is that it’s needed for some other part processing and needs to be in stage/ (at least temporarily)? And if that’s the rationale, what is an obvious use case for it?

ADDENDUM: OK, I just thought of one moderately sane reason to have both stage: and prime:. Given that you can run “snap try” to test a snap given a working directory, perhaps there’s value in having more content in stage/ for just testing, before cleaning stuff up when moving to prime/ when packaging the snap in its final form.

Other than that, I’m still struggling to appreciate the reason for both steps.

1 Like