Repository navigation
Conversation
print_debug made the exported debug! macro also print to stdout in debug builds. tracing::debug! already emits the same message. The macro's cfg is evaluated in the caller's crate, so it never printed for external users. Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
build-metadata used built with git2 to log build details on the first sandbox creation. Its git fields were empty for crates.io users. Dropping git2, which builds libgit2 from C, speeds up a clean debug build of hyperlight-host with default features on 8 cores. Wall time drops 35%, from 65.6 s to 42.5 s. CPU time drops 34%, from 319 s to 209 s. The build compiles 11 fewer crates, and the target directory shrinks 7%, from 847 MB to 788 MB. Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
* Enabling std on hyperlight-common no longer pulls in tracing. * Feature lists name only the crates each package uses directly. * Drop the empty hyperlight-libc features table and stale feature names from the clippy script. Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
Static review found no blocking issues, and the removals are consistent across callers, feature forwarding, build recipes, and documentation.
No open issues 🎉
What changed in this PR
This PR reduces Hyperlight host build overhead by removing two Cargo features and their logging machinery. It also simplifies feature forwarding and documents the breaking changes.
Changes:
- Remove
print_debug,hyperlight_host::debug!, and build-metadata logging with its build dependencies. - Simplify guest feature lists and keep common-crate tracing optional.
- Update build recipes, coverage documentation, and the changelog.
| File | Description |
|---|---|
src/tests/rust_guests/witguest/Cargo.toml |
Simplifies guest feature forwarding. |
src/tests/rust_guests/simpleguest/Cargo.toml |
Simplifies guest feature forwarding. |
src/tests/rust_guests/dummyguest/Cargo.toml |
Simplifies memory-profile forwarding. |
src/hyperlight_libc/Cargo.toml |
Removes the empty features table. |
src/hyperlight_host/src/sandbox/uninitialized.rs |
Removes build logging, uses tracing directly, and ungates tracing tests. |
src/hyperlight_host/src/sandbox/trace/context.rs |
Uses tracing::debug! directly. |
src/hyperlight_host/src/lib.rs |
Removes the debug macro and build-metadata machinery. |
src/hyperlight_host/Cargo.toml |
Removes both features and the built dependency. |
src/hyperlight_host/build.rs |
Removes metadata generation and the debug-print configuration alias. |
src/hyperlight_guest_bin/Cargo.toml |
Simplifies tracing feature forwarding. |
src/hyperlight_common/Cargo.toml |
Keeps tracing optional when enabling std. |
Justfile |
Removes obsolete features from checks and test commands. |
hack/clippy-package-features.sh |
Removes stale feature exclusions. |
docs/how-to-run-coverage.md |
Aligns documented feature combinations with coverage commands. |
CHANGELOG.md |
Documents feature removals and migration guidance. |
Cargo.lock |
Removes unused build-metadata dependencies. |
Review effort: Balanced
|
@simongdavies I know you have said in the past that build-metadata can be useful, but I don't agree. Applications can check their cargo.lock to see what version they use, and if they really want to include it in their tracing at runtime, they can do that too for any dependency they care about. I don't think hyperlight needs special feature for this |
Benchmark ResultsMeasured commit: kvm / amd (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
kvm / intel (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
mshv3 / amd (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
mshv3 / intel (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
hyperv-ws2025 / amd (Windows) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
hyperv-ws2025 / intel (Windows) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
Reported by |
This PR removes two host cargo features and tidies up feature lists.
print_debugfeature and the exporteddebug!macro. The macro calledtracing::debug!and also printed to stdout in debug builds. Its cfg was evaluated in the caller's crate, so the print never worked for external users.build-metadatafeature and itsbuiltandgit2build dependencies. The feature logged build details on the first sandbox creation. Its git fields were empty for crates.io users.stdfeature ofhyperlight-commonno longer pulls intracing.hyperlight-libcfeatures table and stale feature names inhack/clippy-package-features.sh.Dropping
git2, which builds libgit2 from C, speeds up a clean debug build ofhyperlight-hostwith default features on 8 cores:Breaking: Crates that enable
print_debugorbuild-metadatamust remove them. Replacehyperlight_host::debug!withtracing::debug!.Closes #1979