A Rust implementation of a Debian package builder for ROS Colcon repositories. This tool builds .deb packages for all packages in a ROS workspace, executing the build process in controlled Docker containers.
- 🚀 Fast parallel builds - Leverages Rust's async runtime for maximum performance
- 🐳 Docker isolation - Builds run in containers for reproducibility
- 🔧 Cross-architecture support - Build ARM64 packages on AMD64 hosts
- 📦 APT repository generation - Creates ready-to-use Debian repositories
- 🛡️ Security-first design - Non-root builds with minimal privileges
- 🔄 Incremental builds - Smart caching for faster rebuilds
The system uses a split architecture:
-
Host Application (Rust) - Orchestrates the build process
- Reads YAML configuration
- Manages Docker containers
- Monitors build progress
- Collects generated artifacts
-
Container Environment - Executes the actual builds
- Uses rust-script for cross-architecture compatibility
- Runs colcon build (handles all dependency ordering)
- Creates .deb packages in parallel
- Generates APT repository metadata
- Rust 1.75 or later
- Docker
- cargo-nextest (for testing)
# Clone the repository
git clone https://github.com/your-org/colcon-deb
cd colcon-deb
# Install development tools
make install-tools
# Build the project
make build-release
# Install the binary
make install- Create a configuration file:
# colcon-deb.yaml
colcon_repo: /path/to/your/ros/workspace
debian_dirs: /path/to/debian/configs
docker:
image: ros:humble-ros-base
output_dir: ./output
parallel_jobs: 4- Build packages:
colcon-deb build --config colcon-deb.yamlThe tool requires three main configuration items:
colcon_repo: Path to your ROS workspace (must containsrc/directory)debian_dirs: Directory containing custom Debian configurations per packagedocker: Either an existing image or path to a Dockerfile
# Required fields
colcon_repo: ${HOME}/my_ros_ws
debian_dirs: ${HOME}/my_debian_dirs
docker:
# Option 1: Use existing image
image: ros:humble-ros-base
# Option 2: Build from Dockerfile
# dockerfile: ./docker/Dockerfile.humble
# Optional fields
ros_distro: humble # Auto-detected if not specified
output_dir: ./output
parallel_jobs: 8colcon-deb/
├── crates/ # Rust crates (workspace members)
│ ├── colcon-deb-cli/ # CLI application
│ ├── colcon-deb-core/ # Core types and traits
│ ├── colcon-deb-config/ # Configuration management
│ ├── colcon-deb-docker/ # Docker integration
│ ├── colcon-deb-ros/ # ROS package handling
│ ├── colcon-deb-debian/ # Debian packaging
│ └── colcon-deb-build/ # Build orchestration
├── scripts/
│ ├── entrypoint.sh # Container entry script
│ ├── main.sh # Main build script
│ └── helpers/ # rust-script helpers
│ ├── package-scanner.rs
│ ├── debian-preparer.rs
│ ├── build-orchestrator.rs
│ └── progress-reporter.rs
└── tests/
└── test_workspace/ # Example ROS packages for testing
# Debug build
make build
# Release build
make build-release
# Run tests
make test
# Run linting
make lint
# Format code
make formatThe project uses cargo-nextest for testing:
# Run all tests
make test
# Run with coverage
make test-coverage
# Run specific test
cargo nextest run package_name- Fork the repository
- Create a feature branch
- Make your changes
- Run
make checkto ensure code quality - Submit a pull request
- Configuration: The host reads the YAML configuration and validates paths
- Container Setup: Docker container is prepared with necessary tools
- Dependency Installation:
rosdepinstalls system dependencies - Build Phase:
colcon buildcompiles all packages (handles dependency order) - Packaging Phase:
.debfiles are created in parallel for all packages - Repository Generation: APT repository metadata is generated
The key insight is that colcon build already handles all dependency ordering, so after it completes, all packages can be converted to .deb files in parallel.
This project is licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.
- Original Python implementation: colcon-deb-python
- ROS community for the colcon build tool
- Rust async ecosystem (tokio, bollard, etc.)