feat: embed runtime binaries for self-contained SDKs#316
Merged
DorianZheng merged 5 commits intomainfrom Feb 28, 2026
Merged
Conversation
Runtime binaries (boxlite-shim, boxlite-guest, libraries) are now compiled directly into the library using include_bytes! instead of being shipped as separate files in a boxlite-runtime/ directory. This makes SDKs fully self-contained — no external runtime directory needed at deployment time. Key changes: - build.rs generates EmbeddedManifest with include_bytes! for all runtime artifacts - New embedded.rs extracts and caches runtime to ~/.local/share/boxlite/runtimes/ on first use - binary_finder and configure_library_env use embedded cache paths - SDK Cargo.toml files forward the embedded-runtime feature flag - CI workflows build shim+guest on host, removing runtime bundling steps - Packaging scripts no longer include boxlite-runtime directory - Remove duplicated auto_detect_registry() from -sys build scripts
_ensure-python-deps was triggering a full Rust compilation via maturin when only dev tools (ruff, pytest) were needed. This caused CI lint to fail because submodules were not checked out. Switch to PEP 735 [dependency-groups] + uv, which installs dev deps without invoking the build backend.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
include_bytes!instead of being shipped in a separateboxlite-runtime/directoryEmbeddedRuntimeextracts and caches binaries to~/.local/share/boxlite/runtimes/v{VERSION}/, with content-hash cache invalidation for debug buildsWhat changed
boxlite/build.rs:EmbeddedManifestgenerator scans runtime dir, writesinclude_bytes!manifest, emits content hash env varsboxlite/src/runtime/embedded.rs: New module — extracts embedded files to versioned cache dir with atomic rename, PID-scoped temp dirs, and stale cache cleanup (7-day TTL)binary_finder/configure_library_env: Updated to use embedded cache paths instead of workspaceboxlite-runtime/dirbuild-runtime.sh/build-shim.sh: Defaults to cargoOUT_DIR;SKIP_SHIM_BUILDsupport for shim self-build avoidanceboxlite-runtime/directory from packagesembedded-runtimefeature flag-sysbuild scripts: Remove duplicatedauto_detect_registry()(already in mainbuild.rs)Test plan
cargo test -p boxlite— unit tests including embedded manifest and versioned dir testsmake dev:python && python examples/python/basic/hello.py— Python SDK uses embedded runtimemake dev:node && node sdks/node/examples/basic.mjs— Node SDK uses embedded runtime