forked from lix-project/lix-installer
fsync after writing Nix config to attempt to fix the flaky preserves_comment test (#448)
This commit is contained in:
parent
1ae77d11ee
commit
965185dcab
|
@ -434,6 +434,10 @@ impl Action for CreateOrMergeNixConfig {
|
||||||
e,
|
e,
|
||||||
))
|
))
|
||||||
})?;
|
})?;
|
||||||
|
temp_file
|
||||||
|
.sync_all()
|
||||||
|
.await
|
||||||
|
.map_err(|e| Self::error(ActionErrorKind::Sync(temp_file_path.clone(), e)))?;
|
||||||
tokio::fs::rename(&temp_file_path, &path)
|
tokio::fs::rename(&temp_file_path, &path)
|
||||||
.await
|
.await
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
|
|
|
@ -443,6 +443,8 @@ pub enum ActionErrorKind {
|
||||||
Open(std::path::PathBuf, #[source] std::io::Error),
|
Open(std::path::PathBuf, #[source] std::io::Error),
|
||||||
#[error("Write path `{0}`")]
|
#[error("Write path `{0}`")]
|
||||||
Write(std::path::PathBuf, #[source] std::io::Error),
|
Write(std::path::PathBuf, #[source] std::io::Error),
|
||||||
|
#[error("Sync path `{0}`")]
|
||||||
|
Sync(std::path::PathBuf, #[source] std::io::Error),
|
||||||
#[error("Seek path `{0}`")]
|
#[error("Seek path `{0}`")]
|
||||||
Seek(std::path::PathBuf, #[source] std::io::Error),
|
Seek(std::path::PathBuf, #[source] std::io::Error),
|
||||||
#[error("Flushing `{0}`")]
|
#[error("Flushing `{0}`")]
|
||||||
|
|
|
@ -27,7 +27,7 @@ impl std::fmt::Display for Logger {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(clap::Args, Debug)]
|
#[derive(clap::Args, Debug, Default)]
|
||||||
pub struct Instrumentation {
|
pub struct Instrumentation {
|
||||||
/// Enable debug logs, -vv for trace
|
/// Enable debug logs, -vv for trace
|
||||||
#[clap(short = 'v', env = "NIX_INSTALLER_VERBOSITY", long, action = clap::ArgAction::Count, global = true)]
|
#[clap(short = 'v', env = "NIX_INSTALLER_VERBOSITY", long, action = clap::ArgAction::Count, global = true)]
|
||||||
|
|
Loading…
Reference in a new issue