diff --git a/Cargo.lock b/Cargo.lock index ae5011bab..fdda9afcc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -965,7 +965,6 @@ dependencies = [ "psutil", "rand 0.8.5", "ratatui", - "rmp-serde", "rmpv", "serde", "serde-tuple-vec-map", @@ -1885,17 +1884,6 @@ dependencies = [ "paste 1.0.14", ] -[[package]] -name = "rmp-serde" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bffea85eea980d8a74453e5d02a8d93028f3c34725de143085a844ebe953258a" -dependencies = [ - "byteorder", - "rmp", - "serde", -] - [[package]] name = "rmpv" version = "1.0.1" @@ -2208,7 +2196,6 @@ dependencies = [ "priority-queue", "psutil", "rand 0.8.5", - "rmp-serde", "serde", "serde_bytes", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index d2000bb2f..cd41bae1e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,6 @@ bincode = "1" futures = "0.3" tokio-util = "0.7" byteorder = "1" -rmp-serde = "1" hex = "0.4" rand = "0.8" gethostname = "0.4" diff --git a/crates/hyperqueue/Cargo.toml b/crates/hyperqueue/Cargo.toml index b122b12cf..039e6aa29 100644 --- a/crates/hyperqueue/Cargo.toml +++ b/crates/hyperqueue/Cargo.toml @@ -16,11 +16,10 @@ tokio = { workspace = true, features = ["full"] } tokio-util = { workspace = true, features = ["codec"] } clap = { workspace = true, features = ["derive", "env"] } clap_complete = { workspace = true } -rmp-serde = { workspace = true} serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } serde_bytes = { workspace = true } -bytes = {workspace = true } +bytes = { workspace = true } thiserror = { workspace = true } gethostname = { workspace = true } chrono = { workspace = true, features = ["serde"] } @@ -29,7 +28,7 @@ hex = { workspace = true } bincode = { workspace = true } smallvec = { workspace = true } rand = { workspace = true } -anyhow = { workspace = true } +anyhow = { workspace = true } tempdir = { workspace = true } nix = { workspace = true } bstr = { workspace = true } @@ -44,7 +43,7 @@ serde-tuple-vec-map = "1" dirs = "5.0" rmpv = { version = "1.0", features = ["with-serde"] } nom = "7.1" -nom-supreme = { version = "0.8"} +nom-supreme = { version = "0.8" } colored = "2" const_format = "0.2" textwrap = "0.16" diff --git a/crates/hyperqueue/src/common/error.rs b/crates/hyperqueue/src/common/error.rs index 743cddd1f..f08b4f568 100644 --- a/crates/hyperqueue/src/common/error.rs +++ b/crates/hyperqueue/src/common/error.rs @@ -30,17 +30,6 @@ impl From for HqError { } } -impl From for HqError { - fn from(e: rmp_serde::encode::Error) -> Self { - Self::SerializationError(e.to_string()) - } -} -impl From for HqError { - fn from(e: rmp_serde::decode::Error) -> Self { - Self::SerializationError(e.to_string()) - } -} - impl From for HqError { fn from(error: anyhow::Error) -> Self { Self::GenericError(error.to_string()) diff --git a/crates/hyperqueue/src/server/event/log/read.rs b/crates/hyperqueue/src/server/event/log/read.rs index 3fb042204..c5424d5e1 100644 --- a/crates/hyperqueue/src/server/event/log/read.rs +++ b/crates/hyperqueue/src/server/event/log/read.rs @@ -102,7 +102,7 @@ mod tests { let path = tmpdir.path().join("foo"); { let mut file = File::create(&path).unwrap(); - rmp_serde::encode::write(&mut file, "hqjl0000").unwrap(); + file.write_all("hqjlxxxx".as_bytes()).unwrap(); file.flush().unwrap(); } assert!(EventLogReader::open(&path).is_err()); diff --git a/crates/tako/Cargo.toml b/crates/tako/Cargo.toml index d8d80d886..194408b25 100644 --- a/crates/tako/Cargo.toml +++ b/crates/tako/Cargo.toml @@ -14,7 +14,6 @@ tokio-util = { workspace = true, features = ["codec"] } bytes = { workspace = true } byteorder = { workspace = true } smallvec = { workspace = true, features = ["serde"] } -rmp-serde = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_bytes = { workspace = true } serde_json = { workspace = true } diff --git a/crates/tako/src/internal/common/error.rs b/crates/tako/src/internal/common/error.rs index 2d927ae53..071caf60c 100644 --- a/crates/tako/src/internal/common/error.rs +++ b/crates/tako/src/internal/common/error.rs @@ -18,16 +18,6 @@ impl From for DsError { Self::SerializationError(e.to_string()) } } -impl From for DsError { - fn from(e: rmp_serde::encode::Error) -> Self { - Self::SerializationError(e.to_string()) - } -} -impl From for DsError { - fn from(e: rmp_serde::decode::Error) -> Self { - Self::SerializationError(e.to_string()) - } -} impl From for DsError { fn from(e: psutil::Error) -> Self { Self::GenericError(e.to_string()) diff --git a/crates/tako/src/internal/tests/integration/utils/task.rs b/crates/tako/src/internal/tests/integration/utils/task.rs index eb655b247..52b0b69a4 100644 --- a/crates/tako/src/internal/tests/integration/utils/task.rs +++ b/crates/tako/src/internal/tests/integration/utils/task.rs @@ -1,3 +1,4 @@ +use bincode::Options; use std::path::PathBuf; use std::time::Duration; @@ -99,7 +100,9 @@ pub fn build_task_def_from_config( stdin: vec![], cwd, }; - let body = rmp_serde::to_vec(&program_def).unwrap(); + let body = bincode::DefaultOptions::new() + .serialize(&program_def) + .unwrap(); let conf = SharedTaskConfiguration { resources: ResourceRequestVariants { diff --git a/crates/tako/src/internal/tests/integration/utils/worker.rs b/crates/tako/src/internal/tests/integration/utils/worker.rs index de77e9830..cb1d9880d 100644 --- a/crates/tako/src/internal/tests/integration/utils/worker.rs +++ b/crates/tako/src/internal/tests/integration/utils/worker.rs @@ -1,3 +1,4 @@ +use bincode::Options; use std::net::{Ipv4Addr, SocketAddr}; use std::path::PathBuf; use std::sync::Arc; @@ -273,7 +274,9 @@ impl TaskLauncher for TestTaskLauncher { ctx.allocation(), ctx.body().len(), ); - rmp_serde::from_slice(ctx.body())? + bincode::DefaultOptions::new() + .deserialize(ctx.body()) + .map_err(|_| DsError::GenericError("Body deserialization failed".into()))? }; Ok(TaskLaunchData::from_future(Box::pin(async move {