@@ -784,6 +784,8 @@ def build_bootstrap(self, color, verbose_count):
784784 if self .get_toml ("metrics" , "build" ):
785785 args .append ("--features" )
786786 args .append ("build-metrics" )
787+ if self .json_output :
788+ args .append ("--message-format=json" )
787789 if color == "always" :
788790 args .append ("--color=always" )
789791 elif color == "never" :
@@ -841,6 +843,7 @@ def parse_args():
841843 parser .add_argument ('--build' )
842844 parser .add_argument ('--color' , choices = ['always' , 'never' , 'auto' ])
843845 parser .add_argument ('--clean' , action = 'store_true' )
846+ parser .add_argument ('--json-output' , action = 'store_true' )
844847 parser .add_argument ('-v' , '--verbose' , action = 'count' , default = 0 )
845848
846849 return parser .parse_known_args (sys .argv )[0 ]
@@ -852,6 +855,7 @@ def bootstrap(args):
852855 build .rust_root = os .path .abspath (os .path .join (__file__ , '../../..' ))
853856 build .verbose = args .verbose != 0
854857 build .clean = args .clean
858+ build .json_output = args .json_output
855859
856860 # Read from `--config`, then `RUST_BOOTSTRAP_CONFIG`, then `./config.toml`,
857861 # then `config.toml` in the root directory.
0 commit comments