Skip to content

Commit 7df4d88

Browse files
committed
fix(install): Don't respect MSRV for non-local installs
This is part of #9930
1 parent 6e9f948 commit 7df4d88

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

src/cargo/core/workspace.rs

+4
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,10 @@ impl<'gctx> Workspace<'gctx> {
657657
self.honor_rust_version
658658
}
659659

660+
pub fn set_resolve_honors_rust_version(&mut self, honor_rust_version: Option<bool>) {
661+
self.resolve_honors_rust_version = honor_rust_version;
662+
}
663+
660664
pub fn resolve_honors_rust_version(&self) -> bool {
661665
// Give CLI precedence
662666
self.honor_rust_version

src/cargo/ops/cargo_install.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,9 @@ fn make_ws_rustc_target<'gctx>(
819819
let mut ws = if source_id.is_git() || source_id.is_path() {
820820
Workspace::new(pkg.manifest_path(), gctx)?
821821
} else {
822-
Workspace::ephemeral(pkg, gctx, None, false)?
822+
let mut ws = Workspace::ephemeral(pkg, gctx, None, false)?;
823+
ws.set_resolve_honors_rust_version(Some(false));
824+
ws
823825
};
824826
ws.set_ignore_lock(gctx.lock_update_allowed());
825827
ws.set_require_optional_deps(false);

tests/testsuite/rust_version.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1146,11 +1146,10 @@ fn cargo_install_ignores_msrv_config() {
11461146
[DOWNLOADING] crates ...
11471147
[DOWNLOADED] foo v0.0.1 (registry [..])
11481148
[INSTALLING] foo v0.0.1
1149-
[LOCKING] 2 packages to latest Rust 1.60 compatible versions
1150-
[ADDING] dep v1.0.0 (latest: v1.1.0)
1149+
[LOCKING] 2 packages to latest compatible versions
11511150
[DOWNLOADING] crates ...
1152-
[DOWNLOADED] dep v1.0.0 (registry [..])
1153-
[COMPILING] dep v1.0.0
1151+
[DOWNLOADED] dep v1.1.0 (registry [..])
1152+
[COMPILING] dep v1.1.0
11541153
[COMPILING] foo v0.0.1
11551154
[FINISHED] `release` profile [optimized] target(s) in [..]
11561155
[INSTALLING] [CWD]/home/.cargo/bin/foo[EXE]

0 commit comments

Comments
 (0)