Skip to content

fix(publish): fix crates.io publishing for static-linked -sys crates#375

Merged
DorianZheng merged 3 commits intomainfrom
fix/crates-io-publish
Mar 13, 2026
Merged

fix(publish): fix crates.io publishing for static-linked -sys crates#375
DorianZheng merged 3 commits intomainfrom
fix/crates-io-publish

Conversation

@DorianZheng
Copy link
Copy Markdown
Member

Summary

  • Fix libgvproxy-sys and libkrun-sys stub mode emitting rustc-link-lib without a real .a file, causing cargo publish verification to fail
  • Add set -euo pipefail to CI publish script — previously tee swallowed cargo publish exit codes, silently hiding the v0.7.0 publish failures
  • Use --no-verify for all -sys crates since vendor sources are excluded from the package
  • Add .cargo_vcs_info.json auto-detection to all -sys crate build scripts so they enter stub mode when downloaded from crates.io (prevents panics on missing vendor sources)
  • Bump workspace version to 0.7.2 (libkrun-sys 0.7.0 on crates.io has old feature names incompatible with PR refactor: consistent -sys dependency naming and feature gates #374's renames)

Context

The v0.7.0 release CI silently failed to publish libgvproxy-sys and boxlite to crates.io (run #23006800445). All 6 crates have been manually republished at 0.7.2 and verified with a standalone Rust example project.

Test plan

  • BOXLITE_DEPS_STUB=1 cargo check -p libgvproxy-sys passes
  • BOXLITE_DEPS_STUB=1 cargo check -p libkrun-sys passes
  • BOXLITE_DEPS_STUB=1 cargo publish -p libgvproxy-sys --dry-run packaging succeeds
  • All 6 crates published to crates.io at 0.7.2
  • boxlite-rust-example builds cleanly with boxlite = "0.7.2" from crates.io
  • Runtime tested with BOXLITE_RUNTIME_URL pointing to v0.7.0 release tarballs

- Remove rustc-link-lib directives from stub mode in libgvproxy-sys
  and libkrun-sys. Stub mode emitting link-lib without a real .a file
  causes cargo publish verification to fail with "could not find native
  static library".

- Add set -euo pipefail to CI publish script. Previously, piping through
  tee swallowed cargo publish exit codes, silently hiding failures.

- Use --no-verify for all -sys crates since vendor sources are excluded
  from the package. The real build succeeds in the build job before
  publishing.

- Bump workspace version to 0.7.1 (libkrun-sys 0.7.0 on crates.io has
  old feature names incompatible with current code).
Add .cargo_vcs_info.json detection to all -sys crate build scripts.
When downloaded from crates.io, vendor/Go sources are excluded from
the package so building from source is impossible. Auto-entering stub
mode prevents panics and lets boxlite's prebuilt runtime download
handle everything.

Bump to 0.7.2 since 0.7.1 was published without this fix.
@DorianZheng DorianZheng merged commit 06ea62b into main Mar 13, 2026
29 checks passed
@DorianZheng DorianZheng deleted the fix/crates-io-publish branch March 13, 2026 08:28
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