about summary refs log tree commit diff
path: root/compiler/rustc_session/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-10-26 20:15:16 +0000
committerbors <bors@rust-lang.org>2023-10-26 20:15:16 +0000
commitaa1a71e9e90f6eb3aed8cf79fc80bea304c17ecb (patch)
treeaa84c8f5b4878edf7a91a959507e9b7e91065e7c /compiler/rustc_session/src
parent8396efecf7d30ca9f7edcf76aba2ea388300f6ab (diff)
parent5d7fca15d3c7d991733abd0d187e49e403b0b200 (diff)
downloadrust-aa1a71e9e90f6eb3aed8cf79fc80bea304c17ecb.tar.gz
rust-aa1a71e9e90f6eb3aed8cf79fc80bea304c17ecb.zip
Auto merge of #116581 - Kobzol:bootstrap-cmd-run, r=onur-ozkan
Centralize command running in boostrap (part one)

This PR tries to consolidate the various `run, try_run, run_quiet, run_quiet_delaying_failure, run_delaying_failure` etc. methods on `Builder`. This PR only touches command execution which doesn't produce output that would be later read by bootstrap, and it also only refactors spawning of commands that happens after a builder is created (commands executed during download & git submodule checkout are left as-is, for now).

The `run_cmd` method is quite meaty, but I expect that it will be changing rapidly soon, so I considered it easy to kept everything in a single method, and only after things settle down a bit, then maybe again split it up a bit.

I still kept the original shortcut methods like `run_quiet_delaying_failure`, but they now only delegate to `run_cmd`. I tried to keep the original behavior (or as close to it as possible) for all the various commands, but it is a giant mess, so there may be some deviations. Notably, `cmd.output()` is now always called, instead of just `status()`, which was called previously in some situations.

Apart from the refactored methods, there is also `Config::try_run`, `check_run`, methods that run commands that produce output, oh my… that's left for follow-up PRs :)

The driving goal of this (and following) refactors is to centralize command execution in bootstrap on a single place, to make command mocking feasible.

r? `@onur-ozkan`
Diffstat (limited to 'compiler/rustc_session/src')
0 files changed, 0 insertions, 0 deletions