Run "Install binaries" step in block_in_place mode

Since they execute a lot of blocking fs operations.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-06-23 19:48:03 +10:00
parent cc8144e06d
commit a35db557ea
No known key found for this signature in database
GPG key ID: 591C0B03040416D6

View file

@ -12,7 +12,11 @@ use log::{debug, error, info, warn, LevelFilter};
use miette::{miette, IntoDiagnostic, Result, WrapErr};
use simplelog::{ColorChoice, ConfigBuilder, TermLogger, TerminalMode};
use tempfile::TempDir;
use tokio::{process::Command, runtime::Runtime, task::JoinError};
use tokio::{
process::Command,
runtime::Runtime,
task::{block_in_place, JoinError},
};
use cargo_binstall::{
bins,
@ -441,6 +445,7 @@ async fn install_from_package(
uithread.confirm().await?;
info!("Installing binaries...");
block_in_place(|| {
for file in &bin_files {
file.install_bin()?;
}
@ -461,6 +466,7 @@ async fn install_from_package(
}
Ok(())
})
}
async fn install_from_source(