Skip to main content

Extension for colcon to support Ament Cargo packages.

Project description

colcon-ros-cargo

Build cargo projects with colcon.

Usage

Packages need to have a package.xml in addition to Cargo.toml. You should see such packages classified as ament_cargo in the output of colcon list. If they are classified as ros.ament_cargo instead, the colcon-ros-cargo extension has not been found by colcon. Make sure that you have built and loaded (source install/setup.bash) the extension.

Simply list dependencies (other ament_cargo packages or message packages) in Cargo.toml and package.xml as if they were hosted on crates.io. colcon-ros-cargo will find the dependencies and create a .cargo/config.toml file that helps cargo find these packages.

Extra arguments to cargo can be passed via the --cargo-args option, e.g. colcon build --cargo-args --release.

After building, run binaries with ros2 run.

colcon-ros-cargo also aims to support using cargo directly as the primary build tool. Just build with colcon once, to make sure all non-Cargo dependencies are built and the .cargo/config.toml file exists, and then using cargo will just work – cargo build, cargo clippy, cargo doc, etc. When the dependency graph changes, rebuild with colcon.

Limitations

This is by far not a perfect build system.

Notably, there is quadratic build cost as a function of the dependency chain length. To illustrate this, assume there are packages A, B and C, where C depends on B and B depends on A. If colcon builds this workspace, it builds A first, then B, then C. However, Cargo will also build all the dependencies, i.e., to build B, Cargo will build A again, and to build C, it will build A and B again.

colcon test is not yet supported.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

colcon_ros_cargo-0.2.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

colcon_ros_cargo-0.2.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file colcon_ros_cargo-0.2.0.tar.gz.

File metadata

  • Download URL: colcon_ros_cargo-0.2.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for colcon_ros_cargo-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ef4b5a08c2513d2ab608fbcee5aaae76c73c44dd25d7de2f2db4f55195977d4f
MD5 faf518b9669d1efb494f89579811910d
BLAKE2b-256 48a60c083c097d6d5e875fd8c8233303f33e16307e6e04dad38db238a2a51818

See more details on using hashes here.

Provenance

The following attestation bundles were made for colcon_ros_cargo-0.2.0.tar.gz:

Publisher: release.yml on colcon/colcon-ros-cargo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file colcon_ros_cargo-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for colcon_ros_cargo-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6faf41fcda00c328a7606fd91e0fdb47065a68c896743fed282b7eff866081ea
MD5 db95da1ddc21d8dccc91be06f5d7896c
BLAKE2b-256 d013ff61c421eb72c74e82d5c3c9927e96434479f2ce6bea086332966a017dcb

See more details on using hashes here.

Provenance

The following attestation bundles were made for colcon_ros_cargo-0.2.0-py3-none-any.whl:

Publisher: release.yml on colcon/colcon-ros-cargo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page