From b1a0abc7a6a64010236db0902a19ab4702414c6d Mon Sep 17 00:00:00 2001 From: Jack May Date: Mon, 20 Apr 2020 16:46:06 -0700 Subject: [PATCH] Bump libloading to v0.6.1 (#9615) automerge --- Cargo.lock | 11 ++++++++++- runtime/Cargo.toml | 2 +- runtime/src/native_loader.rs | 10 +++++----- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 229d23a3d2..483dce44e0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1959,6 +1959,14 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "libloading" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "librocksdb-sys" version = "6.2.4" @@ -4519,7 +4527,7 @@ dependencies = [ "itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", - "libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libloading 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -6528,6 +6536,7 @@ dependencies = [ "checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" "checksum libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)" = "99e85c08494b21a9054e7fe1374a732aeadaff3980b6990b94bfd3a70f690005" "checksum libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" +"checksum libloading 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3c4f51b790f5bdb65acb4cc94bb81d7b2ee60348a5431ac1467d390b017600b0" "checksum librocksdb-sys 6.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "0a0785e816e1e11e7599388a492c61ef80ddc2afc91e313e61662cce537809be" "checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" "checksum lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "62ebf1391f6acad60e5c8b43706dde4582df75c06698ab44511d15016bc2442c" diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 6856aaf2f4..064845ec60 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -17,7 +17,7 @@ fs_extra = "1.1.0" itertools = "0.9.0" lazy_static = "1.4.0" libc = "0.2.69" -libloading = "0.5.2" +libloading = "0.6.1" log = "0.4.8" memmap = "0.7.0" num-derive = { version = "0.3" } diff --git a/runtime/src/native_loader.rs b/runtime/src/native_loader.rs index 903b62b36d..0c8c7dc352 100644 --- a/runtime/src/native_loader.rs +++ b/runtime/src/native_loader.rs @@ -81,17 +81,17 @@ impl NativeLoader { } #[cfg(windows)] - fn library_open(path: &PathBuf) -> std::io::Result { + fn library_open(path: &PathBuf) -> Result { Library::new(path) } #[cfg(not(windows))] - fn library_open(path: &PathBuf) -> std::io::Result { + fn library_open(path: &PathBuf) -> Result { // Linux tls bug can cause crash on dlclose(), workaround by never unloading Library::open(Some(path), libc::RTLD_NODELETE | libc::RTLD_NOW) } - fn invoke_entrypoint( + fn get_entrypoint( name: &str, cache: &RwLock>>, ) -> Result, InstructionError> { @@ -141,11 +141,11 @@ impl NativeLoader { trace!("Call native {:?}", name); if name.ends_with("loader_program") { let entrypoint = - Self::invoke_entrypoint::(name, &self.loader_symbol_cache)?; + Self::get_entrypoint::(name, &self.loader_symbol_cache)?; unsafe { entrypoint(program.unsigned_key(), params, instruction_data) } } else { let entrypoint = - Self::invoke_entrypoint::(name, &self.program_symbol_cache)?; + Self::get_entrypoint::(name, &self.program_symbol_cache)?; unsafe { entrypoint(program.unsigned_key(), params, instruction_data) } } }