Remove all directories under the execroot during a clean
Now the actual workspace root might not be the basename of
the workspace, and everything should be removed anyway.
PiperOrigin-RevId: 152062690
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/CleanCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/CleanCommand.java
index 0a0cec5..2a92e42 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/commands/CleanCommand.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/CleanCommand.java
@@ -225,8 +225,7 @@
env.getBlazeWorkspace().clearCaches();
// In order to be sure that we delete everything, delete the workspace directory both for
// --deep_execroot and for --nodeep_execroot.
- for (String directory : new String[] {
- workspaceDirectory, "execroot/" + workspaceDirectory }) {
+ for (String directory : new String[] {workspaceDirectory, "execroot"}) {
Path child = outputBase.getRelative(directory);
if (child.exists()) {
LOG.finest("Cleaning " + child + (cleanOptions.async ? " asynchronously..." : ""));