Skip to content

Commit

Permalink
Rollup merge of #98528 - jyn514:bootstrap-color, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Respect --color when building rustbuild itself

Separated out from #95503.
  • Loading branch information
matthiaskrgr authored Jun 26, 2022
2 parents 0b3b4ef + 028fd63 commit 0c09846
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ def bootstrap_binary(self):
"""
return os.path.join(self.build_dir, "bootstrap", "debug", "bootstrap")

def build_bootstrap(self):
def build_bootstrap(self, color):
"""Build bootstrap"""
print("Building rustbuild")
build_dir = os.path.join(self.build_dir, "bootstrap")
Expand Down Expand Up @@ -800,6 +800,11 @@ def build_bootstrap(self):
if self.get_toml("metrics", "build"):
args.append("--features")
args.append("build-metrics")
if color == "always":
args.append("--color=always")
elif color == "never":
args.append("--color=never")

run(args, env=env, verbose=self.verbose)

def build_triple(self):
Expand Down Expand Up @@ -862,6 +867,7 @@ def bootstrap(help_triggered):
parser = argparse.ArgumentParser(description='Build rust')
parser.add_argument('--config')
parser.add_argument('--build')
parser.add_argument('--color', choices=['always', 'never', 'auto'])
parser.add_argument('--clean', action='store_true')
parser.add_argument('-v', '--verbose', action='count', default=0)

Expand Down Expand Up @@ -930,7 +936,7 @@ def bootstrap(help_triggered):
# Fetch/build the bootstrap
build.download_toolchain()
sys.stdout.flush()
build.build_bootstrap()
build.build_bootstrap(args.color)
sys.stdout.flush()

# Run the bootstrap
Expand Down

0 comments on commit 0c09846

Please sign in to comment.