Skip to content

refactor: simplify C SDK build, remove packaging scripts#333

Merged
DorianZheng merged 1 commit intomainfrom
refactor/simplify-c-sdk-build
Mar 3, 2026
Merged

refactor: simplify C SDK build, remove packaging scripts#333
DorianZheng merged 1 commit intomainfrom
refactor/simplify-c-sdk-build

Conversation

@DorianZheng
Copy link
Copy Markdown
Member

@DorianZheng DorianZheng commented Mar 3, 2026

Summary

  • Remove packaging scripts: Delete scripts/package/{package-common,package-macos,package-linux}.sh — no longer needed since embedded-runtime is the default feature and libboxlite is self-contained
  • Simplify make dev:c / make dist:c: Replace shell script dispatch with direct cargo build commands, remove runtime/runtime-debug prerequisites
  • Clean up feature forwarding: Remove stale embedded-runtime, gvproxy-backend, libslirp-backend feature forwarding from ffi/Cargo.toml, sdks/c/Cargo.toml, and sdks/go/rust/Cargo.toml
  • Simplify C test CMakeLists: Remove runtime directory auto-discovery logic (BOXLITE_RUNTIME_DIR, file(GLOB ...) fallback) from sdks/c/tests/CMakeLists.txt
  • Fix debugfs path quoting bug: Quote host file path in build_inject_commands to handle spaces in macOS ~/Library/Application Support/ paths — previously caused guest binary injection to silently fail

Test plan

  • cargo test -p boxlite --lib -- disk::ext4 — all 5 unit tests pass (including new test_build_inject_commands_path_with_spaces)
  • make dev:c — builds C SDK (debug)
  • make dist:c — builds C SDK (release) and stages to sdks/c/dist/
  • make test:all:c — C SDK tests pass via CMake/CTest
  • cargo clippy -p boxlite --tests -- -D warnings

Since embedded-runtime is now the default feature, `cargo build -p boxlite-c`
produces a self-contained library. The packaging scripts that bundled
boxlite-runtime/, set RPATHs with install_name_tool/patchelf, and created
tarballs are no longer needed.

Changes:
- Delete scripts/package/{package-common,package-macos,package-linux}.sh
- Simplify `make dev:c` to `cargo build -p boxlite-c` (no runtime dep)
- Simplify `make dist:c` to release build + stage to sdks/c/dist/
- Remove `make package` target (alias for dist:c)
- Remove stale `embedded-runtime` feature forwarding from ffi/, sdks/c/,
  and sdks/go/rust/ Cargo.toml files
- Simplify C test CMakeLists.txt: remove runtime dir discovery, point to
  target/debug, update test:all:c to use dev:c
- Fix debugfs inject_file_into_ext4 to quote source paths (spaces in
  macOS "Application Support" path broke guest binary injection)
@DorianZheng DorianZheng merged commit dcac75b into main Mar 3, 2026
15 of 18 checks passed
@DorianZheng DorianZheng deleted the refactor/simplify-c-sdk-build branch March 3, 2026 17:12
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.

1 participant