Skip to content

fix: set libvirt runstatedir for snap confinement#181

Closed
MylesJP wants to merge 1 commit into
canonical:mainfrom
MylesJP:fix/libvirt
Closed

fix: set libvirt runstatedir for snap confinement#181
MylesJP wants to merge 1 commit into
canonical:mainfrom
MylesJP:fix/libvirt

Conversation

@MylesJP
Copy link
Copy Markdown

@MylesJP MylesJP commented May 6, 2026

Pin libvirt's runstatedir to $SNAP_COMMON/run so libvirtd can write its sockets under strict confinement (libvirt 11+ no longer derives it from localstatedir). Add python3-venv and meson to qemu's stage-packages so its mkvenv satisfies ensurepip and the pinned meson, and stage-filter them out of the final snap to avoid a python3.14 stdlib clash with the openstack-hypervisor part.

Pin libvirt's runstatedir to $SNAP_COMMON/run so libvirtd can write
its sockets under strict confinement (libvirt 11+ no longer derives
it from localstatedir). Add python3-venv and meson to qemu's
stage-packages so its mkvenv satisfies ensurepip and the pinned
meson, and stage-filter them out of the final snap to avoid a
python3.14 stdlib clash with the openstack-hypervisor part.

Signed-off-by: Myles Penner <myles.penner@canonical.com>
Copy link
Copy Markdown
Collaborator

@gboutry gboutry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I get why we're getting python3-venv / meson into the runtime state?

Can't we have them just as build dependencies?

@MylesJP
Copy link
Copy Markdown
Author

MylesJP commented May 7, 2026

I'm not sure I get why we're getting python3-venv / meson into the runtime state?

Can't we have them just as build dependencies?

Tried that first and it doesn't work. qemu's configure uses the install-tree python (parts/qemu/install/usr/bin/python3.14), not the system one, so build-packages aren't on its import path and mkvenv fails (ensurepip missing, then meson==1.9.0 missing offline).

Stage-packages put them where qemu actually looks. The stage: filter at the top of the part drops python3.14, python3, and meson from the final snap, so they're build-only in effect.

Comment thread snap/snapcraft.yaml
plugin: autotools
stage:
# python3.14 / meson are pulled in only to satisfy qemu's mkvenv during
# configure; the openstack-hypervisor part ships python at runtime, so
Copy link
Copy Markdown
Collaborator

@gboutry gboutry May 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the configure in this comment? the configure hook of the snap or the configure step of the C build?

@gboutry gboutry mentioned this pull request May 19, 2026
@gboutry
Copy link
Copy Markdown
Collaborator

gboutry commented May 19, 2026

Superseded by: #182

@gboutry gboutry closed this May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants