Allow using vendoring when running bootstrap from outside the current working directory

This commit is contained in:
Joshua Nelson 2022-09-14 21:54:16 -05:00
parent 88a192257c
commit 63b8d9b689
2 changed files with 5 additions and 1 deletions

View File

@ -771,7 +771,8 @@ class RustBuild(object):
elif color == "never":
args.append("--color=never")
run(args, env=env, verbose=self.verbose)
# Run this from the source directory so cargo finds .cargo/config
run(args, env=env, verbose=self.verbose, cwd=self.rust_root)
def build_triple(self):
"""Build triple as in LLVM

View File

@ -1325,6 +1325,9 @@ impl<'a> Builder<'a> {
) -> Cargo {
let mut cargo = Command::new(&self.initial_cargo);
let out_dir = self.stage_out(compiler, mode);
// Run cargo from the source root so it can find .cargo/config.
// This matters when using vendoring and the working directory is outside the repository.
cargo.current_dir(&self.src);
// Codegen backends are not yet tracked by -Zbinary-dep-depinfo,
// so we need to explicitly clear out if they've been updated.