Recently, one of my users reported a compilation failure with my package. I have noticed I relied on a feature of dbus package introduced in 0.9.1 while I specified dbus = "0.9" in my Cargo.toml.
Is there a way to compile my project with a oldest possible versions of the dependencies so I know that my dependencies are correct?
I have also get another issue with clap. My Cargo.toml specifies clap = "2.0", but on older rust editions, clap >= 2.28 does not compile. I have not find any easy way to enforce the version of a dependency. Finally, I have changed my dependency in clap = "2.0, < 2.28". I am not very satisfied of the workaround: the user of newer rust edition still use an outdated version of clap.
I believe that clap has made a mistake when declaring the minimal supported edition, but it is now too late to fix it. If they have had a tool to check their requirements maybe it didn't happen. What do you think?
Globally, does anyone have some recipe to deal with that issues?
Please don't do this. If users of your crate need an older version they can force the version themself. Using an upperbound will make it impossible to use your crate if they also happen to depend on 2.y where y >= 28 as cargo doesn't allow more than one semver compatible version of a crate to be used inside a workspace.
Is your crate a library or an application? The other responders seem (I apologize if I misunderstand) to be assuming that it is a library, but it seems unusual for a library to depend on clap.
A library of mine did once depend on clap, but that was strange and I don't think I approve of it in hindsight.