← Back to issue list

part `build-snaps` channel change doesn't work without a `clean`

View original Github issue

Metadata

Project
craft-parts
Number
#496
Type
issue
State
open
Author
jugmac00
Labels
Status: Triaged Type: Bug
Created
Updated
Closed

Current evaluation

Changing the build-snaps channel in charmcraft.yaml is ignored on subsequent charmcraft pack runs unless a clean is performed first. Triaged as a craft-parts bug (snap not refreshed when channel changes); transferred to craft-parts with a related charmcraft hotfix bug.

Suggested action: keep open

Reason: Maintainer @lengau confirmed this is a real bug in craft-parts and transferred it there, and a Jira ticket (CRAFT-5269) was created 47 days ago, so it is triaged and actively tracked. The root cause is visible in craft_parts/packages/snaps.py install_snaps(), which only calls snap_pkg.install() when the snap is not installed and never refreshes an already-installed snap to a new channel — matching the 'do not refresh already installed snaps' behavior from commit 4c8c41cc. It should stay open until the channel-change refresh logic is implemented.

Impact: 55 Quick Win: 24.75 Staleness: 45 Complexity: 55 Confidence: 70 Support Request: 5

Issue body

### Bug Description In my `charmcraft.yaml` file I updated the charm version via the `build-snaps` directive, and then a `charmcraft pack` but the changes were not reflected, ie no new charm version was installed. Only when I ran `charmcraft clean` and another `charmcraft pack` it worked as intended and used the new charm version from the `charmcraft.yaml` configuration. ### To Reproduce - create a simple `charmcraft.yaml` with e.g. `build-snaps: [charm/2.x/stable]` - run `charmcraft pack` (which creates a container) - update `charmcraft.yaml` to `build-snaps: [charm]` - run `charmcraft pack` - the new charm version is not used (I noticed that as I added an option which is only available with the new charm version). ### Environment - Ubuntu 20.04 - charmcraft -> version 2.3.0 - using lxd containers ### charmcraft.yaml ```shell see above ``` ### Relevant log output ```shell none ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 55
Quick Win: 24.75
Staleness: 45
Complexity: 55
Confidence: 70
Support Request: 5
keep open Changing the build-snaps channel in charmcraft.yaml is ignored on subsequent charmcraft pack runs unless a clean is performed first. Triaged as a craft-parts bug (snap not refreshed when channel changes); transferred to craft-parts with a related charmcraft hotfix bug.
qwen/qwen3.6-35b-a3b
Staleness: 75
Complexity: 35
Confidence: 85
Support Request: 5
keep open Changing build-snaps channel in charmcraft.yaml doesn't take effect without running clean first. Triaged and identified as a craft-parts dependency bug with an internal ticket created.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 40
Confidence: 85
Support Request: 10
close stale Updating build-snaps channel in charmcraft.yaml requires a clean to take effect. Maintainer noted it belongs in craft-parts and transferred it in July 2023.
qwen3.6-35b-a3b-mtp-q6
Staleness: 90
Complexity: 40
Confidence: 85
Support Request: 10
close stale Updating the build-snaps channel in charmcraft.yaml fails to apply without a manual clean. Likely a craft-parts library bug. Awaiting transfer to craft-parts and creation of a related charmcraft issue to track the hotfix.

Update history

No update history recorded yet.

Related work

  • Caused By: craft-parts#161 (confidence 60%)

    PR #161 (commit 4c8c41cc 'snap: do not refresh already installed snaps') introduced the skip-refresh behavior that causes a changed channel to be ignored when the snap is already installed.

Related issues

Issue Project State Summary Similarity
#1160 `charmcraft pack` does not recognize updated `charmcraft.yaml` file charmcraft open charmcraft pack ignores updated build-snaps channel in charmcraft.yaml without a clean; tracked as a craft-parts bug (canonical/craft-parts#496, still open) awaiting a dependency patch release to pull into charmcraft.
79%
#5734 Modifying a build-snap doesn't trigger a change snapcraft open Changing a build-snap channel (e.g. node/12/stable to node/18/stable) does not trigger a rebuild of the part in snapcraft 8.11.1. A maintainer commented that craft-parts should be tracking this, but the issue remains open with no fix or follow-up.
73%