Skip to main content

colcon-cargo

CI

An extension for colcon-core to support Rust projects built with Cargo.

Install

$ pip3 install --user --upgrade git+https://github.com/colcon/colcon-cargo.git

Usage / Minimal example

Build a sample workspace
$ mkdir ws/
$ cd ws/
$ cargo init hello_world
$ cargo init hello_world2
$ tree .

.
├── hello-world
│   ├── Cargo.toml
│   └── src
│       └── main.rs
└── hello-world2
    ├── Cargo.toml
    └── src
        └── main.rs

4 directories, 4 files

Verify that cargo detects the Rust packages:

$ colcon list

hello-world     hello-world     (cargo)
hello-world2    hello-world2    (cargo)

Build them with Cargo:

$ colcon build

Starting >>> hello_world
Starting >>> hello_world_2
Finished <<< hello_world_2 [1.84s]
Finished <<< hello_world [1.94s]

Summary: 2 packages finished [2.34s]

Source the generated install/ directory and execute:

$ source install/setup.bash
$ hello-world

Hello, world!

$ hello-world2

Hello, world!

Testing

Test the packages with cargo:

$ colcon test
Starting >>> hello_world_2
Starting >>> hello_world
Finished <<< hello_world [0.24s]                                           
Finished <<< hello_world_2 [0.25s]

Summary: 2 packages finished [0.39s]

Inspect the test results (cargo test and cargo fmt --check). They should all succeed for the empty templates:

$ colcon test-result --all
build/hello_world_2/cargo_test.xml: 2 tests, 0 errors, 0 failures, 0 skipped
build/hello_world/cargo_test.xml: 2 tests, 0 errors, 0 failures, 0 skipped

Summary: 4 tests, 0 errors, 0 failures, 0 skipped

Metadata

Release files for colcon-cargo 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for colcon-cargo 0.2.0
File Size Uploaded
colcon_cargo-0.2.0.tar.gz 18.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for colcon-cargo 0.2.0
File Interpreter ABI Platform
colcon_cargo-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 37.2 kB

Release files / colcon_cargo-0.2.0.tar.gz

Download URL colcon_cargo-0.2.0.tar.gz
Size 18.7 kB
Tags Source
SHA-256 checksum
How to use checksums
13ae86e397aa074d39e8fad2dd5e3e4297ccbd81d57b7137bd082d1646fc78a0
BLAKE2b-256 checksum
How to use checksums
77d9ce36a051964f0a85694448f5e62430d20f6412145830f8ed2de229f4f5c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/59.8.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

Release files / colcon_cargo-0.2.0-py3-none-any.whl

Download URL colcon_cargo-0.2.0-py3-none-any.whl
Size 18.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0647c438feccd4d304e68799207eba9f671aede438ae803ec0f82e8e0120bce7
BLAKE2b-256 checksum
How to use checksums
aecce32fcd759b8d8a0dae25a0b69ce634d59fce9f084aa51e67ac4f048f4489
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/59.8.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page