← Back to issue list

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

View original Github issue

Metadata

Project
snapcraft
Number
#5684
Type
issue
State
open
Author
dilyn-corner
Labels
Type: Enhancement
Created
2025-08-07 20:15:03+00:00
Updated
2025-08-12 13:39:31+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

### 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](https://github.com/canonical/iot-field-kernel-snap), 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.

Evaluation history

No evaluation history available.