diff options
| author | onur-ozkan <work@onurozkan.dev> | 2024-08-09 12:22:00 +0300 |
|---|---|---|
| committer | onur-ozkan <work@onurozkan.dev> | 2024-08-09 12:22:00 +0300 |
| commit | 9a29081b49540b84ea13994494d7ed0f599387bc (patch) | |
| tree | 4a42151b0ebee9c751299ea66b79b4deb9eb55d7 /src/bootstrap | |
| parent | 60d146580c10036ce89e019422c6bc2fd9729b65 (diff) | |
| download | rust-9a29081b49540b84ea13994494d7ed0f599387bc.tar.gz rust-9a29081b49540b84ea13994494d7ed0f599387bc.zip | |
call `Cargo::configure_linker` only for specific commands
Calling `Cargo::configure_linker` unconditionally slows down certain commands (e.g., "check" command) without providing any benefit. Signed-off-by: onur-ozkan <work@onurozkan.dev>
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/src/core/builder.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs index 84c23c059e9..b21572016b4 100644 --- a/src/bootstrap/src/core/builder.rs +++ b/src/bootstrap/src/core/builder.rs @@ -2446,7 +2446,15 @@ impl Cargo { cmd_kind: Kind, ) -> Cargo { let mut cargo = builder.cargo(compiler, mode, source_type, target, cmd_kind); - cargo.configure_linker(builder); + + match cmd_kind { + // No need to configure the target linker for these command types. + Kind::Clean | Kind::Check | Kind::Suggest | Kind::Format | Kind::Setup => {} + _ => { + cargo.configure_linker(builder); + } + } + cargo } |
