Skip to content

Commit 0c09846

Browse files
authored
Rollup merge of #98528 - jyn514:bootstrap-color, r=Mark-Simulacrum
Respect --color when building rustbuild itself Separated out from #95503.
2 parents 0b3b4ef + 028fd63 commit 0c09846

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/bootstrap/bootstrap.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ def bootstrap_binary(self):
743743
"""
744744
return os.path.join(self.build_dir, "bootstrap", "debug", "bootstrap")
745745

746-
def build_bootstrap(self):
746+
def build_bootstrap(self, color):
747747
"""Build bootstrap"""
748748
print("Building rustbuild")
749749
build_dir = os.path.join(self.build_dir, "bootstrap")
@@ -800,6 +800,11 @@ def build_bootstrap(self):
800800
if self.get_toml("metrics", "build"):
801801
args.append("--features")
802802
args.append("build-metrics")
803+
if color == "always":
804+
args.append("--color=always")
805+
elif color == "never":
806+
args.append("--color=never")
807+
803808
run(args, env=env, verbose=self.verbose)
804809

805810
def build_triple(self):
@@ -862,6 +867,7 @@ def bootstrap(help_triggered):
862867
parser = argparse.ArgumentParser(description='Build rust')
863868
parser.add_argument('--config')
864869
parser.add_argument('--build')
870+
parser.add_argument('--color', choices=['always', 'never', 'auto'])
865871
parser.add_argument('--clean', action='store_true')
866872
parser.add_argument('-v', '--verbose', action='count', default=0)
867873

@@ -930,7 +936,7 @@ def bootstrap(help_triggered):
930936
# Fetch/build the bootstrap
931937
build.download_toolchain()
932938
sys.stdout.flush()
933-
build.build_bootstrap()
939+
build.build_bootstrap(args.color)
934940
sys.stdout.flush()
935941

936942
# Run the bootstrap

0 commit comments

Comments
 (0)