-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Tracking Issue for consolidating command invocations in bootstrap #126819
Copy link
Copy link
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Type
Fields
Give feedbackNo fields configured for issues without a type.
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.