Skip to content

Commit

Permalink
Rollup merge of rust-lang#101835 - jyn514:fix-vendoring, r=Mark-Simul…
Browse files Browse the repository at this point in the history
…acrum

Allow using vendoring when running bootstrap from outside the source root

Fixes rust-lang#100364.
  • Loading branch information
matthiaskrgr authored Sep 17, 2022
2 parents bfbb15a + 63b8d9b commit cda20a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,8 @@ def build_bootstrap(self, color):
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
Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit cda20a7

Please sign in to comment.