Skip to content

Commit 63b8d9b

Browse files
committed
Allow using vendoring when running bootstrap from outside the current working directory
1 parent 88a1922 commit 63b8d9b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/bootstrap/bootstrap.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,8 @@ def build_bootstrap(self, color):
771771
elif color == "never":
772772
args.append("--color=never")
773773

774-
run(args, env=env, verbose=self.verbose)
774+
# Run this from the source directory so cargo finds .cargo/config
775+
run(args, env=env, verbose=self.verbose, cwd=self.rust_root)
775776

776777
def build_triple(self):
777778
"""Build triple as in LLVM

src/bootstrap/builder.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1325,6 +1325,9 @@ impl<'a> Builder<'a> {
13251325
) -> Cargo {
13261326
let mut cargo = Command::new(&self.initial_cargo);
13271327
let out_dir = self.stage_out(compiler, mode);
1328+
// Run cargo from the source root so it can find .cargo/config.
1329+
// This matters when using vendoring and the working directory is outside the repository.
1330+
cargo.current_dir(&self.src);
13281331

13291332
// Codegen backends are not yet tracked by -Zbinary-dep-depinfo,
13301333
// so we need to explicitly clear out if they've been updated.

0 commit comments

Comments
 (0)