diff --git a/Cargo.lock b/Cargo.lock index 9e9cbf53..dbec7c49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1246,12 +1246,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.7.4" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +checksum = "754ca22de805bb5744484a5b151a9e1a8e837d5dc232c2d7d8c2e3492edc8b60" dependencies = [ "cfg-if 1.0.4", - "winapi 0.3.9", + "windows-link", ] [[package]] diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 2ee14d73..ecbf8f5b 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] anyhow = "1.0" -libloading = "0.7" +libloading = "0.9" log = "0.4" pretty_env_logger = "0.4" serde = "1" diff --git a/crates/cli/src/benchmark.rs b/crates/cli/src/benchmark.rs index 05f888ea..0ca707f3 100644 --- a/crates/cli/src/benchmark.rs +++ b/crates/cli/src/benchmark.rs @@ -311,6 +311,12 @@ impl BenchmarkCommand { drop((engine, module)); all_measurements.extend(measurements.finish()); } + + // Explicitly close the library to handle any unload errors. + // We log errors but don't fail since measurements have been collected. + if let Err(e) = lib.close() { + log::warn!("Error unloading library: {e}"); + } } // If we are only benchmarking one phase then filter out any diff --git a/crates/recorder/Cargo.toml b/crates/recorder/Cargo.toml index 2f0106f1..cebef5b0 100644 --- a/crates/recorder/Cargo.toml +++ b/crates/recorder/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] anyhow = "1.0" -libloading = "0.7" +libloading = "0.9" log = "0.4" precision = { git = "https://github.com/posborne/rust-precision.git", branch = "target-stable-asm" } serde = { version = "1.0.118", features = ["derive"] } diff --git a/engines/native/libengine/Cargo.toml b/engines/native/libengine/Cargo.toml index fec0e8e1..19a982fe 100644 --- a/engines/native/libengine/Cargo.toml +++ b/engines/native/libengine/Cargo.toml @@ -9,6 +9,6 @@ crate-type = ["rlib", "cdylib"] [dependencies] anyhow = "1.0.22" -libloading = "0.7" +libloading = "0.9" nix = "0.26.2" -libc="0.2" \ No newline at end of file +libc="0.2"