Skip to content

Add version constraints to cargo dependencies#70

Draft
cottsay wants to merge 1 commit into
mainfrom
cottsay/versions
Draft

Add version constraints to cargo dependencies#70
cottsay wants to merge 1 commit into
mainfrom
cottsay/versions

Conversation

@cottsay

@cottsay cottsay commented Feb 7, 2026

Copy link
Copy Markdown
Member

This change brings support for reading the version constraints from the dependencies specified in Cargo.toml manifests. It supports the full range of syntax with the exception of complex wildcards such as 1.*.3.

The behavior enabled by this change aligns colcon-cargo with other build system extensions, and will notify the user with a warning during a build where an incompatible version of a package is present in a workspace which has one or more other packages requiring a different version of it.

Example message:

colcon.colcon_core.package_augmentation.check_dependency_constraint WARNING cargo-package-a depends on cargo-package-b which has version 1.1.0 but expects it to be greater than or equal to 1.3.0

https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#version-requirement-syntax

@cottsay cottsay self-assigned this Feb 7, 2026
@cottsay cottsay added the enhancement New feature or request label Feb 7, 2026
@codecov-commenter

codecov-commenter commented Feb 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.76%. Comparing base (518a4f9) to head (307bb25).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #70      +/-   ##
==========================================
+ Coverage   72.46%   75.76%   +3.30%     
==========================================
  Files           9        9              
  Lines         345      392      +47     
  Branches       60       73      +13     
==========================================
+ Hits          250      297      +47     
  Misses         61       61              
  Partials       34       34              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cottsay cottsay force-pushed the cottsay/versions branch 2 times, most recently from 2a183a1 to 608c8a5 Compare February 18, 2026 22:25
This change brings support for reading the version constraints from the
dependencies specified in Cargo.toml manifests. It supports the full
range of version syntax accepted by cargo.

The behavior enabled by this change aligns colcon-cargo with other build
system extensions, and will notify the user with a warning during a
build where an incompatible version of a package is present in a
workspace which has one or more other packages requiring a different
version of it.
@cottsay cottsay requested a review from Blast545 February 25, 2026 03:44
@cottsay cottsay marked this pull request as draft March 26, 2026 20:35

@Blast545 Blast545 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I don't think it covers the 100% of cases, but I wouldn't block on that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants