auto import from //depot/cupcake/@137055
diff --git a/core/cleanbuild.mk b/core/cleanbuild.mk
index 01bf9a5..50b56f9 100644
--- a/core/cleanbuild.mk
+++ b/core/cleanbuild.mk
@@ -123,7 +123,11 @@
 ifdef PREVIOUS_BUILD_CONFIG
   ifneq "$(current_build_config)" "$(PREVIOUS_BUILD_CONFIG)"
     $(info *** Build configuration changed: "$(PREVIOUS_BUILD_CONFIG)" -> "$(current_build_config)")
-    force_installclean := true
+    ifneq ($(DISABLE_AUTO_INSTALLCLEAN),true)
+      force_installclean := true
+    else
+      $(info DISABLE_AUTO_INSTALLCLEAN is set; skipping auto-clean. Your tree may be in an inconsistent state.)
+    endif
   endif
 endif  # else, this is the first build, so no need to clean.
 PREVIOUS_BUILD_CONFIG :=