This is a tracking issue for monitoring the work of improving how we deal with command invocations in bootstrap (proposed here).
Currently, bootstrap executes commands on many places, often in arbitrary ways. This makes it harder to debug, profile and test the command invocations executed by it. The goal of this refactoring is to make sure that all external command invocations use the same API (a custom command wrapper) and that they go through a centralized location.
Intermediate steps:
This is a tracking issue for monitoring the work of improving how we deal with command invocations in bootstrap (proposed here).
Currently, bootstrap executes commands on many places, often in arbitrary ways. This makes it harder to debug, profile and test the command invocations executed by it. The goal of this refactoring is to make sure that all external command invocations use the same API (a custom command wrapper) and that they go through a centralized location.
Intermediate steps:
&Build(er)toBootstrapCommandBootstrapCommand(step 1) #126731Commandusages toBootstrapCmd(step 2) #126822BootstrapCmdso that it storesCommandinstead of&mut Commandand remove all calls toBootstrapCmd::fromby changingCommand::newtoBootstrapCmd::newCommandusages toBootstrapCmd(step 2) #126822#[must_use]#[track_caller]to command execution functions to make debugging easier.BootstrapCmdthat can access Builder to use the correct output and failure modes. This will include passing Builder to additional places.Build(step 6) #127680Config.Flagsin bootstrap #128878Builder,Build,Configand command context. There are some fields and logic used during command execution that are distributed amongstBuilder/Build/Config, so it will require some refactoring to make it work if the execution will happen on a separate place (in the command context).Config::parse) by introducing a new command context that will be passed to these places, and then stored inBuilder. Move certain fields (such asfail_fast) fromBuilderto the command context.BootstrapCommandand handle the most complex cases, such as output streaming.BootstrapCommandand removeas_command_mut#143354metrics.json).Stepdebug hierarchical output.