snapcraft icon indicating copy to clipboard operation
snapcraft copied to clipboard

Support a `-f|--file` or `-C|--directory` flag

Open dilyn-corner opened this issue 4 months ago • 4 comments

What needs to get done

Add a flag to the snapcraft <pull|build|stage|prime|pack> subcommands which enables a user to specify the precise snapcraft.yaml file to use for a build or the directory in which one could be found.

Why it needs to get done

This does two things:

  1. Aligns snapcraft with many other build system tools, such as make, cmake, or meson

  2. enable a single source-tree to potentially provide multiple variant builds of that source as slightly different snaps, without requiring entirely different snap packaging trees.

The second point is especially useful in the context of a monolithic snap project repository such as this, and in fact would be exceptionally useful for things like building Canonical kernel snaps (which already have a predilection for using things like a debian.<flavour> directory for these kinds of things). In short, it makes things like derivative kernels (or derivative "snaps", if there is such a concept) far easier to maintain and build.

dilyn-corner avatar Aug 07 '25 20:08 dilyn-corner