-
Notifications
You must be signed in to change notification settings - Fork 432
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
Test builds with minimal versions #741
Comments
On OSX we actually require a not-yet-released version of Did you find which version of |
I'm on Linux. It looks like But this is likely platform dependent. This test probably needs to be run for each supported target. |
Looks like we actually need I feel like testing the most recent lib version is more important than checking the minimal version; is it really worth having CI runs for each platform (we have several platform-specific deps) to check both? Edit: I have enabled limited testing of min versions for the Edit 2: scratch that; |
Basically, if minimal versions doesn't work, then to me, there's a bug in the dependency specification because it's claiming support for something that doesn't actually work. The ecosystem is having trouble moving to minimal versions though, because it first needs to be adopted by core crates (like
I imagine you might just add it to the end of an existing nightly runner? |
Sure it's a bug, but is it one that's worth fixing? The discussion seems to be here and hasn't reached a conclusion on this issue; additionally the mentioned I will take some steps to address this (I already updated the minimal versions as I think are required in the |
I think your link is broken? In any case, I'm a little confused here. What exactly is preventing the addition of this test to say, the rand crate itself? Is there some hidden burden that I'm missing? I've been using the minimal version check in CI for quite a while and it hasn't been any trouble at all. |
Sorry, fixed. Pushing platform dependencies to |
Thanks! |
Can we please reopen this? If rand doesn't build with its minimal dependencies, then nothing that depends on rand will. According to crates.io, that's 2462 crates. Here's a start: you need to update the bincode dependency from 1.1.2 to 1.1.4 because bincode 1.1.3 and earlier incorrectly set its minimal autocfg dependency. |
Who's "we"? I personally feel like there's more than enough I'm already doing with this project that I want to support this fairly dubious goal. If you want to bump the minimum versions feel free to open PRs (but also don't expect new releases just for these version bumps). |
In this comment, you mention that adding this test is a lot of work. Could you say more about the work you perceive that is involved in adding a minimal version check? |
If a crate says it depends on foo 1.2.3 but it actually requires foo 1.3.0, that's a bug in that crate. |
@nox if a crate "depends" on version 1.2.3, Cargo would (by default) pick the latest 1.2.x version (≥1.2.3). In contrast when talking about patch versions, any x.y.z with a newer x.y.w (w > z) is effectively obsolete. No matter whether the author wishes to still "support" x.y.z or not, Cargo does not even let you patch it. The only direct control an author still has over such a version is to yank it. For better or worse, this means that any |
This is not true, you can always downgrade crates or just not update them, with cargo update -p.
If you say you depend on version 1.2.3 but uses an API from 1.3.0 that’s a bug in your crate.
|
Obviously, and one that the usual CI will pick up already. |
Now I'm confused, that's literally what this issue is asking for and what you are arguing against doing! |
There's a very important difference between patch versions and minor versions. This issue is about testing the minimum supported patch version. I have no issue with PRs updating the required patch version, I just don't wish to add testing. |
No, this issue is about minimal versions. If your crate says it works with 1.2.0 but it actually requires 1.2.1, that's a bug in your crate. |
There is no difference from semver's POV between patch and minor versions on the front of version comparison and compatiblity, backwards compatibility is preserved in both a minor bump or a patch bump. |
But there is a very real difference from the point of view of Cargo:
|
Yes, just like it will select
Real world says otherwise, and sometimes people add entirely new APIs in patch versions and whatnot. No idea what you mentioned yanking though. |
The part I'm confused about the most is that if you already have CI to prevent from depending on 1.2.3 when you actually need 1.3.0, then it costs absolutely nothing more to prevent from depending on 1.2.3 when you actually need 1.2.4: just make a test run with the minimal versions. |
It does? It does. That invalidates that argument I guess.
Any patch version with a newer patch release for the same major.minor. |
On reflection, I believe we should add some testing with minimal versions as requested. I guess at this point I owe @BurntSushi and others an apology for dismissing this request, however I would like to request that arguments be based on evidence (e.g. minimal version testing may have prevented the |
Here are some real-world consequences: because rand does not work with its minimal versions, I can't add a minimal versions check to the nix, blosc-rs, mio-aio, or tokio-file crates. |
Closes rust-random#741 This seems to require a couple of hacks unfortunately.
Fix in #874; a review would be appreciated. Note that I had to add a couple of indirect dependencies to make things work 😬 |
Steps to reproduce:
I think the issue here is that
rand
advertises that it works for all releases oflibc
that are0.2
or newer, but this is actually not the case. So the dependency should be updated to require a newer version of libc.There may be other issues lurking as well, see: crossbeam-rs/crossbeam#312
The regex crate does this check in its CI configuration to make sure its dependency specifications are always correct. See: https://github.com/rust-lang/regex/blob/60d087a23025e045ae754a345b04003c31d83d93/ci/script.sh#L53-L55 --- You might consider doing the same.
The text was updated successfully, but these errors were encountered: