Skip to content

Commit c6f38c2

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

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
@@ -3035,6 +3035,9 @@ impl Step for Bootstrap {
30353035
let compiler = builder.compiler(0, host);
30363036
let _guard = builder.msg(Kind::Test, 0, "bootstrap", host, host);
30373037

3038+
// Some tests require cargo submodule to be present.
3039+
builder.build.update_submodule(Path::new("src/tools/cargo"));
3040+
30383041
let mut check_bootstrap = Command::new(builder.python());
30393042
check_bootstrap
30403043
.args(["-m", "unittest", "bootstrap_test.py"])

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

+2
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,8 @@ impl Step for Cargo {
586586
}
587587

588588
fn run(self, builder: &Builder<'_>) -> PathBuf {
589+
builder.build.update_submodule(Path::new("src/tools/cargo"));
590+
589591
builder.ensure(ToolBuild {
590592
compiler: self.compiler,
591593
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)