Skip to content

Commit b16ba4d

Browse files
committed
remove start_porcess helper method
1 parent 2e4f2d2 commit b16ba4d

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

src/bootstrap/src/utils/helpers.rs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
66
use std::ffi::OsStr;
77
use std::path::{Path, PathBuf};
8-
use std::process::{Command, Stdio};
98
use std::sync::OnceLock;
109
use std::thread::panicking;
1110
use std::time::{Instant, SystemTime, UNIX_EPOCH};
1211
use std::{env, fs, io, panic, str};
1312

14-
use build_helper::util::fail;
1513
use object::read::archive::ArchiveFile;
1614

1715
use crate::LldMode;
@@ -282,33 +280,6 @@ pub fn make(host: &str) -> PathBuf {
282280
}
283281
}
284282

285-
/// Spawn a process and return a closure that will wait for the process
286-
/// to finish and then return its output. This allows the spawned process
287-
/// to do work without immediately blocking bootstrap.
288-
#[track_caller]
289-
pub fn start_process(cmd: &mut Command) -> impl FnOnce() -> String + use<> {
290-
let child = match cmd.stderr(Stdio::inherit()).stdout(Stdio::piped()).spawn() {
291-
Ok(child) => child,
292-
Err(e) => fail(&format!("failed to execute command: {cmd:?}\nERROR: {e}")),
293-
};
294-
295-
let command = format!("{cmd:?}");
296-
297-
move || {
298-
let output = child.wait_with_output().unwrap();
299-
300-
if !output.status.success() {
301-
panic!(
302-
"command did not execute successfully: {}\n\
303-
expected success, got: {}",
304-
command, output.status
305-
);
306-
}
307-
308-
String::from_utf8(output.stdout).unwrap()
309-
}
310-
}
311-
312283
/// Returns the last-modified time for `path`, or zero if it doesn't exist.
313284
pub fn mtime(path: &Path) -> SystemTime {
314285
fs::metadata(path).and_then(|f| f.modified()).unwrap_or(UNIX_EPOCH)

0 commit comments

Comments
 (0)