Workspace Management Overview
ROC includes a comprehensive workspace management system that serves as a modern, high-performance replacement for colcon. The roc work
command provides a complete suite of tools for ROS2 workspace management, including package creation, discovery, dependency resolution, and building.
Key Features
Complete Colcon Replacement
ROC's build system (roc work build
) is designed as a drop-in replacement for colcon build
with the following advantages:
- Native Performance: Written in Rust for superior performance and memory safety
- Parallel Execution: Multi-threaded builds with intelligent dependency resolution
- Environment Isolation: Clean environment management preventing build contamination
- Comprehensive Logging: Detailed build logs and error reporting
- Full Compatibility: Supports all major colcon command-line options
Package Management
- Intelligent Discovery: Automatic workspace scanning and package.xml parsing
- Metadata Extraction: Complete package information including dependencies, maintainers, and build types
- Build Type Support: Full support for ament_cmake, ament_python, and cmake packages
- Dependency Validation: Circular dependency detection and resolution
Development Workflow
- Package Creation: Intelligent wizard for creating properly structured ROS2 packages
- Build Optimization: Incremental builds and parallel execution
- Environment Setup: Automatic generation of setup scripts for workspace activation
Architecture
The workspace management system is built on several core components:
- Package Discovery Engine: Recursively scans workspace directories for
package.xml
files - Dependency Graph Resolver: Builds and validates package dependency graphs
- Build Executor: Manages parallel build execution with proper environment isolation
- Environment Manager: Handles environment variable setup and setup script generation
Command Structure
roc work <subcommand> [options]
Available Subcommands
build
- Build packages in the workspace (colcon replacement)create
- Create new ROS2 packages with templateslist
- List and discover packages in the workspaceinfo
- Display detailed package information
Compatibility
ROC's workspace system is designed to be fully compatible with existing ROS2 workflows:
- Colcon Arguments: All major colcon build options are supported
- Package Formats: Supports package.xml formats 2 and 3
- Build Systems: Works with ament_cmake, ament_python, and plain cmake
- Environment: Generates standard ROS2 setup scripts compatible with existing tools
Performance Benefits
Compared to colcon, ROC provides:
- Faster Startup: Native binary with minimal overhead
- Better Parallelization: More efficient worker thread management
- Memory Efficiency: Lower memory usage during builds
- Cleaner Environment: Better isolation prevents build environment pollution
- Superior Error Handling: More detailed error messages and recovery options
The following sections provide detailed information about each component of the workspace management system.