-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix min-versions; add min-version CI check #26
Conversation
I don't see why today's [dependencies]
cortex-m = "=0.7.0"
usb-device = "=0.3.0" run What am I missing? |
Reverting the direct dependencies sadly isn't enough, for a full min-version check the dependencies of dependencies also need to be reverted to their minimal semver compatible version. For It seems that The exact error with
For The error only occurs when running
It seems that |
I yet have to find out what's up with the |
@mciantyre Think I fixed it. It was accidentally using the nightly toolchain to do the main MSRV check, and it seems like there is a bug in the current nightly. |
The previous commits restrict which cortex-m versions a user can build with. This commit demonstrates the issue. From the root of the repo, run the build with cargo build --manifest-path i-need-min-cm/Cargo.toml i-need-min-cm represents a closed source user library. For reasons out of our control, that user really wants to use 0.7.0 of cortex-m. We _could_ allow imxrt-usbd to build with version 0.7.0. We've shown that it works. But we're not letting that build happen.
We're free to introduce a development dependency that requires a minimum Let's focus on I pushed a CI job to demonstrate the concern. Why should we prevent this user from building their firmware, especially when we could support their build? |
OK, I get your point now. I guess in the end this is a convention. If you don't really use the features that caused crates.io gives the recommendation that you should always define the full version. On the one side you might force a user to update a package by specifying a newer version. On the other hand, if you don't specify it, you risk that when the user updates only your package, its dependencies don't get properly updated. It's an opinion thing in the end. For me the big plus is that if a project has a min version check and at some point dependencies break because of their msrv or similar, I can always revert to the min versions and it is guaranteed to work again. Otherwise you need to find the right intermediate versions that work, and for a project with 30+ (indirect) this can be a pain (been there). |
@mciantyre I actually have a good idea that kind of fixes the issues that you have with both of my PRs. What if we combine the two checks? Like, a min-version check on the MSRV. This guarantees that dependencies cannot break the MSRV through updates, and gives the user a known Rust compiler + dependencies version that will work now and always. What do you think? It makes a lot of sense to me that the minimal version of Rust required to build this crate is achieved with the oldest dependency versions. |
Replaced by #28. |
In an ongoing quest of mine to run a min-versions test for
imxrt-uart-panic
, I stumbled across incorrect minimal versions in this crate.I also added a CI check that makes sure versions are updated in the future.