← Back to issue list

Install snapd from a user-defined channel

View original Github issue

Metadata

Project
craft-providers
Number
#946
Type
issue
State
open
Author
mr-cal
Labels
Type: Enhancement Status: Triaged
Created
Updated
Closed
—

Current evaluation

Triaged enhancement to honor CRAFT_SNAPD_CHANNEL by refreshing and tracking snapd; current code still apt-installs snapd, and snapd injection was suggested.

Suggested action: keep open

Reason: Current source has no CRAFT_SNAPD_CHANNEL reference, _post_setup_snapd only enables snapd, holds refreshes, and configures the proxy, while snap_installer records a snap only after its install/refresh path. The maintainer acknowledged snapd injection as a useful possible approach, so the issue remains valid and triaged, but implementation scope needs a final choice between explicit refresh and injection.

Evaluated by: mr-cal-bot

Impact: 45 Quick Win: 19 Complexity: 45 Confidence: 92 Actionability: 77

Issue body

### What needs to get done 1. In [`post_setup_snapd()`](https://github.com/canonical/craft-providers/blob/2f2d4ddb17a798616d0e3a061fefdd6bdb486f86/craft_providers/base.py#L909), refresh snapd using the environment variable `CRAFT_SNAPD_CHANNEL` 2. Record snapd in the instance configuration (like [this](https://github.com/canonical/craft-providers/blob/2f2d4ddb17a798616d0e3a061fefdd6bdb486f86/craft_providers/actions/snap_installer.py#L497)). This change would allow downstream apps to install a particular channel of snapd. ### Why it needs to get done Because there is no way to install snapd from a particular channel. It gets silently ignored if you provide it to the base [here](https://github.com/canonical/craft-providers/blob/2f2d4ddb17a798616d0e3a061fefdd6bdb486f86/craft_providers/base.py#L116). ### Current behavior If you add snapd as a snap to install with a particular channel, that channel doesn't get used. Here's what happens: 1. Snapd is installed as an [apt package](https://github.com/canonical/craft-providers/blob/2f2d4ddb17a798616d0e3a061fefdd6bdb486f86/craft_providers/bases/ubuntu.py#L432), which bootstraps and installs itself as a snap. 2. Snapd isn't recorded in the InstanceConfig as an installed snap ([unlike other snaps](https://github.com/canonical/craft-providers/blob/2f2d4ddb17a798616d0e3a061fefdd6bdb486f86/craft_providers/actions/snap_installer.py#L497)). 3. When the snap_installer tries to install snapd from a particular branch, it runs `snap install` instead of `snap refresh` 4. `snap install` no-ops and returns a 0 exit-code 5. The custom channel of snapd isn't installed

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 45
Quick Win: 19
Complexity: 45
Confidence: 92
Actionability: 77
keep open Triaged enhancement to honor CRAFT_SNAPD_CHANNEL by refreshing and tracking snapd; current code still apt-installs snapd, and snapd injection was suggested.
stealth/space-bunny-alpha
Impact: 62
Quick Win: 29
Complexity: 44
Confidence: 94
Actionability: 84
keep open Enhancement to honor CRAFT_SNAPD_CHANNEL by refreshing snapd and recording it in InstanceConfiguration; it remains open and current code still apt-installs snapd without that support.
stealth/space-bunny-alpha
Impact: 45
Quick Win: 11
Complexity: 55
Confidence: 78
Actionability: 55
keep open Triaged enhancement to let downstream apps install snapd from a chosen channel via CRAFT_SNAPD_CHANNEL. No such env var exists in the code; ubuntu.py still apt-installs snapd and never records it in InstanceConfiguration, so a requested snapd channel is silently ignored.
stealth/space-bunny-alpha
Impact: 50
Quick Win: 29
Complexity: 30
Confidence: 96
Actionability: 82
keep open Triaged enhancement to honor CRAFT_SNAPD_CHANNEL by refreshing snapd and recording it in the instance config. Maintainers acknowledge it, but current code still apt-installs snapd; the broader snapd-injection option remains exploratory.
qwen3.6-35b-a3b-mtp-q6
Impact: 30
Quick Win: 18
Staleness: 45
Complexity: 40
Confidence: 75
Support Request: 10
keep open Enhancement to allow installing snapd from a user-defined channel via CRAFT_SNAPD_CHANNEL env var. Triaged, under maintainer discussion.
qwen/qwen3.6-35b-a3b
Staleness: 45
Complexity: 30
Confidence: 85
Support Request: 0
keep open Feature request to install snapd from a user-defined channel via environment variable. Custom channels are currently ignored. Maintainers are discussing implementation details. Status: Triaged, under discussion.
qwen3.6-35b-a3b-mtp-q6
Staleness: 45
Complexity: 55
Confidence: 85
Support Request: 10
keep open Enhancement to allow installing snapd from a user-defined channel via environment variable. Currently ignored due to apt installation and snap install no-op. Triaged, with maintainers discussing a snap injection approach.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.