Specifying non-linear version range for dependencies?

I'm wondering if specifying non-linear version ranges for a dependency is possible in Cargo.

I'm developing a library that has a dependency on library foo which manages a legacy (1.0) and stable (1.1) channel. Recently, a bug was found in the foo library and they had to change public APIs to mitigate this issue. Let's say the fix became live in 1.0.x and 1.1.y.

Now, I would like to specify that my library works for foo with version ranges (>= 1.0.x, < 1.1.0) and (>= 1.1.y). How can I express this in Cargo?

I don't think this is possible.

If foo had used distinct, incompatible semantic ranges, then you might be able to let both coexist as optional dependencies in your crate, depending on how you use it. But there's no way to split the 1.* semver-compatible range.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.