| ... | @@ -784,6 +784,9 @@ fn runStepNames( | ... | @@ -784,6 +784,9 @@ fn runStepNames( |
| 784 | var pending_count: usize = 0; | 784 | var pending_count: usize = 0; |
| 785 | var total_compile_errors: usize = 0; | 785 | var total_compile_errors: usize = 0; |
| 786 | | 786 | |
| | 787 | var cleanup_task = io.async(cleanTmpFiles, .{ io, step_stack.keys() }); |
| | 788 | defer cleanup_task.await(io); |
| | 789 | |
| 787 | for (step_stack.keys()) |s| { | 790 | for (step_stack.keys()) |s| { |
| 788 | test_pass_count += s.test_results.passCount(); | 791 | test_pass_count += s.test_results.passCount(); |
| 789 | test_skip_count += s.test_results.skip_count; | 792 | test_skip_count += s.test_results.skip_count; |
| ... | @@ -1849,3 +1852,14 @@ fn initStdoutWriter(io: Io) *Writer { | ... | @@ -1849,3 +1852,14 @@ fn initStdoutWriter(io: Io) *Writer { |
| 1849 | stdout_writer_allocation = Io.File.stdout().writerStreaming(io, &stdio_buffer_allocation); | 1852 | stdout_writer_allocation = Io.File.stdout().writerStreaming(io, &stdio_buffer_allocation); |
| 1850 | return &stdout_writer_allocation.interface; | 1853 | return &stdout_writer_allocation.interface; |
| 1851 | } | 1854 | } |
| | 1855 | |
| | 1856 | fn cleanTmpFiles(io: Io, steps: []const *Step) void { |
| | 1857 | for (steps) |step| { |
| | 1858 | const wf = step.cast(std.Build.Step.WriteFile) orelse continue; |
| | 1859 | if (wf.mode != .tmp) continue; |
| | 1860 | const path = wf.generated_directory.path orelse continue; |
| | 1861 | Io.Dir.cwd().deleteTree(io, path) catch |err| { |
| | 1862 | std.log.warn("failed to delete {s}: {t}", .{ path, err }); |
| | 1863 | }; |
| | 1864 | } |
| | 1865 | } |