diff --git a/CHANGELOG.md b/CHANGELOG.md index 95fecc54f3..46ea278bfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ### Added * Add `Sandbox::recreate()`, which rebuilds a sandbox's VM and memory from a snapshot. It recovers unrecoverable sandboxes and keeps configuration, host functions, and interrupt handles by @ludfjig in https://github.com/hyperlight-dev/hyperlight/pull/1751 +### Removed +* Remove Git details from build logs. These were not shipped on crates.io. +* Remove the `print_debug` feature and `hyperlight_host::debug!`. Use `tracing::debug!` instead. + ### Fixed * Fix restore on WHP not rewinding the guest TSC on hosts with `TSC_ADJUST` support. diff --git a/Cargo.lock b/Cargo.lock index 3cbca23fcf..63ab0cc232 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -318,7 +318,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c0e531d93d39c34eef561e929e8a7f86d77a5af08aac4f6d6e39976c51858e9" dependencies = [ "chrono", - "git2", ] [[package]] @@ -1398,18 +1397,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "git2" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddddbf932745a6be37109b6112d3ee09696106f848449069d3a57bba937ab82e" -dependencies = [ - "bitflags 2.13.2", - "libc", - "libgit2-sys", - "log", -] - [[package]] name = "glib" version = "0.22.9" @@ -2291,18 +2278,6 @@ dependencies = [ "cc", ] -[[package]] -name = "libgit2-sys" -version = "0.18.8+1.9.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7c568b25d7489bc3fb2988ed69ab111d2944d2f5fec3d5c987fe545ea97b50" -dependencies = [ - "cc", - "libc", - "libz-sys", - "pkg-config", -] - [[package]] name = "libloading" version = "0.8.9" @@ -2345,18 +2320,6 @@ dependencies = [ "escape8259", ] -[[package]] -name = "libz-sys" -version = "1.1.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff20308ecabd635a2dc1dd5834a86c462cca20efba1d5d3ddab1f8aea3455cb2" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "linkme" version = "0.3.37" @@ -4425,12 +4388,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version-compare" version = "0.2.1" diff --git a/Justfile b/Justfile index 528fc4df2e..2d54f3da5b 100644 --- a/Justfile +++ b/Justfile @@ -383,7 +383,6 @@ miri-tests: (ensure-cargo-nextest) (ensure-nightly-miri) check: {{ cargo-cmd }} check {{ target-triple-flag }} {{ cargo-cmd }} check -p hyperlight-host --features crashdump {{ target-triple-flag }} - {{ cargo-cmd }} check -p hyperlight-host --features print_debug {{ target-triple-flag }} {{ cargo-cmd }} check -p hyperlight-host --features gdb {{ target-triple-flag }} {{ cargo-cmd }} check -p hyperlight-host --features trace_guest,mem_profile {{ target-triple-flag }} {{ cargo-cmd }} check -p hyperlight-host --features hw-interrupts {{ target-triple-flag }} diff --git a/hack/clippy-package-features.sh b/hack/clippy-package-features.sh index 49b6716b81..fc0b1b0143 100755 --- a/hack/clippy-package-features.sh +++ b/hack/clippy-package-features.sh @@ -37,7 +37,7 @@ fi EXCLUDED_FEATURES=("${REQUIRED_FEATURES[@]}") if [[ -n "${TARGET_TRIPLE}" && "$TARGET_TRIPLE" =~ aarch64 ]] || [[ -z "${TARGET_TRIPLE}" && "$(uname -m)" = "aarch64" ]]; then - EXCLUDED_FEATURES+=("crashdump" "trace_guest" "mem_profile" "hw-interrupts" "gdb" "i686-guest" "nanvix-unstable") + EXCLUDED_FEATURES+=("crashdump" "trace_guest" "mem_profile" "hw-interrupts" "gdb") fi # Get all features for the package (excluding default and required features) diff --git a/src/hyperlight_common/Cargo.toml b/src/hyperlight_common/Cargo.toml index 3ea678ecf5..975b102069 100644 --- a/src/hyperlight_common/Cargo.toml +++ b/src/hyperlight_common/Cargo.toml @@ -35,7 +35,7 @@ tracing = ["dep:tracing"] fuzzing = ["dep:arbitrary"] trace_guest = [] mem_profile = [] -std = ["thiserror/std", "log/std", "tracing/std"] +std = ["thiserror/std", "log/std", "tracing?/std"] [dev-dependencies] criterion = "0.8.1" diff --git a/src/hyperlight_guest_bin/Cargo.toml b/src/hyperlight_guest_bin/Cargo.toml index 0b9fe21966..7325cd7508 100644 --- a/src/hyperlight_guest_bin/Cargo.toml +++ b/src/hyperlight_guest_bin/Cargo.toml @@ -15,7 +15,7 @@ and third-party code used by our C-API needed to build a native hyperlight-guest [features] default = ["libc", "macros"] libc = ["dep:hyperlight-libc"] # compile libc from picolibc -trace_guest = ["hyperlight-common/trace_guest", "hyperlight-guest/trace_guest", "hyperlight-guest-tracing/trace"] +trace_guest = ["hyperlight-guest/trace_guest", "hyperlight-guest-tracing/trace"] mem_profile = ["hyperlight-common/mem_profile"] macros = ["dep:hyperlight-guest-macro", "dep:linkme"] diff --git a/src/hyperlight_host/Cargo.toml b/src/hyperlight_host/Cargo.toml index 2988fd3b1c..873a80b28f 100644 --- a/src/hyperlight_host/Cargo.toml +++ b/src/hyperlight_host/Cargo.toml @@ -122,7 +122,7 @@ proc-maps = "0.5.0" [build-dependencies] anyhow = { version = "1.0.102" } cfg_aliases = "0.2.1" -built = { version = "0.8.1", optional = true, features = ["chrono", "git2"] } +built = { version = "0.8.1", optional = true, features = ["chrono"] } bindgen = { version = "0.73", features = ["prettyplease"] } cc = "1.2" @@ -130,8 +130,6 @@ cc = "1.2" default = ["kvm", "mshv3", "hvf", "build-metadata"] function_call_metrics = [] executable_heap = [] -# This feature enables printing of debug information to stdout in debug builds -print_debug = [] # Dumps the VM state to a file on unexpected errors or crashes. The path of the file will be printed on stdout and logged. crashdump = ["dep:chrono", "dep:elfcore"] trace_guest = ["dep:opentelemetry", "dep:tracing-opentelemetry", "dep:hyperlight-guest-tracing", "hyperlight-common/trace_guest"] diff --git a/src/hyperlight_host/build.rs b/src/hyperlight_host/build.rs index 3ec2fe181e..4af2841c3b 100644 --- a/src/hyperlight_host/build.rs +++ b/src/hyperlight_host/build.rs @@ -156,8 +156,6 @@ fn main() -> Result<()> { mshv3: { all(feature = "mshv3", target_os = "linux") }, hvf: { all(feature = "hvf", target_os = "macos") }, crashdump: { all(feature = "crashdump", target_arch = "x86_64") }, - // print_debug feature is aliased with debug_assertions to make it only available in debug-builds. - print_debug: { all(feature = "print_debug", debug_assertions) }, // the gdb feature (only temporarily!) needs to use // writable/un-shared snapshot memories. unshared_snapshot_mem: { gdb }, diff --git a/src/hyperlight_host/src/lib.rs b/src/hyperlight_host/src/lib.rs index afd9ade1f9..df89c4d9f1 100644 --- a/src/hyperlight_host/src/lib.rs +++ b/src/hyperlight_host/src/lib.rs @@ -136,17 +136,6 @@ macro_rules! log_then_return { }; } -/// Same as tracing::debug!, but will additionally print to stdout if the print_debug feature is enabled -#[macro_export] -macro_rules! debug { - ($($arg:tt)+) => - { - #[cfg(print_debug)] - println!($($arg)+); - tracing::debug!($($arg)+); - } -} - // LOG_ONCE is used to log information about the crate version once #[cfg(feature = "build-metadata")] static LOG_ONCE: Once = Once::new(); @@ -168,34 +157,5 @@ pub(crate) fn log_build_details() { "" => info!("Not built on a CI platform"), other => info!("Built on : {}", other), } - match built_info::GIT_COMMIT_HASH.unwrap_or("") { - "" => info!("No git commit hash found"), - other => info!("Git commit hash: {}", other), - } - - let git = match built_info::GIT_HEAD_REF.unwrap_or("") { - "" => { - info!("No git head ref found"); - false - } - other => { - info!("Git head ref: {}", other); - true - } - }; - match built_info::GIT_VERSION.unwrap_or("") { - "" => info!("No git version found"), - other => info!("Git version: {}", other), - } - match built_info::GIT_DIRTY.unwrap_or(false) { - true => info!("Repo had uncommitted changes"), - false => { - if git { - info!("Repo had no uncommitted changes") - } else { - info!("No git repo found") - } - } - } }); } diff --git a/src/hyperlight_host/src/sandbox/trace/context.rs b/src/hyperlight_host/src/sandbox/trace/context.rs index e6eb677c63..bbd164a36c 100644 --- a/src/hyperlight_host/src/sandbox/trace/context.rs +++ b/src/hyperlight_host/src/sandbox/trace/context.rs @@ -347,7 +347,7 @@ impl TraceContext { pub(crate) fn setup_guest_trace(&mut self, ctx: Context) { if self.start_instant.is_none() { - crate::debug!("Guest Start Epoch set"); + tracing::debug!("Guest Start Epoch set"); self.start_wall = Some(SystemTime::now()); self.start_tsc = Some(hyperlight_guest_tracing::invariant_tsc::read_tsc()); self.start_instant = Some(std::time::Instant::now()); diff --git a/src/hyperlight_host/src/sandbox/uninitialized.rs b/src/hyperlight_host/src/sandbox/uninitialized.rs index 948a702106..02cb69edb2 100644 --- a/src/hyperlight_host/src/sandbox/uninitialized.rs +++ b/src/hyperlight_host/src/sandbox/uninitialized.rs @@ -165,7 +165,7 @@ impl UninitializedSandbox { pending_file_mappings: Vec::new(), }; - crate::debug!("Sandbox created: {:#?}", sandbox); + tracing::debug!("Sandbox created: {:#?}", sandbox); Ok(sandbox) } diff --git a/src/hyperlight_libc/Cargo.toml b/src/hyperlight_libc/Cargo.toml index 8be580f4b3..26267627db 100644 --- a/src/hyperlight_libc/Cargo.toml +++ b/src/hyperlight_libc/Cargo.toml @@ -13,9 +13,6 @@ This crate provides picolibc for Hyperlight guests. It builds the picolibc library and generates bindings to the libc types and functions. """ -[features] -default = [] - [dependencies] [lints] diff --git a/src/tests/rust_guests/dummyguest/Cargo.toml b/src/tests/rust_guests/dummyguest/Cargo.toml index 6ef29a7417..fca18bf8a6 100644 --- a/src/tests/rust_guests/dummyguest/Cargo.toml +++ b/src/tests/rust_guests/dummyguest/Cargo.toml @@ -11,4 +11,4 @@ hyperlight-common = { path = "../../../hyperlight_common", default-features = fa [features] default = [] trace_guest = ["hyperlight-guest-bin/trace_guest"] -mem_profile = ["hyperlight-common/mem_profile", "hyperlight-guest-bin/mem_profile"] +mem_profile = ["hyperlight-guest-bin/mem_profile"] diff --git a/src/tests/rust_guests/simpleguest/Cargo.toml b/src/tests/rust_guests/simpleguest/Cargo.toml index 456d312194..d683801116 100644 --- a/src/tests/rust_guests/simpleguest/Cargo.toml +++ b/src/tests/rust_guests/simpleguest/Cargo.toml @@ -13,6 +13,6 @@ tracing = { version = "0.1.41", default-features = false, features = ["log", "at [features] default = [] -trace_guest = ["hyperlight-guest-bin/trace_guest", "hyperlight-guest/trace_guest", "hyperlight-guest-tracing/trace"] -mem_profile = ["hyperlight-common/mem_profile", "hyperlight-guest-bin/mem_profile"] +trace_guest = ["hyperlight-guest-bin/trace_guest"] +mem_profile = ["hyperlight-guest-bin/mem_profile"] diff --git a/src/tests/rust_guests/witguest/Cargo.toml b/src/tests/rust_guests/witguest/Cargo.toml index d1fe284643..51b75f0f4b 100644 --- a/src/tests/rust_guests/witguest/Cargo.toml +++ b/src/tests/rust_guests/witguest/Cargo.toml @@ -12,5 +12,5 @@ spin = "0.12.0" [features] default = [] -trace_guest = ["hyperlight-guest-bin/trace_guest", "hyperlight-guest/trace_guest"] -mem_profile = ["hyperlight-common/mem_profile", "hyperlight-guest-bin/mem_profile"] +trace_guest = ["hyperlight-guest-bin/trace_guest"] +mem_profile = ["hyperlight-guest-bin/mem_profile"]