Skip to content

feat(build): prepare crates for crates.io publishing#250

Merged
DorianZheng merged 1 commit intomainfrom
feat/publish-crates-io
Feb 13, 2026
Merged

feat(build): prepare crates for crates.io publishing#250
DorianZheng merged 1 commit intomainfrom
feat/publish-crates-io

Conversation

@DorianZheng
Copy link
Copy Markdown
Member

Summary

Enable cargo add boxlite for Rust developers by preparing all 6 crates for crates.io publishing.

  • Auto-detect crates.io builds: Each build.rs detects .cargo_vcs_info.json (added by Cargo to published packages) and auto-sets BOXLITE_DEPS_STUB=2, so crates.io builds download prebuilt runtime instead of compiling from vendored sources
  • Cargo.toml metadata: Add version specs to path deps, sync -sys crate versions to workspace, add repository URLs, exclude vendor dirs from packages
  • Non-publishable crates: Set publish = false for SDKs, CLI, and guest agent
  • Workspace member: Add bubblewrap-sys to workspace members

Publish order (handled by cargo publish)

boxlite-shared → libkrun-sys, e2fsprogs-sys, libgvproxy-sys, bubblewrap-sys → boxlite

Package sizes (all well under 10MB crates.io limit)

Crate Compressed
boxlite-shared 18.5 KB
libkrun-sys 10.0 KB
e2fsprogs-sys 2.4 KB
libgvproxy-sys 4.0 KB
bubblewrap-sys 2.8 KB
boxlite 319.1 KB

Test plan

  • cargo package succeeds for all 6 publishable crates
  • Build verification passes (downloads v0.5.11 prebuilt runtime)
  • Vendor directories excluded from packages (via exclude = ["vendor"])
  • publish = false crates skipped
  • cargo publish -p boxlite-shared -p libkrun-sys -p e2fsprogs-sys -p libgvproxy-sys -p bubblewrap-sys -p boxlite (after merge)

Auto-detect crates.io builds via .cargo_vcs_info.json and default to
prebuilt mode (BOXLITE_DEPS_STUB=2), so `cargo add boxlite` works
without Go, LLVM, or vendored submodules.

Changes:
- Add auto_detect_registry() to all build.rs files (boxlite + 4 -sys crates)
- Add version specs to path dependencies in boxlite/Cargo.toml
- Sync -sys crate metadata (version.workspace, repository, exclude vendor)
- Add bubblewrap-sys to workspace members
- Set publish = false for non-publishable crates (SDKs, CLI, guest)
- Add docs.rs metadata to boxlite-shared
@DorianZheng DorianZheng merged commit 01ec5c1 into main Feb 13, 2026
26 checks passed
@DorianZheng DorianZheng deleted the feat/publish-crates-io branch February 13, 2026 01:37
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