Skip to content

Commit

Permalink
Removed leaky dependency to codegen from ros1 by moving md5sum stuff …
Browse files Browse the repository at this point in the history
…up to common
  • Loading branch information
carter committed Dec 10, 2024
1 parent 331f291 commit cb36a65
Show file tree
Hide file tree
Showing 8 changed files with 780 additions and 774 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

770 changes: 1 addition & 769 deletions roslibrust_codegen/src/lib.rs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions roslibrust_common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ edition = "2021"
thiserror = "2.0"
anyhow = "1.0"
serde = { version = "1.0", features = ["derive"] }
# Used for md5sum calculation
md5 = "0.7"

# THESE DEPENDENCIES WILL BE REMOVED
# We're currently leaking these error types in the "generic error type"
Expand Down
4 changes: 4 additions & 0 deletions roslibrust_common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,7 @@ impl RosMessageType for ShapeShifter {
const MD5SUM: &'static str = "*";
const DEFINITION: &'static str = "";
}

/// Contains functions for calculating md5sums of message definitions
/// These functions are needed both in roslibrust_ros1 and roslibrust_codegen so they're in this crate
pub mod md5sum;
769 changes: 769 additions & 0 deletions roslibrust_common/src/md5sum.rs

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions roslibrust_ros1/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ edition = "2021"
[dependencies]
# Provides common types and traits used throughout the roslibrust ecosystem.
roslibrust_common = { path = "../roslibrust_common" }
# TODO we'd like to remove this dependency? Don't love these are crosslinked
roslibrust_codegen = { path = "../roslibrust_codegen" }

# Should probably become workspace members:
tokio = { version = "1.41", features = ["rt-multi-thread", "sync", "macros"] }
Expand Down
2 changes: 1 addition & 1 deletion roslibrust_ros1/src/node/actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ impl NodeServerHandle {

let md5sum;
let md5sum_res =
roslibrust_codegen::message_definition_to_md5sum(topic_type, msg_definition);
roslibrust_common::md5sum::message_definition_to_md5sum(topic_type, msg_definition);
match md5sum_res {
// TODO(lucasw) make a new error type for this?
Err(err) => {
Expand Down
3 changes: 2 additions & 1 deletion roslibrust_test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ edition = "2021"
env_logger = "0.10"
roslibrust = { path = "../roslibrust", features = ["ros1"] }
roslibrust_common = { path = "../roslibrust_common" }
# TODO this shouldn't need to be here!
# This crate does directly invoke codegen and does need to rely on it directly
# We can fix this by moving the generated types into a roslibrust_ros1_types crate
roslibrust_codegen = { path = "../roslibrust_codegen" }
lazy_static = "1.4"
tokio = { version = "1.20", features = ["net", "sync"] }
Expand Down

0 comments on commit cb36a65

Please sign in to comment.