Skip to content

Commit

Permalink
rustbuild: enable an initial local cargo
Browse files Browse the repository at this point in the history
This allows the initial build of src/bootstrap itself to use a local
cargo taken from `configure --local-rust-root`.  It was already finding
rustc this way, but was always downloading cargo since it didn't know
where to find it.

It now matches the same logic that `config.rs` will use for stage0,
where both rustc and cargo are taken from `CFG_LOCAL_RUST_ROOT`.
  • Loading branch information
cuviper committed Nov 10, 2016
1 parent b46ce08 commit 0d6323f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,16 @@ def cargo(self):
config = self.get_toml('cargo')
if config:
return config
config = self.get_mk('CFG_LOCAL_RUST_ROOT')
if config:
return config + '/bin/cargo' + self.exe_suffix()
return os.path.join(self.bin_root(), "bin/cargo" + self.exe_suffix())

def rustc(self):
config = self.get_toml('rustc')
if config:
return config
config = self.get_mk('CFG_LOCAL_RUST')
config = self.get_mk('CFG_LOCAL_RUST_ROOT')
if config:
return config + '/bin/rustc' + self.exe_suffix()
return os.path.join(self.bin_root(), "bin/rustc" + self.exe_suffix())
Expand Down

0 comments on commit 0d6323f

Please sign in to comment.