Bootstrap command refactoring: consolidate output modes (step 3) by Kobzol · Pull Request #127120 · rust-lang/rust (original) (raw)

This PR is a continuation to #126731. It consolidates the output modes of bootstrap (Print vs CaptureAll vs CaptureStdout) and simplifies the logic around error printing (now a command error is always printed if the failure is not ignored). It also ports even more usages of Command to BootstrapCommand, most notably the git helpers and many usages of the output function.

The last commit was added because the third commit made two variants of the Tool enum unused (no idea why, but it seems to have been a false positive that they were used before).

It can be reviewed now, but I would wait with merging until at least a few days after #126731, just to catch any potential issues from that PR before we move further.

As a next step, I want to clean up the API of the command a little bit to make usage easier (currently it's a bit verbose), and then continue with the rest of the tasks from the tracking issue.

As always, best reviewed commit by commit.

Tracking issue: #126819

r? @onur-ozkan

try-job: aarch64-apple