Skip to content

Commit

Permalink
Cargo patch
Browse files Browse the repository at this point in the history
  • Loading branch information
BoxyUwU committed Nov 29, 2024
1 parent 583e26c commit 5fa483c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<'_>) {
Expand All @@ -286,7 +290,7 @@ impl Step for Cargo {
Mode::ToolRustc,
self.host,
Kind::Test,
"src/tools/cargo",
Self::CRATE_PATH,
SourceType::Submodule,
&[],
);
Expand All @@ -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(
Expand Down

0 comments on commit 5fa483c

Please sign in to comment.