Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upDependencies resolution with `--minimal-versions` #5657
Comments
matklad
added
the
C-tracking-issue
label
Jun 26, 2018
This comment has been minimized.
This comment has been minimized.
|
I would like to cc some persons:
I'd like to see us come to a shared understanding of what we would recommend users do with this feature both at rollout and at steady state in the idealized future.
I think we are all in the middle, and probably closer than we think, we just need to articulate it. To start it off I will propose a position as a strawman, so you can point out where I am wrong. All crates should try |
This comment has been minimized.
This comment has been minimized.
|
I'm currently not that interested in how strongly we should impose this option on the ecosystem. First we should make the minimal-versions option work properly. Not even cargo itself can be compiled with minimal-versions as explored in #5275. Repeating the open points here:
|
This comment has been minimized.
This comment has been minimized.
|
Well one small peace is done. At this time |
This comment has been minimized.
This comment has been minimized.
|
Oh cool, that is good news! The inconsistent crates.io registry is still a problem. @alexcrichton said in #5289 that getting minimal-versions to work smoothly was not a priority then, so he didn't want to mass update the creates.io index. Is that still the assumption? @SimonSapin argued that people will always use old cargo publish versions and by that make the crates.io registry inconsistent again. In order to prevent that we would have to implement server side rules on crates.io to prevent entries without For experimenting I'm maintaining a crates.io registry fork, that I update very irregularly. It has the
|
This comment has been minimized.
This comment has been minimized.
That is one of the questions I think we need to address. :-) Hopefully, @alexcrichton and @matklad will have a chance soon to articulate what there current thoughts are. What we decided to recommend needs to work and fairly smoothly. That means that if there are hard changes that need to be made to make it work then we need to be willing to do them. Correspondingly if we are not willing to make the big changes then we need to recommend something smaller. Big changes may include some or all of:
Recommend something smaller may include some or all of:
|
This comment has been minimized.
This comment has been minimized.
|
I think we'll definitely want to get this working with the main index, and I think we probably just want to keep going as-is, fixing up crates and publishing them as we discover mismatches. In that sense I think it might be good to do some more work to get some of the "base crates" working and then perhaps make a post on internals asking for testers so we can discover new crates and publish new versions |
illicitonion
added a commit
to illicitonion/lmdb-rs
that referenced
this issue
Jun 28, 2018
illicitonion
added a commit
to illicitonion/tokio-signal
that referenced
this issue
Jun 28, 2018
This comment has been minimized.
This comment has been minimized.
illicitonion
commented
Jun 29, 2018
|
I got a non-trivial crate (https://github.com/pantsbuild/pants/tree/c8b42cb52eca9acbca98eaaf9599a47bc7b1f51e/src/rust/engine) compiling with My two big questions from this process are:
|
This comment has been minimized.
This comment has been minimized.
|
@illicitonion nice! Those are indeed good questions too :). You can somewhat force the process by having some crate have a higher version bound (aka requiring |
This comment has been minimized.
This comment has been minimized.
|
Actually I quite like the suggestion,
I don't think "try to send a PR to the crate and get a new version published" reduces the usability, I think it is begging the question "If a transitive dependency is the only problem with an otherwise functioning dependency, and which doesn't respond to PRs, what should people do?". |
matklad
referenced this issue
Jul 13, 2018
Closed
test(travis): Test build with minimal versions #5275
This comment has been minimized.
This comment has been minimized.
|
A snag I've now thought of as well: from time to time crates will break due to language/compiler changes, but we're generally pretty good about ensuring that the most recent version on crates.io always builds and point releases are updated. This means, however, that lots of crates' CI will break when that Rust version is published, because not everyone will say they require the newer version of the crate. |
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton I think that depends on the CI setup. It seems to me that long-term the CI job with However, the day when your MSRV supports
|
This comment has been minimized.
This comment has been minimized.
|
@matklad in the meantime can it be done in one CI job now with |
This comment has been minimized.
This comment has been minimized.
|
Excellent idea @Eh2406! |
This comment has been minimized.
This comment has been minimized.
matklad
referenced this issue
Jul 13, 2018
Open
Add guidance about bumping the minimum required `rustc` version #123
This comment has been minimized.
This comment has been minimized.
|
This is a list of foundational crates with versions that do not build on modern rust. Purging these from tomls is the "startup cost" of getting
I will keep this up to date as I find more, and one day make a |
This comment has been minimized.
This comment has been minimized.
|
So @dwijnand asked me to write up how do figure out what to do when a So hear gose.
|
danburkert
added a commit
to danburkert/lmdb-rs
that referenced
this issue
Aug 4, 2018
mati865
referenced this issue
Aug 12, 2018
Merged
Housekeeping - nothing to see here, move along #90
This was referenced Aug 18, 2018
carllerche
added a commit
to carllerche/tokio-signal
that referenced
this issue
Sep 10, 2018
Eh2406
referenced this issue
Sep 17, 2018
Merged
BUG fuzzing found a bug in the resolver, we need a complete set of conflicts to do backjumping #5988
This comment has been minimized.
This comment has been minimized.
|
As discussed in #6636, dealing with breakage is difficult and can take a large amount of time to diagnose and fix, with questionable benefits. Generally @Eh2406 brought up in the team meeting today an alternate implementation that only enforced minimal versions on direct dependencies. (Essentially forcing |
This comment has been minimized.
This comment has been minimized.
stjepang
commented
Feb 21, 2019
|
We inadvertently broke some crates by publishing a Crossbeam release without checking that it builds with minimal dependencies: crossbeam-rs/crossbeam#312 I'd love to have a minimal-versions check in our CI, but it's impossible to build Crossbeam because the whole crates ecosystem is broken, unfortunately. There are two things we should do, IMO:
|
This comment has been minimized.
This comment has been minimized.
|
Somewhat related to the process outlined by @Eh2406 above... As a prerelease exercise, I maintain and check in a Cargo.lock on a dedicated minimal-versions branch. The maintenance of that lock file isn't pretty, but I'm getting faster at it every time I do it, and I've avoided a few bugs with my own minimum versions thus far. What seems to work best for me is keeping a companion script with a bunch off Then I not-so-Continuously Integration test that branch. Said another way: if you are lucky enough to produce a minimal-version |
bors bot
added a commit
to crossbeam-rs/crossbeam
that referenced
this issue
Mar 10, 2019
Eh2406
referenced this issue
Mar 11, 2019
Closed
Travis CI: allow MINIMAL_VERSIONS build to fail #273
ehuss
referenced this issue
Mar 15, 2019
Merged
Release a jobserver token while locking a file #6748
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I was reading the public private dependencies RFC and I noticed it mentioned this feature:
Just leaving a note here about this because I wasn't aware about that until now, and pub/priv deps might make this issue more relevant. I'm a little uncertain about issuing warnings if |
This comment has been minimized.
This comment has been minimized.
|
I had to remove the minimal version check from We aren't going to get anywhere if core crates refuse to maintain and test correct dependency specifications. I don't know how to convince them to do it either. In the case of |
This comment has been minimized.
This comment has been minimized.
|
@BurntSushi yea, I think this feature is dead as-is for now. Someone needs to implement minimal-versions-for-me-but-not-my-dependencies and see how it goes from there. I'm uncertain how difficult that will be, I haven't looked at it myself. |
matklad commentedJun 26, 2018
•
edited
Implementation PR: #5200
Steps:
Unresolved questions:
do we want to "impose" this feature on the ecosystem? Currently, everything seems to work fine due to eager dependency resolution. Adding
--minimal-versionshas costs: one-time ecosystem transition cost, cost to run CI job for minimal versions, cost to actually update minimal versions. There's anecdotal evidence that wrong minimal versions actually are a problem: https://www.reddit.com/r/rust/comments/8ob598/rust_minimum_versions_semver_is_a_lie/e027mtz/.should we implement "--minimal-versions-for-me-but-not-my-dependencies" as well, to make the initial roll-out of this feature easier?
Stabilization TODO:
-Z minimal-versionsto just--minimal-versionsand add it alongside--frozen/locked,linksproblem and solution.