← 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
Updated
Closed

Current evaluation

Feature request to add a -f/--file or -C/--directory flag to snapcraft lifecycle subcommands so users can specify an alternate snapcraft.yaml or project directory, enabling monorepo/variant builds. Maintainers discussed it in Aug 2025, noting snapcraft pack dir/ currently packs a directory (unhelpful) and that removing that behavior is a candidate for Snapcraft 9.

Suggested action: keep open

Reason: Maintainers actively engaged in Aug 2025: @mr-cal flagged it as a candidate for Snapcraft 9 and noted @sergiusens suggested removing the confusing `snapcraft pack dir/` behavior, with a plan to notify goreleaser. The feature is not implemented (no --file/--directory flag in the codebase), and it's a well-scoped enhancement with clear rationale for monorepo support.

Impact: 55 Quick Win: 16.5 Staleness: 35 Complexity: 70 Confidence: 75 Support Request: 10

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

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 55
Quick Win: 16.5
Staleness: 35
Complexity: 70
Confidence: 75
Support Request: 10
keep open Feature request to add a -f/--file or -C/--directory flag to snapcraft lifecycle subcommands so users can specify an alternate snapcraft.yaml or project directory, enabling monorepo/variant builds. Maintainers discussed it in Aug 2025, noting snapcraft pack dir/ currently packs a directory (unhelpful) and that removing that behavior is a candidate for Snapcraft 9.
qwen/qwen3.6-35b-a3b
Staleness: 60
Complexity: 40
Confidence: 75
Support Request: 10
keep open Enhancement to add -f/-C flags for specifying snapcraft.yaml or build directory. Maintainer acknowledged as a Snapcraft 9 candidate, but remains unassigned and inactive for over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 45
Complexity: 35
Confidence: 85
Support Request: 10
keep open Enhancement request to add -f/--file or -C/--directory flags to snapcraft subcommands for mono-repo and variant builds. Maintainers acknowledge the need and suggest it for Snapcraft 9.
qwen3.6-35b-a3b-mtp-q6
Staleness: 68
Complexity: 20
Confidence: 85
Support Request: 0
keep open Proposes -f or -C flags for snapcraft commands to specify build configs or directories, enabling mono-repo support. Currently under discussion as a Snapcraft 9 candidate, with recent comments debating existing directory handling behavior.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.