← Back to issue list

Content interface mount targets are not created during build for snaps using base core26+ or bare

View original Github issue

Metadata

Project
snapcraft
Number
#6122
Type
issue
State
closed
Author
bboozzoo
Labels
Status: Triaged Type: Enhancement
Created
Updated
Closed

Current evaluation

Resolved by merged PR #6199 (611e80513), which pre-creates content-plug and layout mount targets for core26+ and bare-base snaps during packing.

Resolution: closed resolved

Reason: PR #6199 was merged in commit 611e80513 and implemented target creation during packing, closing #6122. Follow-up PR #6222, commit 333ac0e0b, refined the behavior to pre-create only content-plug targets.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Check existing issues - [x] I've verified that this request isn't described by any existing issues. ### Request We have an ongoing effort in snapd to make the handling of snap mount namespaces more robust. This includes ways for simplifying the hierarchy of mounts that are required in order to produce the world view that the snap declared in its snap.yaml. A dedicated piece of snapd - snap-update-ns - is ultimately responsible for making this happen and it does it by various combinations of tmpfs/bind mounts/and mock paths that serve as mount points. Specifically, in the context of this request, in situations when a target of a content mount does not exist e.g. `$SNAP/target`, s-u-n will do the following (simplified): - create a tmpfs on the side - bind mount everything from under the original `$SNAP` location - mkdir `target` - bind mount the temporary directory back onto `$SNAP` This nicely illustrates the additional complexity which could be entirely avoided should `$SNAP/target` already exist inside the squashfs blob. Things only get more complicated form here where the snap adds `layout` on top, or the content provider snap is refreshed. Since the ultimate goal is to make things simpler, easier to set up, debug and reason about we, on the snapd side, are considering making the presence of `content` interface `target` location presence mandatory for snaps using base core26 and later. I have a draft PR in snapd https://github.com/canonical/snapd/pull/16828 which adds the code to enforce this. Let's discuss whether snapcraft could make this transition simpler by ensuring that the directories are created at build time. ### The problem it solves Simplifies steps needed to create the mount setup requested by a snap and thus helps snapd with making snap mount namespaces more robust.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Resolved by merged PR #6199 (611e80513), which pre-creates content-plug and layout mount targets for core26+ and bare-base snaps during packing.
stealth/space-bunny-alpha — closed resolved Implemented in PR #6199 (611e80513): core26+ and bare-base snaps now precreate content-plug and layout mount targets during packing. PR #6222 refined plug handling.
qwen/qwen3.6-35b-a3b — — Closed without implementation. The enhancement to have snapcraft create content interface mount targets at build time was discussed, and a Jira ticket (SNAPCRAFT-1330) was created for tracking, but no code changes were merged.
qwen/qwen3.6-35b-a3b — — Closed and deferred to internal tracking (SNAPCRAFT-1330). The enhancement was not implemented.
qwen/qwen3.6-35b-a3b — — Closed as an enhancement request. Logged as internal ticket SNAPCRAFT-1330. No implementation was provided, leaving the proposal to create mount targets at build time unaddressed.
qwen3.6-35b-a3b-mtp-q6 — — Closed and linked to internal ticket SNAPCRAFT-1330. The enhancement was abandoned without implementation or merge.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/snapcraft#6199 (confidence 100%)

    Merged implementation that pre-creates plug and layout files while packing core26+ snaps and closes #6122.

  • Likely Fixed By: canonical/snapcraft#6222 (confidence 100%)

    Merged follow-up limiting pre-creation to content plug targets and avoiding errors for private-only plug definitions.

  • Related To: snapd#16828 (confidence 90%)

    The snapd-side enforcement draft cited in the issue, providing related context for requiring mount targets.

Related issues

No related issues found above the similarity threshold.