bases: disable automatic snap refreshes
Metadata
Current evaluation
Merged PR #182 (commit 562257a, CRAFT-1518) disables automatic snap refreshes in build providers by running `snap set system refresh.hold=24h` during setup() and warmup(), fixing #174 and LP#1998100.
Resolution: closed resolved
Reason: PR #182 was approved and merged into craft-providers as commit 562257a, implementing the fix for #174. Follow-up issue #184 tracked switching to the more efficient `snap refresh --hold`, later implemented in craft-providers 1.15.0 by commit 09ef06f.
Evaluated by: mr-cal-bot
No scores available.
Issue body
- [X] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
-----
## Overview
Craft-providers manages the installation and versions of snaps inside the build environment, so automatic refreshes of snaps by snapd are disabled.
## Details
This functionality was imported from [snapcraft core18|20](https://github.com/snapcore/snapcraft/blob/31a3990c8f42eb27c326e42b7a79619996ab456d/snapcraft_legacy/internal/build_providers/_snap.py#L330).
This PR uses the command `snap set system refresh.hold=<24h>` during every `setup()` and `warmup()` call.
It would be more efficient to run [`snap refresh --hold`](https://snapcraft.io/blog/hold-your-horses-i-mean-snaps-new-feature-lets-you-stop-snap-updates-for-as-long-as-you-need) once during `setup()`. However, this feature of snapd is not yet stable. Once it becomes stable, craft-providers should use this command instead. I added a TODO to the code and created https://github.com/canonical/craft-providers/issues/184.
Resolves https://github.com/canonical/craft-providers/issues/174 and https://bugs.launchpad.net/snapcraft/+bug/1998100.
(CRAFT-1518)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #182 (commit 562257a, CRAFT-1518) disables automatic snap refreshes in build providers by running `snap set system refresh.hold=24h` during setup() and warmup(), fixing #174 and LP#1998100. | |
| qwen/qwen3.6-35b-a3b | — | closed resolved | Merged PR disabling automatic snap refreshes in craft-providers by setting refresh.hold during setup and warmup, resolving #174. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Duplicate Of:
canonical/craft-providers#174
(confidence 97%)
PR body explicitly states it resolves #174 ('Refreshing during injection').
-
Superseded By:
canonical/craft-providers#184
(confidence 85%)
Follow-up TODO issue; closed when `snap refresh --hold` was adopted in 1.15.0 via commit 09ef06f, replacing the repeated refresh.hold workaround.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3102 build providers: prevent snap refreshing in build environment | snapcraft | merged | Merged PR #3102 as commit 2ff9fcd10, adding a one-day refresh hold for installed snaps to prevent automatic refreshes in build environments. | |
| #382 bases: use `snap refresh --hold` | craft-providers | merged | Merged PR #382 by mr-cal: replaces `snap set system refresh.hold` with `snap refresh --hold`, restores pre-1.13.0 behaviour of running snapd calls only in setup (not warmup), and bumps the compatibility tag. Landed as commit 09ef06f. | |
| #2507 build providers: improve handling in snap logic | snapcraft | merged | Merged snapcraft#2507 as commit 841b41fa3, improving build-provider snap logic, removing unnecessary sudo calls, and silencing refresh-hold noise. | |
| #184 Use `snap refresh --hold` | craft-providers | closed | craft-providers 1.15.0 adopted `snap refresh --hold` during setup instead of repeatedly setting refresh.hold; fixed by commit 09ef06f. |