feat(build): enable cargo add boxlite with prebuilt runtime download#241
Merged
DorianZheng merged 3 commits intomainfrom Feb 12, 2026
Merged
feat(build): enable cargo add boxlite with prebuilt runtime download#241DorianZheng merged 3 commits intomainfrom
DorianZheng merged 3 commits intomainfrom
Conversation
Add BOXLITE_DEPS_STUB=2 (Prebuilt) mode that downloads a pre-built runtime tarball from GitHub Releases during cargo build, eliminating the need for LLVM, Go, make, or meson on the consumer's machine. - Introduce DepsMode enum (Source/Stub/Prebuilt) in boxlite/build.rs - Add download_prebuilt_runtime() and create_library_symlinks() for fetching and preparing prebuilt native dependencies - Emit cargo:rustc-env=BOXLITE_RUNTIME_DIR so RuntimeBinaryFinder can locate boxlite-shim/boxlite-guest at compile time via option_env!() - Add rerun-if-env-changed=BOXLITE_DEPS_STUB to all -sys crate build scripts for correct incremental rebuild - Update build-runtime CI workflow for tarball publishing
Build Linux runtime inside quay.io/pypa/manylinux_2_28 container to ensure binaries work on older distros (RHEL 8/9, Debian 11, etc.). - Guest built on host (Ubuntu has musl-tools, manylinux doesn't) - Runtime/shim/libkrun built in container (glibc 2.28) - Add actions/cache for manylinux cargo registry (CARGO_HOME mounted from host volume since Swatinem/rust-cache can't run in Docker) - macOS build unchanged (native runner) Mirrors the established pattern from build-node.yml.
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
BOXLITE_DEPS_STUB=2(Prebuilt) mode: downloads runtime tarball from GitHub Releases duringcargo build, so downstream Rust users cancargo add boxlitewithout needing LLVM, Go, make, or mesonDepsModeenum inboxlite/build.rsto route between Source/Stub/Prebuilt build paths-syscrate build scripts now respectBOXLITE_DEPS_STUBfor correct incremental rebuildsRuntimeBinaryFindergains compile-time fallback viaoption_env!("BOXLITE_RUNTIME_DIR")so runtime binaries (boxlite-shim, boxlite-guest, mke2fs, debugfs) are discoverable without env varsTest plan
BOXLITE_DEPS_STUB=1 cargo check -p boxlite— passes (CI lint mode)BOXLITE_DEPS_STUB=1 cargo clippy -p boxlite— passes, no warningsBOXLITE_DEPS_STUB=2 cargo test -p boxlite --lib— 318 tests passcargo add boxlitebuilds and runs (echo "Hello from BoxLite!"inside Alpine VM)