Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/ofborg
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0db6f7071444
Choose a base ref
...
head repository: NixOS/ofborg
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 91f6aee4d53c
Choose a head ref
  • 3 commits
  • 1 file changed
  • 2 contributors

Commits on Apr 4, 2020

  1. nixenv: warn when removing the stats file fails

    If the `nix` invocation fails, a stats file won't get created. We log a
    warning, but it is generally safe to ignore this failure.
    cole-h committed Apr 4, 2020
    Copy the full SHA
    42b4bb2 View commit details
  2. nixenv: remove unnecessary single quotes

    The debug representation of a `PathBuf` provides double quotes already.
    cole-h committed Apr 4, 2020
    Copy the full SHA
    9736cf0 View commit details
  3. Merge pull request #449 from cole-h/ignore-remove-file

    nixenv: warn when removing the stats file fails
    grahamc authored Apr 4, 2020
    Copy the full SHA
    91f6aee View commit details
Showing with 9 additions and 7 deletions.
  1. +9 −7 ofborg/src/nixenv.rs
16 changes: 9 additions & 7 deletions ofborg/src/nixenv.rs
Original file line number Diff line number Diff line change
@@ -72,7 +72,13 @@ impl HydraNixEnv {
let outpath_stats = self.outpath_stats_path();

fs::remove_file(&outpath_nix).map_err(|e| Error::RemoveFile(outpath_nix, e))?;
fs::remove_file(&outpath_stats).map_err(|e| Error::RemoveFile(outpath_stats, e))?;

// Removing the stats file can fail if `nix` itself errored, for example
// when it fails to evaluate something. In this case, we can ignore (but
// warn about) the error.
if let Err(e) = fs::remove_file(&outpath_stats) {
warn!("Failed to remove file {:?}: {:?}", outpath_stats, e)
}

Ok(())
}
@@ -130,12 +136,8 @@ impl Error {
pub fn display(self) -> String {
match self {
Error::Io(e) => format!("Failed during the setup of executing nix-env: {:?}", e),
Error::CreateFile(path, err) => {
format!("Failed to create file '{:?}': {:?}", path, err)
}
Error::RemoveFile(path, err) => {
format!("Failed to remove file '{:?}': {:?}", path, err)
}
Error::CreateFile(path, err) => format!("Failed to create file {:?}: {:?}", path, err),
Error::RemoveFile(path, err) => format!("Failed to remove file {:?}: {:?}", path, err),
Error::WriteFile(file, err) => {
format!("Failed to write to file '{:?}': {:?}", file, err)
}