[Lldb-commits] [lldb] [lldb][Windows] Make RM_RF actually delete files (PR #222950)

Charles Zablit via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 11 07:00:38 PDT 2026


https://github.com/charles-zablit created https://github.com/llvm/llvm-project/pull/222950

`RM_RF` on Windows was `rd /s /q`, which only removes directories, so `clean::` silently did nothing and `|| (exit 0)` hid the failure. Tests that delete a build artifact and rebuild then never regenerate it.

This does not match the behavior of `RM_RF` on POSIX and causes issues in Swiftlang.

>From 7b71bbdf3d7556b76874e5930e1a88700624e4c3 Mon Sep 17 00:00:00 2001
From: Charles Zablit <c_zablit at apple.com>
Date: Fri, 11 Sep 2026 14:56:21 +0100
Subject: [PATCH] [lldb][Windows] Make RM_RF actually delete files

---
 lldb/packages/Python/lldbsuite/test/make/Makefile.rules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
index 0ded62beb6714..4ba77c931963e 100644
--- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -44,7 +44,7 @@ ifeq "$(OS)" "Windows_NT"
 	CP_R = xcopy $(subst /,\,$(1)) $(subst /,\,$(2)) /s /e /y
 	RM = del $(subst /,\,$(1)) > nul 2>&1 || (exit 0)
 	RM_F = del /f /q $(subst /,\,$(1))
-	RM_RF = $(if $(strip $(1)),rd /s /q $(subst /,\,$(1)) > nul 2>&1 || (exit 0))
+	RM_RF = $(if $(strip $(1)),(del /f /q $(subst /,\,$(1)) > nul 2>&1 & rd /s /q $(subst /,\,$(1)) > nul 2>&1) || (exit 0))
 	LN_SF = mklink /D "$(subst /,\,$(2))" "$(subst /,\,$(1))"
 	ECHO = echo $(1);
 	ECHO_TO_FILE = echo $(subst ',,$(1))> "$(subst /,\,$(2))"



More information about the lldb-commits mailing list