Skip to content

Commit

Permalink
purge all rustwide build directories before each build
Browse files Browse the repository at this point in the history
  • Loading branch information
syphar committed Oct 6, 2023
1 parent 76b471d commit 693b4d6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/docbuilder/rustwide_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,19 @@ impl RustwideBuilder {
}
}

// FIXME: for now, purge all build dirs before each build.
// Currently we have some error situations where the build directory wouldn't be deleted
// after the build failed:
// https://github.com/rust-lang/docs.rs/issues/820
// This should be solved in a better way, likely refactoring the whole builder structure,
// but for now we chose this simple way to prevent that the build directory remains can
// fill up disk space.
// This also prevents having multiple builders using the same rustwide workspace,
// which we don't do. Currently our separate builders use a separate rustwide workspace.
self.workspace
.purge_all_build_dirs()
.map_err(FailureError::compat)?;

let mut build_dir = self.workspace.build_dir(&format!("{name}-{version}"));
build_dir.purge().map_err(FailureError::compat)?;

Expand Down

0 comments on commit 693b4d6

Please sign in to comment.