Lines 126-138
def unpack(tarball, dst, verbose=False, match=None):
Link Here
|
126 |
shutil.move(tp, fp) |
126 |
shutil.move(tp, fp) |
127 |
shutil.rmtree(os.path.join(dst, fname)) |
127 |
shutil.rmtree(os.path.join(dst, fname)) |
128 |
|
128 |
|
129 |
def run(args, verbose=False, exception=False): |
129 |
def run(args, verbose=False, exception=False, env=None): |
130 |
if verbose: |
130 |
if verbose: |
131 |
print("running: " + ' '.join(args)) |
131 |
print("running: " + ' '.join(args)) |
132 |
sys.stdout.flush() |
132 |
sys.stdout.flush() |
133 |
# Use Popen here instead of call() as it apparently allows powershell on |
133 |
# Use Popen here instead of call() as it apparently allows powershell on |
134 |
# Windows to not lock up waiting for input presumably. |
134 |
# Windows to not lock up waiting for input presumably. |
135 |
ret = subprocess.Popen(args) |
135 |
ret = subprocess.Popen(args, env=env) |
136 |
code = ret.wait() |
136 |
code = ret.wait() |
137 |
if code != 0: |
137 |
if code != 0: |
138 |
err = "failed to run: " + ' '.join(args) |
138 |
err = "failed to run: " + ' '.join(args) |
Lines 378-390
class RustBuild(object):
Link Here
|
378 |
args.append("--locked") |
378 |
args.append("--locked") |
379 |
if self.use_vendored_sources: |
379 |
if self.use_vendored_sources: |
380 |
args.append("--frozen") |
380 |
args.append("--frozen") |
381 |
self.run(args, env) |
381 |
run(args, env=env, verbose=self.verbose) |
382 |
|
|
|
383 |
def run(self, args, env): |
384 |
proc = subprocess.Popen(args, env=env) |
385 |
ret = proc.wait() |
386 |
if ret != 0: |
387 |
sys.exit(ret) |
388 |
|
382 |
|
389 |
def build_triple(self): |
383 |
def build_triple(self): |
390 |
default_encoding = sys.getdefaultencoding() |
384 |
default_encoding = sys.getdefaultencoding() |
Lines 603-609
def bootstrap():
Link Here
|
603 |
env["BUILD"] = rb.build |
597 |
env["BUILD"] = rb.build |
604 |
env["SRC"] = rb.rust_root |
598 |
env["SRC"] = rb.rust_root |
605 |
env["BOOTSTRAP_PARENT_ID"] = str(os.getpid()) |
599 |
env["BOOTSTRAP_PARENT_ID"] = str(os.getpid()) |
606 |
rb.run(args, env) |
600 |
run(args, env=env, verbose=rb.verbose) |
607 |
|
601 |
|
608 |
def main(): |
602 |
def main(): |
609 |
start_time = time() |
603 |
start_time = time() |
610 |
- |
|
|