diff options
| author | Boxy <rust@boxyuwu.dev> | 2024-11-29 21:29:02 +0000 |
|---|---|---|
| committer | Boxy <rust@boxyuwu.dev> | 2024-11-29 21:31:42 +0000 |
| commit | 5fa483cb1028fed1ab1b8a674238a7cac5a1a42a (patch) | |
| tree | 5a93fe39f638fdae9b35191e332ef69ea4350c5c | |
| parent | 583e26c5ddf86809be386fbc614226f91428a1c0 (diff) | |
| download | rust-5fa483cb1028fed1ab1b8a674238a7cac5a1a42a.tar.gz rust-5fa483cb1028fed1ab1b8a674238a7cac5a1a42a.zip | |
Cargo patch
| -rw-r--r-- | src/bootstrap/src/core/build_steps/test.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index dd967bca867..9c452706608 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -263,12 +263,16 @@ pub struct Cargo { host: TargetSelection, } +impl Cargo { + const CRATE_PATH: &str = "src/tools/cargo"; +} + impl Step for Cargo { type Output = (); const ONLY_HOSTS: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - run.path("src/tools/cargo") + run.path(Self::CRATE_PATH) } fn make_run(run: RunConfig<'_>) { @@ -286,7 +290,7 @@ impl Step for Cargo { Mode::ToolRustc, self.host, Kind::Test, - "src/tools/cargo", + Self::CRATE_PATH, SourceType::Submodule, &[], ); @@ -301,6 +305,9 @@ impl Step for Cargo { // those features won't be able to land. cargo.env("CARGO_TEST_DISABLE_NIGHTLY", "1"); cargo.env("PATH", path_for_cargo(builder, compiler)); + // Cargo's test suite requires configurations from its own `.cargo/config.toml`. + // Change to the directory so Cargo can read from it. + cargo.current_dir(builder.src.join(Self::CRATE_PATH)); #[cfg(feature = "build-metrics")] builder.metrics.begin_test_suite( |
