@@ -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)
221220fn 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" ) ;
@@ -262,7 +250,10 @@ fn find_roslibrust_assets() -> PathBuf {
262250 }
263251 }
264252
265- // Fallback: return the local path anyway, it will fail gracefully if it doesn't exist
266- println ! ( "cargo:warning=Could not find roslibrust assets, packages may not be available" ) ;
267- local_path
253+ // Fallback: panic with helpful error message
254+ panic ! (
255+ "Could not find roslibrust assets directory!\n \
256+ Make sure roslibrust is specified as a git dependency in Cargo.toml.\n \
257+ The build system searches: ~/.cargo/git/checkouts/roslibrust-*/*/assets/"
258+ ) ;
268259}
0 commit comments