From 45d41ba324f054f0928ad7db6c31efcc1ca5b8ac Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Mon, 15 Jul 2024 14:28:50 -0400 Subject: [PATCH 1/2] chore: downgrade to jobserver@0.1.28 See https://github.com/rust-lang/jobserver-rs/issues/99 While there is a fix waiting for review, we might miss the release window for 1.80, so propose we beta-backport this --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e2a42023b9c..bc6f55c8957 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2084,9 +2084,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.31" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" dependencies = [ "libc", ] diff --git a/Cargo.toml b/Cargo.toml index ae1f13a62ab..fbc8086821a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -58,7 +58,7 @@ ignore = "0.4.22" im-rc = "15.1.0" indexmap = "2.2.6" itertools = "0.12.1" -jobserver = "0.1.31" +jobserver = "0.1.28" lazycell = "1.3.0" libc = "0.2.154" libgit2-sys = "0.16.2" From 7441fcaae177d0ad78615f4093df4d671e6cd50e Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Mon, 8 Jul 2024 14:36:12 -0700 Subject: [PATCH 2/2] Fix compatible_with_older_cargo test. --- tests/testsuite/global_cache_tracker.rs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/testsuite/global_cache_tracker.rs b/tests/testsuite/global_cache_tracker.rs index 7dfb31997be..858e970d2ff 100644 --- a/tests/testsuite/global_cache_tracker.rs +++ b/tests/testsuite/global_cache_tracker.rs @@ -18,6 +18,7 @@ use cargo_test_support::{ thread_wait_timeout, Execs, Project, }; use itertools::Itertools; +use std::env; use std::fmt::Write; use std::path::Path; use std::path::PathBuf; @@ -167,12 +168,19 @@ fn populate_cache( (cache_dir, src_dir) } +/// Returns an `Execs` that will run the rustup `cargo` proxy from the global +/// system's cargo home directory. fn rustup_cargo() -> Execs { - // Get the path to the rustup cargo wrapper. This is necessary because - // cargo adds the "deps" directory into PATH on Windows, which points to - // the wrong cargo. - let rustup_cargo = Path::new(&std::env::var_os("CARGO_HOME").unwrap()).join("bin/cargo"); - execs().with_process_builder(process(rustup_cargo)) + // Modify the PATH to ensure that `cargo` and `rustc` comes from + // CARGO_HOME. This is necessary because cargo adds the "deps" directory + // into PATH on Windows, which points to the wrong cargo. + let real_cargo_home_bin = Path::new(&std::env::var_os("CARGO_HOME").unwrap()).join("bin"); + let mut paths = vec![real_cargo_home_bin]; + paths.extend(env::split_paths(&env::var_os("PATH").unwrap_or_default())); + let path = env::join_paths(paths).unwrap(); + let mut e = execs().with_process_builder(process("cargo")); + e.env("PATH", path); + e } #[cargo_test]