Fix storing of stdout/stderr in bootstrap commands that failed to start · rust-lang/rust@abd8768 (original) (raw)
2 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1005,7 +1005,7 @@ Executed at: {executed_at}"#, | ||
1005 | 1005 | \nIt was not possible to execute the command: {e:?}" |
1006 | 1006 | ) |
1007 | 1007 | .unwrap(); |
1008 | -CommandOutput::did_not_start() | |
1008 | +CommandOutput::did_not_start(stdout, stderr) | |
1009 | 1009 | } |
1010 | 1010 | }; |
1011 | 1011 | if !output.is_success() { |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -231,8 +231,18 @@ pub struct CommandOutput { | ||
231 | 231 | |
232 | 232 | impl CommandOutput { |
233 | 233 | #[must_use] |
234 | -pub fn did_not_start() -> Self { | |
235 | -Self { status: CommandStatus::DidNotStart, stdout: None, stderr: None } | |
234 | +pub fn did_not_start(stdout: OutputMode, stderr: OutputMode) -> Self { | |
235 | +Self { | |
236 | +status: CommandStatus::DidNotStart, | |
237 | +stdout: match stdout { | |
238 | +OutputMode::Print => None, | |
239 | +OutputMode::Capture => Some(vec![]), | |
240 | +}, | |
241 | +stderr: match stderr { | |
242 | +OutputMode::Print => None, | |
243 | +OutputMode::Capture => Some(vec![]), | |
244 | +}, | |
245 | +} | |
236 | 246 | } |
237 | 247 | |
238 | 248 | #[must_use] |