Skip to content

Commit 3762905

Browse files
committed
Auto merge of #14255 - weihanglo:beta-backport, r=epage
[beta-1.80.0] chore: downgrade to jobserver@0.1.28 Beta backports * #14254 8923ba6 In order to make CI pass, the following PRs are also cherry-picked: * #14212 95e8b1c
2 parents 34a6a87 + 7441fca commit 3762905

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ ignore = "0.4.22"
5858
im-rc = "15.1.0"
5959
indexmap = "2.2.6"
6060
itertools = "0.12.1"
61-
jobserver = "0.1.31"
61+
jobserver = "0.1.28"
6262
lazycell = "1.3.0"
6363
libc = "0.2.154"
6464
libgit2-sys = "0.16.2"

tests/testsuite/global_cache_tracker.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use cargo_test_support::{
1818
thread_wait_timeout, Execs, Project,
1919
};
2020
use itertools::Itertools;
21+
use std::env;
2122
use std::fmt::Write;
2223
use std::path::Path;
2324
use std::path::PathBuf;
@@ -167,12 +168,19 @@ fn populate_cache(
167168
(cache_dir, src_dir)
168169
}
169170

171+
/// Returns an `Execs` that will run the rustup `cargo` proxy from the global
172+
/// system's cargo home directory.
170173
fn rustup_cargo() -> Execs {
171-
// Get the path to the rustup cargo wrapper. This is necessary because
172-
// cargo adds the "deps" directory into PATH on Windows, which points to
173-
// the wrong cargo.
174-
let rustup_cargo = Path::new(&std::env::var_os("CARGO_HOME").unwrap()).join("bin/cargo");
175-
execs().with_process_builder(process(rustup_cargo))
174+
// Modify the PATH to ensure that `cargo` and `rustc` comes from
175+
// CARGO_HOME. This is necessary because cargo adds the "deps" directory
176+
// into PATH on Windows, which points to the wrong cargo.
177+
let real_cargo_home_bin = Path::new(&std::env::var_os("CARGO_HOME").unwrap()).join("bin");
178+
let mut paths = vec![real_cargo_home_bin];
179+
paths.extend(env::split_paths(&env::var_os("PATH").unwrap_or_default()));
180+
let path = env::join_paths(paths).unwrap();
181+
let mut e = execs().with_process_builder(process("cargo"));
182+
e.env("PATH", path);
183+
e
176184
}
177185

178186
#[cargo_test]

0 commit comments

Comments
 (0)