Skip to content

core: make checkpoint, image, profiles and COW optional - #297

Merged
congwang-mk merged 4 commits into
mainfrom
optional-core-features
Oct 13, 2026
Merged

congwang-mk merged 4 commits into
mainfrom
optional-core-features

Conversation

@congwang-mk

@congwang-mk congwang-mk commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Make checkpoint, image, TOML profiles and filesystem COW optional in four separate commits. Together with the existing HTTP feature, these provide five feature boundaries for minimal embedders. All five remain enabled by default.

  • checkpoint gates the checkpoint engine, bincode dependency, OCI checkpoint commands and C restore stub compilation.
  • image gates local extraction and remote image loading together, including archive, compression and Docker client dependencies. It enables cow; remote transports also require http.
  • profiles gates TOML loading and writing while preserving the policy schema and JSON inspection.
  • cow gates filesystem branches, recovery and transactions. Disabled builds reject COW configuration in both the builder and the process creation path. CLI learning requires both profiles and cow to discard writes during observation.

Forward the features through the CLI, FFI and OCI crates. Compile checkpoint and image C entry points only with their respective features. Keep serialized policy fields, and reject unavailable policy operations explicitly. Document feature behavior in docs/building.md, with brief build commands in the README.

Validation

Expand the existing minimal CI job into a matrix for minimal builds and each individual feature, reusing the default-build and C header jobs. Check production dependency graphs, run workspace tests, and regenerate the C header to check ABI declarations. Add tests for disabled-feature behavior and make the C smoke test use the selected features. Inspect the shared library exports to verify that checkpoint and image C symbols are present only when enabled.

The earlier CI failures were corrected: split the chroot and COW syscall-filter tests, and gate learning tests on both profiles and COW. CI is rerunning for the latest changes to the exported C symbols.

All builds and tests run on GitHub. No local builds or tests were run.

Fixes #293 and #294.

@congwang-mk
congwang-mk force-pushed the optional-core-features branch 2 times, most recently from 15fbe3a to 1390b63 Compare October 12, 2026 21:10
Checkpoint and restore currently pull bincode into every build, including
embedders that only need process isolation. They also compile the C restore
stub even when the application never restores a checkpoint.

Add a default-enabled checkpoint feature and forward it through the CLI,
FFI and OCI crates. Gate the Rust checkpoint engine and the restore stub
build with compile-time feature checks. Compile the checkpoint C entry points only when the feature is enabled,
so disabled builds omit their exports and opaque handle type.

Gate checkpoint-specific tests and OCI commands with the feature. Add
GitHub CI jobs for minimal, checkpoint-only and default builds, together
with a generated C header comparison. Document how embedders can omit
checkpoint support and its bincode dependency.

Signed-off-by: Cong Wang <cwang@multikernel.io>
Local image extraction and remote image loading bring archive, compression
and Docker client dependencies into embedders that use host filesystem
paths directly. These dependencies should follow image support.

Add a default-enabled image feature and forward it through the workspace.
Keep image extraction and pulling under the same feature, and move the
Docker client dependencies out of the HTTP feature. Remote transports
continue to require HTTP support as well.

Gate the Rust image module and builder method. Compile the image C entry points only when the feature is enabled, and
reject CLI image requests when image support is disabled. Extend GitHub CI with an image-only job and document
the feature boundary.

Signed-off-by: Cong Wang <cwang@multikernel.io>
Embedders that construct policies directly do not need TOML profile
parsing or serialization. The profile schema is also used by live JSON
inspection, so removing that schema would disable unrelated functionality.

Add a default-enabled profiles feature for TOML loading, writing and CLI
learning. Keep the policy schema and JSON inspection available in minimal
builds. Return a feature-disabled error for TOML operations when profiles
are omitted, and forward the feature through the workspace crates.

Gate TOML-specific tests and extend GitHub CI with a profiles-only job.
Keep TOML as a core development dependency for the existing expansion
fixtures without retaining it in the minimal production dependency graph.
Document which profile operations remain available.

Signed-off-by: Cong Wang <cwang@multikernel.io>
@congwang-mk
congwang-mk force-pushed the optional-core-features branch from 1390b63 to 9c6e2b9 Compare October 12, 2026 21:16
Copy-on-write branches, recovery and transactions bring filesystem and
hashing dependencies into every sandbox build. Minimal embedders should
be able to omit them while retaining ordinary filesystem isolation.

Add a default-enabled cow feature and gate branch state, syscall handlers,
recovery and transaction code. Reject COW configuration when the feature
is disabled, both in the builder and before starting a deserialized
sandbox, so a requested COW policy cannot silently become direct writes.
Keep serialized policy fields stable across feature configurations.

Make image support enable cow to protect cached image contents. Require
both profiles and cow for CLI learning, which discards observed writes.
Keep the chroot syscall-filter test active without cow and gate its COW
counterpart separately.

Expand the existing minimal-build CI job into a matrix for each feature
and the minimal build, including production dependency checks. Reuse the
existing default-build and C header jobs instead of a separate workflow. Add disabled-feature tests for
policy validation and JSON inspection. Forward the selected features into
the C smoke test build and check that checkpoint and image symbols are
exported exactly when enabled. Document the feature dependencies and the
reduced C API in the build guide.

Signed-off-by: Cong Wang <cwang@multikernel.io>
@congwang-mk
congwang-mk force-pushed the optional-core-features branch from 9c6e2b9 to b8f6460 Compare October 12, 2026 21:22
@congwang-mk
congwang-mk merged commit 1468e2a into main Oct 13, 2026
23 checks passed
@congwang-mk
congwang-mk deleted the optional-core-features branch October 13, 2026 15:58
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.

core: offer a minimal embedding feature configuration

1 participant