Verify the nix store before starting a build run.
This commit is contained in:
@@ -9,6 +9,7 @@ use crate::Result;
|
||||
use crate::database::db_handle::DbHandle;
|
||||
|
||||
use super::RunningUpdate;
|
||||
use super::RunningVerify;
|
||||
use super::running_build::RunningBuild;
|
||||
|
||||
pub(crate) async fn nixos_build_target<B, F, A, TN>(
|
||||
@@ -87,3 +88,26 @@ where
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) async fn nix_store_verify_repair_check_contents() -> Result<()> {
|
||||
let mut command = Command::new("nix-store");
|
||||
command.stdout(Stdio::piped());
|
||||
command.stderr(Stdio::piped());
|
||||
command.stdin(Stdio::null());
|
||||
command.args([
|
||||
"--verify",
|
||||
"--check-contents",
|
||||
"--repair",
|
||||
"--log-format",
|
||||
"internal-json",
|
||||
"-vvvvvvvvvvv",
|
||||
]);
|
||||
command.kill_on_drop(true);
|
||||
|
||||
let child = command.spawn()?;
|
||||
|
||||
let mut running_verify = RunningVerify::new()?;
|
||||
running_verify.run_to_completion(child).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user