mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:44:43 +01:00
build runner: clean up tmp dirs
This commit is contained in:
parent
b4dbe483a7
commit
c8ecfad41a
1 changed files with 14 additions and 0 deletions
|
|
@ -784,6 +784,9 @@ fn runStepNames(
|
|||
var pending_count: usize = 0;
|
||||
var total_compile_errors: usize = 0;
|
||||
|
||||
var cleanup_task = io.async(cleanTmpFiles, .{ io, step_stack.keys() });
|
||||
defer cleanup_task.await(io);
|
||||
|
||||
for (step_stack.keys()) |s| {
|
||||
test_pass_count += s.test_results.passCount();
|
||||
test_skip_count += s.test_results.skip_count;
|
||||
|
|
@ -1849,3 +1852,14 @@ fn initStdoutWriter(io: Io) *Writer {
|
|||
stdout_writer_allocation = Io.File.stdout().writerStreaming(io, &stdio_buffer_allocation);
|
||||
return &stdout_writer_allocation.interface;
|
||||
}
|
||||
|
||||
fn cleanTmpFiles(io: Io, steps: []const *Step) void {
|
||||
for (steps) |step| {
|
||||
const wf = step.cast(std.Build.Step.WriteFile) orelse continue;
|
||||
if (wf.mode != .tmp) continue;
|
||||
const path = wf.generated_directory.path orelse continue;
|
||||
Io.Dir.cwd().deleteTree(io, path) catch |err| {
|
||||
std.log.warn("failed to delete {s}: {t}", .{ path, err });
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue