From dcbf2b5d326f2d86d7dd49d8b653348bf5ecce42 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 23 Apr 2024 10:14:38 -0500 Subject: [PATCH] fix(install): Don't respect MSRV for non-local installs This is part of #9930 --- src/cargo/ops/cargo_install.rs | 4 +++- tests/testsuite/rust_version.rs | 7 +++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/cargo/ops/cargo_install.rs b/src/cargo/ops/cargo_install.rs index 18943dbe46e..a662e891f38 100644 --- a/src/cargo/ops/cargo_install.rs +++ b/src/cargo/ops/cargo_install.rs @@ -819,7 +819,9 @@ fn make_ws_rustc_target<'gctx>( let mut ws = if source_id.is_git() || source_id.is_path() { Workspace::new(pkg.manifest_path(), gctx)? } else { - Workspace::ephemeral(pkg, gctx, None, false)? + let mut ws = Workspace::ephemeral(pkg, gctx, None, false)?; + ws.set_resolve_honors_rust_version(Some(false)); + ws }; ws.set_ignore_lock(gctx.lock_update_allowed()); ws.set_require_optional_deps(false); diff --git a/tests/testsuite/rust_version.rs b/tests/testsuite/rust_version.rs index 058028462fd..399779b19fe 100644 --- a/tests/testsuite/rust_version.rs +++ b/tests/testsuite/rust_version.rs @@ -1146,11 +1146,10 @@ fn cargo_install_ignores_msrv_config() { [DOWNLOADING] crates ... [DOWNLOADED] foo v0.0.1 (registry [..]) [INSTALLING] foo v0.0.1 -[LOCKING] 2 packages to latest Rust 1.60 compatible versions -[ADDING] dep v1.0.0 (latest: v1.1.0) +[LOCKING] 2 packages to latest compatible versions [DOWNLOADING] crates ... -[DOWNLOADED] dep v1.0.0 (registry [..]) -[COMPILING] dep v1.0.0 +[DOWNLOADED] dep v1.1.0 (registry [..]) +[COMPILING] dep v1.1.0 [COMPILING] foo v0.0.1 [FINISHED] `release` profile [optimized] target(s) in [..] [INSTALLING] [CWD]/home/.cargo/bin/foo[EXE]