Skip to content

Commit f852cd1

Browse files
committed
refactor(ros-z-msgs): remove the path of local roslibrust
1 parent fa3179a commit f852cd1

2 files changed

Lines changed: 5 additions & 18 deletions

File tree

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,12 @@ nix develop .#noRos-ci
108108

109109
**Note on `ros-z-msgs`:** This package can build without ROS installed! When
110110
ROS is not available, it automatically falls back to using bundled message
111-
definitions from the roslibrust repository. The build system searches for ROS
112-
packages in this order:
111+
definitions from the roslibrust git dependency. The build system searches for
112+
ROS packages in this order:
113113

114114
1. System ROS installation (via `AMENT_PREFIX_PATH` or `CMAKE_PREFIX_PATH`)
115115
2. Common ROS installation paths (`/opt/ros/{rolling,jazzy,iron,humble}`)
116-
3. Local roslibrust checkout (`../../roslibrust/assets/`)
117-
4. Roslibrust git dependency (`~/.cargo/git/checkouts/roslibrust-*/assets/`)
116+
3. Roslibrust git dependency (`~/.cargo/git/checkouts/roslibrust-*/assets/`)
118117

119118
This allows `ros-z-msgs` to generate message types even in environments without
120119
ROS 2 installed. The default `common_interfaces` feature includes `std_msgs`,

ros-z-msgs/build.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -215,22 +215,10 @@ fn discover_bundled_packages(bundled_packages: &[&str]) -> Result<Vec<PathBuf>>
215215
Ok(ros_packages)
216216
}
217217

218-
/// Find roslibrust assets directory
219-
/// This works with both git dependencies and local paths
218+
/// Find roslibrust assets directory from git dependency
220219
/// Returns the base assets directory (not ros2_common_interfaces subdirectory)
221220
fn find_roslibrust_assets() -> PathBuf {
222-
// First, try the local path (for development)
223-
let local_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../../roslibrust/assets");
224-
225-
if local_path.exists() {
226-
println!(
227-
"cargo:warning=Using local roslibrust assets at {}",
228-
local_path.display()
229-
);
230-
return local_path;
231-
}
232-
233-
// For git dependencies, search in cargo's git checkout directory
221+
// Search in cargo's git checkout directory
234222
// The path will be something like: ~/.cargo/git/checkouts/roslibrust-{hash}/{commit}/assets
235223
if let Ok(home) = env::var("CARGO_HOME").or_else(|_| env::var("HOME")) {
236224
let cargo_git = PathBuf::from(home).join(".cargo/git/checkouts");

0 commit comments

Comments
 (0)