-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Minimal versions build #5757
Minimal versions build #5757
Conversation
r? @matklad (rust_highfive has picked a reviewer for you, use r? to override) |
Tests are failing with minimal versions, but at least cargo builds with minimal versions. Yay! We could leave out the test run as a first step and just ensure that cargo builds? How good/fast are you in tracking down the test fails to the responsible dependency that is broken in its minimal version? :-D |
I just pushed a commit that replaces Now I am digging into the windows problems, which I can reproduce locally. |
Good news, I have a Cargo.toml that passes The bad news, one of the things I needed to pin is |
A lot can be removed. Then I looked into what was importing each of the problem crates and a bunch more can be removed by bumping to the latest version of the thing we use. Importantly the thing that need |
.travis.yml
Outdated
@@ -32,6 +32,9 @@ matrix: | |||
install: | |||
- mdbook --help || cargo install mdbook --force | |||
script: | |||
- cargo +nightly generate-lockfile -Z minimal-versions | |||
- cargo check --tests | |||
- cargo +nightly generate-lockfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our "best practices" I think for this was to set this on a new travis matrix entry with the minimum supported Rust version, right? Should that be done here?
I'm somewhat hesitant to do this for Cargo though in the sense that we don't really have a minimum supported Rust version, it's always stable and forward for Cargo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya I was figuring that since we don't have a MRV we could just combine it.
Cargo.toml
Outdated
@@ -55,6 +54,9 @@ toml = "0.4.2" | |||
url = "1.1" | |||
clap = "2.31.2" | |||
unicode-width = "0.1.5" | |||
libssh2-sys = "0.2.8" | |||
libgit2-sys = "0.7.5" | |||
gcc = "0.3.23" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could a comment be added saying that some of these deps are synthetic? Also I think gcc
should be in [build-dependencies]
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good thought. I added comments.
Do others on @rust-lang/cargo have thoughts on whether or not we should add this to CI? My worry is that we will spend a good deal of time maintaining this for Cargo without much benefit. Cargo itself will always compile on the latest stable/beta/nightly, but that's all we guaranteed and I think all that we really need to guarantee. Cargo is primarily a project for I'm curious what others think though! |
@alexcrichton This seems like its about cargo's library dependencies being accurate (e.g. saying it depends on libc That said, I think the fact that making cargo's minimum versions accurate is so difficult is not a great sign for the |
I don't think the benefits are small: if you have I see cargo itself as a role model for other Rust crates. If we can make it work here (in this relatively large project) then that sends a signal that If it turns out that |
Cargo.toml
Outdated
|
||
[target.'cfg(windows)'.dev-dependencies] | ||
gcc = "0.3.23" # required only for minimal-versions on windows. brought in by flate2 and others. | ||
cmake = "0.1.24" # required only for minimal-versions on windows. brought in as build-dependencie on libgit2-sys. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo "build-dependencie"
I am not on the cargo team, but here are my 2c anyway.
Since I started typing, @withoutboats yes, agreed. But we don't know how hard it is to maintain, we haven't tried yet. |
Ah yes good points @klausi and @Eh2406! And yeah @withoutboats to be clear (which I don't think I was!) I'm speculating right now that it'll be difficult to maintain this, although I'm not certain. In light of that though I think it makes sense to try it out here and see what happens! @Eh2406 if you want to make this a separate Travis and AppVeyor builder, should be good to go! |
I edited my post to avoid saying the benefits are small, because its not exactly that I think they are small. I think there's a trade off between increasing the maintenance burden on library authors and making niche uses easier. Its not a backwards compatibility or stability issue: the problem is that if someone ceilings their version, say But putting a ceiling on your dependency version is uncommon and discouraged by cargo's design. If its relatively easy for everyone to run Anyway, that's what testing it in cargo is all about. If our dogfooding shows that its burdensome, we'll keep that in mind when making recommendations about what other libraries should do. |
Travis is a separate builder. Trying to figure out how to shoehorn AppVeyor matrix into this use case. Suggestions/Pointers very welcome! |
I got it working! @alexcrichton how does that look? |
.travis.yml
Outdated
@@ -26,6 +26,13 @@ matrix: | |||
ALT=i686-unknown-linux-gnu | |||
rust: beta | |||
|
|||
- env: TARGET=x86_64-unknown-linux-gnu | |||
ALT=i686-unknown-linux-gnu | |||
rust: nightly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should list an explicit Rust version, right? (the minimum supported rust version?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For projects that have a msrv. But as you pointed out cargo doesn't. Maybe stable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sure yeah Cargo technically doesn't but if we want to emulate "best practices" here then I think we should probably attempt it here as well. For now I'd just pick 1.27 as the current stable
Cargo.toml
Outdated
git2-curl = "0.8.1" | ||
libgit2-sys = "0.7.5" # required only for minimal-versions. brought in by git2 and git2-curl. | ||
libssh2-sys = "0.2.8" # required only for minimal-versions. brought in by libgit2-sys. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I published new versions of libgit2/git2-rs, so could those new versions be used instead of adding synthetic deps here?
So small hiccup. @alexcrichton pointed out that we can bump |
94e3dbd
to
2797f6c
Compare
Ok sure thing, published new versions of |
Done ❗️ Thanks! While we are using |
@bors: r+ Looks great! |
📌 Commit 4a8c70e has been approved by |
☀️ Test successful - status-appveyor, status-travis |
run some tests with minimal-versions on CI In #5757 we discovered that sum test don't pass with minimal-versions, and so only added CI for `cargo check`. This PR is to see if that is still needed, and if it is then which test rely on upstream bugfix.
This is a conceptual rebase of #5275, to reiterate:
Big thanks to @klausi for doing most of the work!
Thanks to @matklad for pointing out that we could finish it.
I don't know if I have the Travis config quite correct, advice definitely wellcome!
edit: closes #5275