@@ -127,13 +127,13 @@ def unpack(tarball, dst, verbose=False, match=None):
127
127
shutil .move (tp , fp )
128
128
shutil .rmtree (os .path .join (dst , fname ))
129
129
130
- def run (args , verbose = False , exception = False , cwd = None ):
130
+ def run (args , verbose = False , exception = False , cwd = None , env = None ):
131
131
if verbose :
132
132
print ("running: " + ' ' .join (args ))
133
133
sys .stdout .flush ()
134
134
# Use Popen here instead of call() as it apparently allows powershell on
135
135
# Windows to not lock up waiting for input presumably.
136
- ret = subprocess .Popen (args , cwd = cwd )
136
+ ret = subprocess .Popen (args , cwd = cwd , env = env )
137
137
code = ret .wait ()
138
138
if code != 0 :
139
139
err = "failed to run: " + ' ' .join (args )
@@ -393,13 +393,7 @@ def build_bootstrap(self):
393
393
args .append ("--locked" )
394
394
if self .use_vendored_sources :
395
395
args .append ("--frozen" )
396
- self .run (args , env )
397
-
398
- def run (self , args , env = None , cwd = None ):
399
- proc = subprocess .Popen (args , env = env , cwd = cwd )
400
- ret = proc .wait ()
401
- if ret != 0 :
402
- sys .exit (ret )
396
+ run (args , env = env , verbose = self .verbose )
403
397
404
398
def output (self , args , env = None , cwd = None ):
405
399
default_encoding = sys .getdefaultencoding ()
@@ -571,7 +565,7 @@ def update_submodules(self):
571
565
path = line [1 :].split (' ' )[1 ]
572
566
submodules .append ([path , line [0 ]])
573
567
574
- self . run (["git" , "submodule" , "sync" ], cwd = self .rust_root )
568
+ run (["git" , "submodule" , "sync" ], cwd = self .rust_root )
575
569
576
570
for submod in submodules :
577
571
path , status = submod
@@ -584,15 +578,15 @@ def update_submodules(self):
584
578
submod_path = os .path .join (self .rust_root , path )
585
579
586
580
if status == ' ' :
587
- self . run (["git" , "reset" , "--hard" ], cwd = submod_path )
588
- self . run (["git" , "clean" , "-fdx" ], cwd = submod_path )
581
+ run (["git" , "reset" , "--hard" ], cwd = submod_path )
582
+ run (["git" , "clean" , "-fdx" ], cwd = submod_path )
589
583
elif status == '+' :
590
- self . run (["git" , "submodule" , "update" , path ], cwd = self .rust_root )
591
- self . run (["git" , "reset" , "--hard" ], cwd = submod_path )
592
- self . run (["git" , "clean" , "-fdx" ], cwd = submod_path )
584
+ run (["git" , "submodule" , "update" , path ], cwd = self .rust_root )
585
+ run (["git" , "reset" , "--hard" ], cwd = submod_path )
586
+ run (["git" , "clean" , "-fdx" ], cwd = submod_path )
593
587
elif status == '-' :
594
- self . run (["git" , "submodule" , "init" , path ], cwd = self .rust_root )
595
- self . run (["git" , "submodule" , "update" , path ], cwd = self .rust_root )
588
+ run (["git" , "submodule" , "init" , path ], cwd = self .rust_root )
589
+ run (["git" , "submodule" , "update" , path ], cwd = self .rust_root )
596
590
else :
597
591
raise ValueError ('unknown submodule status: ' + status )
598
592
@@ -685,7 +679,7 @@ def bootstrap():
685
679
env ["BUILD" ] = rb .build
686
680
env ["SRC" ] = rb .rust_root
687
681
env ["BOOTSTRAP_PARENT_ID" ] = str (os .getpid ())
688
- rb . run (args , env )
682
+ run (args , env = env , verbose = rb . verbose )
689
683
690
684
def main ():
691
685
start_time = time ()
0 commit comments