-
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
feat(resolver): **Very** preliminary MSRV resolver support #12560
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,6 +71,7 @@ use crate::util::config::Config; | |
use crate::util::errors::CargoResult; | ||
use crate::util::network::PollExt; | ||
use crate::util::profile; | ||
use crate::util::PartialVersion; | ||
|
||
use self::context::Context; | ||
use self::dep_cache::RegistryQueryer; | ||
|
@@ -138,6 +139,7 @@ pub fn resolve( | |
version_prefs: &VersionPreferences, | ||
config: Option<&Config>, | ||
check_public_visible_dependencies: bool, | ||
mut max_rust_version: Option<PartialVersion>, | ||
) -> CargoResult<Resolve> { | ||
let _p = profile::start("resolving"); | ||
let minimal_versions = match config { | ||
|
@@ -148,8 +150,19 @@ pub fn resolve( | |
Some(config) => config.cli_unstable().direct_minimal_versions, | ||
None => false, | ||
}; | ||
let mut registry = | ||
RegistryQueryer::new(registry, replacements, version_prefs, minimal_versions); | ||
if !config | ||
.map(|c| c.cli_unstable().msrv_policy) | ||
.unwrap_or(false) | ||
{ | ||
max_rust_version = None; | ||
} | ||
Comment on lines
+153
to
+158
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I centralized the feature check to this one spot I am somewhat tempted to do something similar for |
||
let mut registry = RegistryQueryer::new( | ||
registry, | ||
replacements, | ||
version_prefs, | ||
minimal_versions, | ||
max_rust_version, | ||
); | ||
let cx = loop { | ||
let cx = Context::new(check_public_visible_dependencies); | ||
let cx = activate_deps_loop( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ fn case() { | |
.current_dir(cwd) | ||
.masquerade_as_nightly_cargo(&["msrv-policy"]) | ||
.assert() | ||
.success() | ||
.code(101) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will be undone when we get |
||
.stdout_matches_path(curr_dir!().join("stdout.log")) | ||
.stderr_matches_path(curr_dir!().join("stderr.log")); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
Updating `dummy-registry` index | ||
Adding rust-version-user v0.2.1 to dependencies. | ||
error: failed to select a version for the requirement `rust-version-user = "^0.2.1"` | ||
candidate versions found which didn't match: 0.2.1, 0.1.0 | ||
location searched: `dummy-registry` index (which is replacing registry `crates-io`) | ||
required by package `cargo-list-test-fixture v0.0.0 ([ROOT]/case)` | ||
perhaps a crate was updated and forgotten to be re-vendored? |
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.
This is one case I'm not entirely sure of but since its another unstable feature, I figure doing a best effort isn't the end of the world
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 did not follow the point you were trying to make here.
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'm assuming this is build-std and we do a separate resolve pass for that. What should we consider
max_rust_version
to be in this case?