rust/src
bors c1e3f03e60 Auto merge of #127450 - Kobzol:bootstrap-cmd-refactor-5, r=onur-ozkan
Bootstrap command refactoring: improve debuggability (step 5)

Continuation of https://github.com/rust-lang/rust/pull/127321.

This PR improves the debuggability of command execution, by improving the output logged when a command fails (it now includes the exact location where the command was created and where it was executed), and also by adding a "drop bomb", which will panic if a command was created, but not executed (which is probably a bug).

Here is how the output of a failed command looks like:
```
Command "git" "foo" "[bar]" (failure_mode=Exit, stdout_mode=Capture, stderr_mode=Capture) did not execute successfully.
Expected success, got exit status: 1
Created at: src/core/build_steps/compile.rs:1699:9
Executed at: src/core/build_steps/compile.rs:1699:58

STDOUT ----

STDERR ----
git: 'foo' is not a git command. See 'git --help'.
```

And this is what is printed if you forget to execute a command:
```
thread 'main' panicked at /projects/personal/rust/rust/src/tools/build_helper/src/drop_bomb/mod.rs:42:13:
command constructed at `src/core/build_steps/compile.rs:1699:9` was dropped without being executed: `git`
```

Best reviewed commit by commit.

Tracking issue: https://github.com/rust-lang/rust/issues/126819

r? `@onur-ozkan`
2024-07-13 09:44:05 +00:00
..
bootstrap Auto merge of #127450 - Kobzol:bootstrap-cmd-refactor-5, r=onur-ozkan 2024-07-13 09:44:05 +00:00
ci Rollup merge of #127613 - nikic:riscv-update, r=cuviper 2024-07-12 14:38:00 +02:00
doc Auto merge of #123351 - beetrees:x86-ret-snan-rust, r=nikic,workingjubilee 2024-07-12 20:36:43 +00:00
etc Auto merge of #127001 - beetrees:f16-debuginfo, r=michaelwoerister 2024-07-09 09:07:42 +00:00
librustdoc Add rustdoc-json support for use<> 2024-07-12 05:24:51 -04:00
llvm-project@c54cff0e6e Update LLVM submodule 2024-07-05 22:06:57 +08:00
rustdoc-json-types Add rustdoc-json support for use<> 2024-07-12 05:24:51 -04:00
tools Auto merge of #127450 - Kobzol:bootstrap-cmd-refactor-5, r=onur-ozkan 2024-07-13 09:44:05 +00:00
README.md
stage0 bump stage0 compiler 2024-06-11 15:10:03 +02:00
version set version number to 1.81.0 2024-06-07 10:37:34 +02:00

This directory contains some source code for the Rust project, including:

  • The bootstrapping build system
  • Various submodules for tools, like cargo, tidy, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.