Skip to content

Commit 0d6323f

Browse files
committed
rustbuild: enable an initial local cargo
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`.
1 parent b46ce08 commit 0d6323f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/bootstrap/bootstrap.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,16 @@ def cargo(self):
226226
config = self.get_toml('cargo')
227227
if config:
228228
return config
229+
config = self.get_mk('CFG_LOCAL_RUST_ROOT')
230+
if config:
231+
return config + '/bin/cargo' + self.exe_suffix()
229232
return os.path.join(self.bin_root(), "bin/cargo" + self.exe_suffix())
230233

231234
def rustc(self):
232235
config = self.get_toml('rustc')
233236
if config:
234237
return config
235-
config = self.get_mk('CFG_LOCAL_RUST')
238+
config = self.get_mk('CFG_LOCAL_RUST_ROOT')
236239
if config:
237240
return config + '/bin/rustc' + self.exe_suffix()
238241
return os.path.join(self.bin_root(), "bin/rustc" + self.exe_suffix())

0 commit comments

Comments
 (0)