Allow pinning a source archive
Metadata
Current evaluation
APT pinning for the Ubuntu Touch overlay is now implemented via package-repositories priority, with craft-archives writing preferences and spread tests covering a PPA; this old request is resolved.
Suggested action: close resolved
Reason: Snapcraft now supports package-repositories with an APT priority; the test-pin spread fixture verifies a PPA is selected at priority 999, and unit tests exercise AptPreferencesManager.write. The package-repository integration landed in commit 4104923f9, with craft-archives support and tests updated in 71ed1a369, so the requested pinning capability is present.
Evaluated by: mr-cal-bot
Impact:
52
Quick Win:
23
Complexity:
48
Confidence:
97
Actionability:
86
Issue body
== The use case ==
I'm building a unity8 snap that includes a lot of the Ubuntu Touch project built into it (unity8, indicators, a whole upstart & dbus session, etc). So when building a snap (locally and in LP), we use the standard Touch overlay archive on top of xenial. For reference, the Touch overlay archive is ppa:ci-train-ppa-service/stable-phone-overlay.
But unfortunately due to a lack of manpower, the overlay archive can drift out of sync with xenial-updates for a while and versions in the overlay get hidden by higher versions in -updates. Until someone merges the new release into the overlay again.
Traditionally, our solution for that is to build Ubuntu Touch images with the overlay archive pinned above the base archives. I believe this is done directly in livecd-rootfs today.
So when building a snap, we can tell all our developers to pin the archive. But that's a bit of a pain (and easy to forget, which leads to subtle bugs later). And LP does not let us pin an archive, so any snaps LP builds will have those same subtle bugs [1].
I asked for LP to offer pinning as part of a snap recipe (bug 1646139), but Colin suggested that I first try to see if snapcraft itself is interested in offering pinning support.
Note that this issue affects any snap that bases itself off the Touch overlay. So not only unity8, but probably also all our core unity8 apps. And third-parties might have similar issues.
[1] As an example of such a bug, ALSA doesn't work in the LP-built snaps because of a mismatched gstreamers plugin package when pinning isn't done.
== The ask ==
One thing I imagine that snapcraft could do is allow a plugin to specify apt preferences.d modifications, much like it allows a plugin to specify PLUGIN_STAGE_SOURCES. And then use those preferences for build-packages and stage-packages.
But maybe you all have better ideas. Or would prefer to avoid getting in this mess altogether.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha |
Impact:
52
Quick Win:
23
Complexity:
48
Confidence:
97
Actionability:
86
|
close resolved | APT pinning for the Ubuntu Touch overlay is now implemented via package-repositories priority, with craft-archives writing preferences and spread tests covering a PPA; this old request is resolved. | |
| qwen/qwen3.6-35b-a3b |
Impact:
35
Quick Win:
14
Complexity:
35
Confidence:
70
Actionability:
60
|
needs triage | Feature request to expose apt pinning (preferences.d) in snapcraft for users building snaps with overlay archives like Ubuntu Touch. Underlying craft-archives library already supports this. | |
| qwen/qwen3.8-27b |
Impact:
35
Quick Win:
16
Staleness:
95
Complexity:
55
Confidence:
68
Support Request:
25
|
close stale | Feature request (2017) to let snapcraft pin apt source archives (e.g., the Touch overlay PPA above xenial-updates) via preferences.d, to avoid version drift in LP-built Touch snaps. No maintainer response; the xenial/Touch-overlay context is obsolete. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
98
Complexity:
30
Confidence:
90
Support Request:
10
|
close stale | Feature request to allow snapcraft plugins to specify apt preferences.d modifications for archive pinning. No maintainer response or activity for over nine years; request is now irrelevant. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
98
Complexity:
35
Confidence:
90
Support Request:
10
|
close stale | Request to allow snapcraft plugins to specify apt preferences.d modifications for pinning source archives. Untriaged, zero maintainer interaction, inactive for over 9 years. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
98
Complexity:
45
Confidence:
88
Support Request:
15
|
close stale | Feature request to allow Snapcraft plugins to specify APT source pinning. Open for over 9 years with zero maintainer interaction. The referenced Ubuntu Touch overlay workflow is likely obsolete, making this request irrelevant to current Snapcraft versions. |
Update history
| Date | Change |
|---|---|
| created |
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #40 apt: add apt pinning support | craft-archives | merged | Merged into main as commit 4729424 (March 2023), adding APT pinning via a new AptPreferencesManager that parses and writes apt preferences pin/priority entries (CRAFT-1645). |