Skip to content

cmd/snap, packaging: multi entry binary [WIP]#17145

Draft
bboozzoo wants to merge 26 commits into
canonical:masterfrom
bboozzoo:bboozzoo/multi-call-bin-2026
Draft

cmd/snap, packaging: multi entry binary [WIP]#17145
bboozzoo wants to merge 26 commits into
canonical:masterfrom
bboozzoo:bboozzoo/multi-call-bin-2026

Conversation

@bboozzoo

@bboozzoo bboozzoo commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

This is a draft WIP branch of multi entry snapd binary.

Initial comparison shows that merging the standalone snapd binary into /usr/bin/snap allows us to save ~13% on the size of the snap, 50.5MB -> 44.1MB. The run time savings are likely noticeable as instead of a 31MB (snapd) + 23MB (snap) binaries, we now have a single 33MB (snap) binary, which should help reducing the IO and make better use of the cache.

Related: SNAPDENG-36950

@github-actions github-actions Bot added Needs Documentation -auto- Label automatically added which indicates the change needs documentation Run only one system Only runs spread tests on one system labels Jun 1, 2026
@codecov

codecov Bot commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 46.47887% with 38 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.17%. Comparing base (d5961e4) to head (1e958c1).

Files with missing lines Patch % Lines
cmd/snap/dispatch.go 0.00% 11 Missing ⚠️
snap/quota/resources.go 0.00% 7 Missing ⚠️
image/preseed/preseedtool/preseedtool.go 25.00% 6 Missing ⚠️
overlord/hookstate/hookmgr.go 0.00% 4 Missing and 1 partial ⚠️
cmd/snap/main_snapd.go 0.00% 3 Missing ⚠️
cmd/snap/main_snap_preseed.go 0.00% 2 Missing ⚠️
tests/lib/snapd-standalone/entry.go 0.00% 2 Missing ⚠️
cmd/snap/main.go 0.00% 1 Missing ⚠️
daemon/snapd/main.go 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #17145      +/-   ##
==========================================
+ Coverage   79.12%   79.17%   +0.05%     
==========================================
  Files        1388     1385       -3     
  Lines      193484   193455      -29     
  Branches     2466     2466              
==========================================
+ Hits       153093   153177      +84     
+ Misses      31205    31094     -111     
+ Partials     9186     9184       -2     
Flag Coverage Δ
unittests 79.17% <46.47%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

Mon Jun 15 14:46:38 UTC 2026
The following results are from: https://github.com/canonical/snapd/actions/runs/27547914939

Failures:

Preparing:

  • openstack:opensuse-16.0-64:
  • openstack:opensuse-16.0-64:
  • openstack:opensuse-16.0-64:
  • openstack:opensuse-16.0-64:
  • openstack:opensuse-16.0-64:
  • openstack:opensuse-16.0-64:
  • openstack:ubuntu-core-26-64:tests/main/
  • openstack:ubuntu-core-26-64:tests/regression/
  • openstack:ubuntu-core-26-64:tests/smoke/
  • openstack:ubuntu-core-26-64:tests/core/
  • openstack:ubuntu-20.04-64:tests/main/nss-modules:nis

Executing:

  • openstack:amazon-linux-2-64:tests/completion/indirect:hosts_n_dirs
  • openstack:centos-9-64:tests/main/desktop-file-ids
  • openstack:debian-12-64:tests/main/snapd-state
  • openstack:debian-12-64:tests/main/snapd-reexec:core
  • openstack:fedora-44-64:tests/upgrade/selinux-relabel
  • openstack:fedora-44-64:tests/main/selinux-clean
  • openstack:fedora-44-64:tests/main/refresh-many-transactional-undo
  • openstack:fedora-44-64:tests/main/snap-confine-privs
  • openstack:opensuse-tumbleweed-selinux-64:tests/main/cgroup-devices-v2
  • openstack:opensuse-tumbleweed-selinux-64:tests/main/selinux-classic-confinement
  • openstack:opensuse-tumbleweed-64:tests/main/interfaces-xdg-portal-permission-store
  • openstack-arm:ubuntu-core-24-arm-64:tests/core/snapd-refresh
  • openstack-arm:ubuntu-core-24-arm-64:tests/main/snap-user-service-start-on-install
  • openstack-arm:ubuntu-core-24-arm-64:tests/main/dbus-activation-session
  • openstack-arm:ubuntu-core-24-arm-64:tests/main/snap-user-service-upgrade-failure
  • openstack-arm:ubuntu-core-24-arm-64:tests/main/dbus-activation-name-conflict
  • openstack-arm:ubuntu-24.04-arm-64:tests/main/desktop-file-ids
  • garden:ubuntu-core-18-64:tests/core/auto-refresh-backoff-after-reboot:kernel
  • openstack:ubuntu-core-18-64:tests/core/snapd-refresh
  • openstack:ubuntu-core-20-64:tests/core/update-snapd-symlink
  • openstack:ubuntu-core-20-64:tests/core/snapd-refresh
  • openstack:ubuntu-core-20-64:tests/main/auto-refresh-gating
  • openstack:ubuntu-core-22-64:tests/core/snapd-refresh
  • openstack:ubuntu-core-22-64:tests/core/update-snapd-symlink
  • openstack:ubuntu-core-24-64:tests/core/coredump-options
  • openstack:ubuntu-core-24-64:tests/core/snapd-refresh
  • openstack:ubuntu-core-24-64:tests/main/snap-user-service-upgrade-failure
  • openstack:ubuntu-core-24-64:tests/main/snap-user-service
  • openstack:ubuntu-core-26-64:tests/core/snapd-refresh
  • openstack:ubuntu-fips-22.04-64:tests/fips-snap/main-fips
  • openstack:ubuntu-fips-24.04-64:tests/fips-snap/main-fips
  • openstack:ubuntu-20.04-64:tests/main/classic-snap-confine-unix-inheritance
  • openstack:ubuntu-25.10-64:tests/main/snapd-state
  • openstack:ubuntu-24.04-64:tests/main/apparmor-prompting-integration-tests:create_write_chmod_same_path_single_allow
  • openstack:ubuntu-16.04-64:tests/main/proxy-no-core
  • openstack:ubuntu-18.04-64:tests/main/snapd-reexec:core
  • openstack:ubuntu-16.04-64:tests/main/snapd-reexec:core

Restoring:

  • openstack:amazon-linux-2-64:tests/completion/indirect:hosts_n_dirs
  • openstack:amazon-linux-2-64:tests/completion/
  • openstack:amazon-linux-2-64:
  • openstack:centos-9-64:tests/main/interfaces-system-packages-doc
  • openstack:centos-9-64:tests/main/
  • openstack:centos-9-64:
  • openstack:opensuse-16.0-64:
  • openstack:opensuse-16.0-64:
  • openstack:opensuse-16.0-64:
  • openstack:opensuse-16.0-64:
  • openstack:opensuse-16.0-64:
  • openstack:opensuse-16.0-64:

Skipped tests from snapd-testing-skip

If you wish to have any of the below tests run in your PR, in your PR description, add 'unskip:' followed by a copy-and-pasted list (without variants) of the below tests you wish to run (unskip plus test list must be valid yaml)

  • garden:ubuntu-25.10-64:tests/main/apparmor-prompting-support
  • openstack-arm:ubuntu-24.04-arm-64:tests/main/i18n
  • openstack-arm:ubuntu-core-24-arm-64:tests/main/i18n
  • openstack:debian-sid-64:tests/main/interfaces-network-status-classic
  • openstack:debian-sid-64:tests/main/interfaces-xdg-portal-permission-store
  • openstack:ubuntu-24.04-64:tests/main/i18n
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-flag-restart
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:audio_record_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:audio_record_timespan_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:audio_record_timespan_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_actioned_by_other_pid_always_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_actioned_by_other_pid_always_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_not_actioned_by_other_pid_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_not_actioned_by_other_pid_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_write_chmod_same_fd_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_write_chmod_same_path_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_write_write_same_path_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:download_file_conflict
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:download_file_defaults
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:download_file_safer
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:read_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:read_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:special_characters
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:timespan_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:timespan_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_allow_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_deny_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-prompt-restoration
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_allow_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_allow_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_allow_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_allow_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_deny_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_deny_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_deny_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_deny_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_allow_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_allow_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_allow_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_allow_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_deny_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_deny_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_deny_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_deny_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-snapd-startup
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-support
  • openstack:ubuntu-25.10-64:tests/main/interfaces-requests-activates-handlers
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-flag-restart
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:audio_record_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:audio_record_timespan_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:audio_record_timespan_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_actioned_by_other_pid_always_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_actioned_by_other_pid_always_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_not_actioned_by_other_pid_single_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_not_actioned_by_other_pid_single_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_write_chmod_same_fd_single_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_write_chmod_same_path_single_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:create_write_write_same_path_single_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:download_file_conflict
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:download_file_defaults
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:download_file_safer
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:read_single_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:read_single_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:special_characters
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:timespan_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:timespan_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_allow_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_deny_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:write_single_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:write_single_deny
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-prompt-restoration
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_forever
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_session
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_timespan
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_forever
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_session
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_timespan
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_allow_forever
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_allow_session
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_allow_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_allow_timespan
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_deny_forever
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_deny_session
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_deny_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_deny_timespan
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_allow_forever
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_allow_session
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_allow_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_allow_timespan
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_deny_forever
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_deny_session
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_deny_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_deny_timespan
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-snapd-startup
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-support
  • openstack:ubuntu-26.04-64:tests/main/i18n
  • openstack:ubuntu-26.04-64:tests/main/interfaces-requests-activates-handlers

@bboozzoo bboozzoo force-pushed the bboozzoo/multi-call-bin-2026 branch from b9fbfb6 to abbeecf Compare June 2, 2026 06:12
@bboozzoo bboozzoo added cross-distro Runs all spread systems in parallel and removed Run only one system Only runs spread tests on one system labels Jun 2, 2026
@kubiko

kubiko commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Love this @bboozzoo
Will we stop are merging snap and snapd or possibly extend this further?
snap-preseed and snap-bootstrap would be two other candidates.
snap-preseed is used in only specific cases, so eliminating that binary would be great.
For snap-bootstrap it's trickier, as we would still support stand alone binary for the initrd, but that's alredy handled by core-initrd....

@bboozzoo

bboozzoo commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

@kubiko I'm looking into merging snapctl (~8MB) and snap-exec (~5MB) - should save ~1-2MB on the snap size and we benefit from sharing page cache of binaries that are always (snap-exec) or very often (snapctl) called during startup.
We also do not need snap-discard-ns to be a standalone thing. It could easily become part of snap-update-ns, but the savings would be minimal in this case.

@kubiko

kubiko commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

@bboozzoo yeah I was thinking about those as well, as they are called often, smaller gain, but prime candidates indeed.
Other two are more annoying, as they are called very seldomly

@bboozzoo bboozzoo force-pushed the bboozzoo/multi-call-bin-2026 branch 2 times, most recently from 00032f8 to 18f1690 Compare June 9, 2026 12:49
@bboozzoo bboozzoo requested a review from Copilot June 9, 2026 12:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This draft PR restructures snapd’s delivered binaries so the snap client can also serve as the snapd daemon entrypoint (via argv0/symlink dispatch), with corresponding updates across packaging and test suites to reflect the new layout.

Changes:

  • Merge daemon entrypoint into cmd/snap (run daemon mode when invoked as snapd) and refactor snapd main into an importable package.
  • Update distro packaging and snapcraft build logic to stop shipping a standalone snapd binary and instead provide /usr/lib/snapd/snapd -> /usr/bin/snap.
  • Adjust spread/tests/docs and a few runtime paths to align with the new snapd executable location (.../usr/bin/snap), including FIPS variant handling.

Reviewed changes

Copilot reviewed 37 out of 37 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/smoke/hacking-md/task.yaml Drops building a separate snapd binary from HACKING.md snippet smoke checks.
tests/main/static/task.yaml Updates static build test to build cmd/snap instead of cmd/snapd.
tests/main/snapd-reexec/task.yaml Updates re-exec test bind-mount paths from usr/lib/snapd/snapd to usr/bin/snap.
tests/main/snap-cli-no-managers/task.yaml Adjusts import expectations now that snap includes snapd; keeps snap-bootstrap constraint.
tests/lib/snapd-standalone/entry.go Adds a small standalone entry program calling daemon/snapd.Main().
spread.yaml Updates re-exec memory map assertion to match .../usr/bin/snap.
snap/quota/resources.go Lazily checks memory cgroup support via sync.Once when memory quotas are requested.
packaging/ubuntu-26.04/snapd.links Adds /usr/lib/snapd/snapd link pointing to /usr/bin/snap.
packaging/ubuntu-26.04/snapd.install.in Stops installing a standalone usr/bin/snapd into /usr/lib/snapd/.
packaging/ubuntu-26.04/rules Removes dedicated cmd/snap build step and updates comments for new tag usage.
packaging/ubuntu-16.04/snapd.links Adds /usr/lib/snapd/snapd link pointing to /usr/bin/snap.
packaging/ubuntu-16.04/snapd.install.in Stops installing a standalone usr/bin/snapd into /usr/lib/snapd/.
packaging/ubuntu-16.04/rules Removes dedicated cmd/snap build step and updates comments for new tag usage.
packaging/snapd.mk Removes standalone snapd build/install; adds symlink install rules for snapctl and snapd -> snap.
packaging/debian-sid/snapd.links Adds /usr/lib/snapd/snapd link pointing to /usr/bin/snap.
packaging/debian-sid/snapd.install Stops installing a standalone usr/bin/snapd into /usr/lib/snapd/.
packaging/debian-sid/rules Removes cmd/snapd from the dh-golang build package list.
overlord/snapstate/export_test.go Updates exports for catalog refresh delay testing and adds a getter for per-instance delta.
overlord/snapstate/catalogrefresh.go Moves refresh delta to be stored per catalogRefresh instance instead of global var.
overlord/snapstate/catalogrefresh_test.go Updates tests to assert against the per-instance delay delta.
overlord/servicestate/quota_control.go Makes systemd version check lazy via sync.Once instead of eager init-time call.
overlord/managers_test.go Adds cgroup v2 controller-file setup for quota-related test coverage under mocked root.
overlord/hookstate/hookmgr.go Adjusts snap command path detection for merged snap/snapd and snap-fips layouts.
HACKING.md Updates documentation to reflect building snap (now including daemon functionality) and removes standalone snapd build instructions.
daemon/snapd/main.go Refactors daemon entrypoint from package main to package snapd with exported Main(), and sets plug/slot sanitizer.
daemon/snapd/main_test.go Updates test package/imports to match daemon/snapd refactor.
daemon/snapd/export_test.go Updates package name to match daemon/snapd refactor.
daemon/export_test.go Adds a test helper to reset cached virtualization detection state.
daemon/export_api_general_test.go Updates virtualization mocking to hook into the new sync.Once-based detection.
daemon/api_notices_test.go Adds coverage for snap-fips path behavior when detecting snap cmd under re-exec.
daemon/api_general.go Caches systemd-detect-virt output via sync.Once and exposes a mockable setter for tests.
daemon/api_base_test.go Resets virtualization detection between daemon API tests for determinism.
daemon/access.go Updates snap cmd identity check to allow both snap and snap-fips under snapd re-exec.
cmd/snap/main.go Adds argv0-based dispatch into daemon mode when invoked as snapd.
cmd/snap/main_snapd.go Linux-only daemon-mode bridge calling daemon/snapd.Main().
cmd/snap/main_snapd_stub.go Non-Linux stub for daemon mode with an error message.
build-aux/snap/snapcraft.yaml Stops building/shipping lib/snapd/snapd as a separate binary; wires symlinks and updates tag selection for merged binary and FIPS layout.

Comment thread cmd/snap/main.go Outdated
Comment on lines +476 to +480
// 1. maybe symlink from snapd -> snap
if argv0 == "snapd" {
snapdMain()
panic("not reached")
}

details: |
This test checks that snap binary does not import snapstate when built
This test checks that snapstate is not imported when binaries are built built
Comment thread daemon/access.go
Comment on lines +508 to +512
base := filepath.Base(exe)
// Depending on the build variant of the snapd snap, the command could
// either be $SNAPD_MOUNT/usr/bin/snap or $SNAP_MOUNT/usr/bin/snap-fips
if base == "snap" || base == "snap-fips" {
return true, nil
Comment thread daemon/export_test.go
Comment on lines +457 to +459
func ResetVirtualizationDetection() {
systemdVirtOnce = sync.Once{}
}
@bboozzoo bboozzoo force-pushed the bboozzoo/multi-call-bin-2026 branch from 18f1690 to 2c09050 Compare June 10, 2026 12:39
Comment thread daemon/snapd/main.go
if snapdenv.Preseeding() {
logger.Noticef("running for preseeding")
} else {
snapdtool.ExecInSnapdOrCoreSnap()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this could be dropped

@bboozzoo bboozzoo force-pushed the bboozzoo/multi-call-bin-2026 branch from 39ea40b to f13b636 Compare June 15, 2026 12:59
bboozzoo and others added 17 commits June 15, 2026 15:26
Note, the caller still has to be allowed to transition to snapp_t
context, which is currently only allowed for init_t.

Signed-off-by: Maciej Borzecki <[email protected]>
…nning on SELinux enabled systems

Set a desired SELinuxContext for the snapd service. The policy must
alreayd allow transition from init_t -> snappy_t.

Signed-off-by: Maciej Borzecki <[email protected]>
…erve and pokit are undesired

Signed-off-by: Maciej Borzecki <[email protected]>
@bboozzoo bboozzoo force-pushed the bboozzoo/multi-call-bin-2026 branch from f13b636 to 1e958c1 Compare June 15, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cross-distro Runs all spread systems in parallel Needs Documentation -auto- Label automatically added which indicates the change needs documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants