From 3d501df21f3e51674acbc3a1c3c29e9c904d2e05 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 3 Jan 2025 14:14:44 -0500 Subject: [PATCH] chore: Clean up Rust target/debug directory after all test attempts --- benchmark/benchmark.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/benchmark/benchmark.py b/benchmark/benchmark.py index 17f1732df..57f4829b5 100755 --- a/benchmark/benchmark.py +++ b/benchmark/benchmark.py @@ -853,6 +853,16 @@ def run_test_real( instructions = errors instructions += prompts.test_failures.format(file_list=file_list) + # Clean up Rust target/debug directory after all attempts + if ".rs" in {Path(f).suffix for f in test_files}: + target_dir = testdir / "target" / "debug" + if target_dir.exists(): + try: + shutil.rmtree(target_dir) + print(f"Cleaned up Rust target/debug directory: {target_dir}") + except Exception as e: + print(f"Failed to clean up Rust target/debug directory: {e}") + results = dict( testdir=str(testdir), testcase=testdir.name,