← Back to issue list

snap: strict -> classic confinement for Charmcraft snap

View original Github issue

Metadata

Project
charmcraft
Number
#288
Type
pull request
State
merged
Author
cjp256
Labels
—
Created
Updated
Closed

Current evaluation

Merged (commit d49e85e3, merge 0d76670a): switched Charmcraft's snap from strict to classic confinement, added a separate part for core20 Python stage packages, and hardcoded bin/python3 to work around a Snapcraft symlink bug.

Resolution: closed resolved

Reason: PR #288 was approved by two reviewers with no unresolved comments and merged into the default branch as 0d76670a, implementing commit d49e85e3 ("snap: strict -> classic confinement for Charmcraft snap", +22/-3 in snap/snapcraft.yaml). The resulting 'confinement: classic' remains in the current snap/snapcraft.yaml, later carried through the core20->core22 (#1321) and core24 (#2412) base migrations.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Classic snaps on core20 require python3. Add this collection of stage packages as its own part to separate stage filtering used in the charmcraft part. There is an apparent bug in Snacpraft where it will set the bin/python3 to an invalid symlink in this scenario. Hardcode the correct symlink until we have a fix in place for Snapcraft. Signed-off-by: Chris Patterson <chris.patterson@canonical.com>

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged (commit d49e85e3, merge 0d76670a): switched Charmcraft's snap from strict to classic confinement, added a separate part for core20 Python stage packages, and hardcoded bin/python3 to work around a Snapcraft symlink bug.
stealth/space-bunny-alpha — closed resolved Merged in canonical/charmcraft#288 (0d76670a): switched the snap to classic confinement, staged Python packages separately, and fixed the python3 symlink.
stealth/space-bunny-alpha — closed resolved Merged #288, changing Charmcraft's snap to classic confinement, adding Python stage packages in a separate part, and hardcoding bin/python3 to avoid a Snapcraft bug.
stealth/space-bunny-alpha — closed resolved PR #288 merged, switching Charmcraft’s snap to classic confinement, adding Python stage packages, and hardcoding bin/python3 around a Snapcraft bug.
stealth/space-bunny-alpha — closed resolved Merged in canonical/charmcraft#288: switched Charmcraft's snap from strict to classic confinement, added Python stage packages, and hardcoded bin/python3 to avoid a Snapcraft bug.
stealth/space-bunny-alpha — closed resolved Merged the Charmcraft snap’s switch to classic confinement, adding core20 stage packages and a hardcoded python3 symlink workaround for Snapcraft.
stealth/space-bunny-alpha — closed resolved Merged in charmcraft#288 (0d76670a): switched the Charmcraft snap to classic confinement, added Python 3 stage packages, and corrected the Python 3 symlink.
stealth/space-bunny-alpha — closed resolved Merged in #288 via d49e85e3 (merge 0d76670a), switching Charmcraft’s snap to classic confinement and adding Python 3 stage packages.
qwen/qwen3.6-35b-a3b — — Merged the change to switch Charmcraft snap confinement from strict to classic. Added python3 stage packages and hardcoded a symlink to bypass a Snapcraft bug. Approved by two reviewers and passed CI.
qwen3.6-35b-a3b-mtp-q6 — — Merged switch to classic confinement for the Charmcraft snap. Added python3 stage packages and hardcoded a symlink workaround to bypass a Snapcraft bug. Approved for release despite initial suggestions to delay for v0.11.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: charmcraft@d49e85e3 (confidence 98%)

    Implementing commit titled 'snap: strict -> classic confinement for Charmcraft snap', authored by cjp256.

  • Related To: canonical/charmcraft#1321 (confidence 55%)

    Later snap base migration from core20 to core22 that builds on this classic-confinement snap definition.

  • Related To: canonical/snapcraft#5407 (confidence 30%)

    Later report of classic-confinement Python snap build/symlink problems on core24 — same Snapcraft pain point the hardcoded bin/python3 here works around.

Related issues

Issue Project State Summary Similarity
#1647422 Support classic confinement snapcraft (launchpad) closed Classic confinement support was implemented and merged in snapcore/snapcraft#946 via commit 97af16ffe, resolving launchpad/snapcraft#1647422.
74%
#946 meta: support classic confinment snapcraft merged Merged snapcraft#946 via commit 97af16ffe added classic confinement metadata support, allowing meta snaps to declare confinement as classic (LP #1647422).
74%
#1654899 snapcraft.yaml syntax docs missing ‘classic’ confinement mode snapcraft (launchpad) open Classic confinement is now documented in the Snapcraft YAML explanation and a dedicated setup guide; the obsolete syntax page was removed in 7c966e0f7 (#1227).
72%
#388 Charmcraft pack cannot run in a CI? charmcraft closed charmcraft's strictly-confined snap blocked CI builds (pip deps install failing). Fixed by switching the snap to classic confinement (PR #288, commit d49e85e3); reporter confirmed the edge classic snap resolved their CI.
72%
#1112 core: setup core to support classic confinement. snapcraft merged Merged PR #1112 (49b39ef9a) added SNAPCRAFT_SETUP_CORE, fetching and unsquashing core into expected paths for classic-confinement builds on non-Snappy CI hosts.
71%
#184 Charmcraft crash when snap is used in /tmp directory charmcraft closed Fixed the /tmp PermissionError by switching the Charmcraft snap from strict to classic confinement in merged PR #288 (d49e85e3, 0d76670a).
71%
#1650946 unhelpful error when building a classic snap: classic confinement requires the core_dynamic_linker to be set snapcraft (launchpad) closed Resolved: the cryptic "classic confinement requires the core_dynamic_linker to be set" error was fixed by snapcore/snapcraft PR #1025 (better diagnostic) and PR #1112 / commit 49b39ef9a, which auto-installs/unpacks the core snap; Launchpad builds snapcraft 2.27+ via LP: #1650946.
70%
#1662351 Support ci builds when classic confinement is set snapcraft (launchpad) closed Classic-confinement CI support was implemented by provisioning the base core in snapcore/snapcraft PR #1112, commit 49b39ef9a.
70%