Skip to content

Commit 51f6e68

Browse files
committed
handle cargo submodule in a lazy-load way
Signed-off-by: onur-ozkan <[email protected]>
1 parent 8c3ebf7 commit 51f6e68

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/bootstrap/src/core/build_steps/test.rs

+3
Original file line numberDiff line numberDiff line change
@@ -2983,6 +2983,9 @@ impl Step for Bootstrap {
29832983
let compiler = builder.compiler(0, host);
29842984
let _guard = builder.msg(Kind::Test, 0, "bootstrap", host, host);
29852985

2986+
// Some tests require cargo submodule to be present.
2987+
builder.build.update_submodule(Path::new("src/tools/cargo"));
2988+
29862989
let mut check_bootstrap = Command::new(builder.python());
29872990
check_bootstrap
29882991
.args(["-m", "unittest", "bootstrap_test.py"])

src/bootstrap/src/core/build_steps/tool.rs

+2
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,8 @@ impl Step for Cargo {
654654
}
655655

656656
fn run(self, builder: &Builder<'_>) -> PathBuf {
657+
builder.build.update_submodule(Path::new("src/tools/cargo"));
658+
657659
builder.ensure(ToolBuild {
658660
compiler: self.compiler,
659661
target: self.target,

src/bootstrap/src/core/build_steps/vendor.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::core::builder::{Builder, RunConfig, ShouldRun, Step};
2-
use std::path::PathBuf;
2+
use std::path::{Path, PathBuf};
33
use std::process::Command;
44

55
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
@@ -34,6 +34,9 @@ impl Step for Vendor {
3434
cmd.arg("--versioned-dirs");
3535
}
3636

37+
// cargo submodule must be present for `x vendor` to work.
38+
builder.build.update_submodule(Path::new("src/tools/cargo"));
39+
3740
// Sync these paths by default.
3841
for p in [
3942
"src/tools/cargo/Cargo.toml",

0 commit comments

Comments
 (0)