aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2016-10-17 12:33:00 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2016-10-17 14:47:45 +0000
commita16207d6d933a1066e75c07ef89dbe94b9759454 (patch)
tree8d732bb17e64070a8e418208724fc6e15c742add /src/main/java/com/google/devtools/build/lib/runtime
parent3000d88075490bbf034c62ea46f3fdfe71baa6b0 (diff)
Failing back to --expunge when using --expunge_async on non-Linux machine
--expunge_async rely on setsid to create a new process group, this is non-existent on Darwin nor on Windows. This lead to moving the output base to a location and forget about it silently. Instead, we fall-back to expunge_async until we completely fixes #1906. -- Change-Id: Ia932613f687149a85f766de9faa7ce49aaa20b38 Reviewed-on: https://bazel-review.googlesource.com/6694 MOS_MIGRATED_REVID=136340995
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/commands/CleanCommand.java12
1 files changed, 11 insertions, 1 deletions
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 923f89473e..3b1c68fae7 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
@@ -26,6 +26,7 @@ import com.google.devtools.build.lib.runtime.CommandEnvironment;
import com.google.devtools.build.lib.shell.CommandException;
import com.google.devtools.build.lib.util.CommandBuilder;
import com.google.devtools.build.lib.util.ExitCode;
+import com.google.devtools.build.lib.util.OS;
import com.google.devtools.build.lib.util.ProcessUtils;
import com.google.devtools.build.lib.util.ShellEscaper;
import com.google.devtools.build.lib.vfs.FileSystemUtils;
@@ -34,7 +35,6 @@ import com.google.devtools.common.options.Option;
import com.google.devtools.common.options.OptionsBase;
import com.google.devtools.common.options.OptionsParser;
import com.google.devtools.common.options.OptionsProvider;
-
import java.io.IOException;
import java.util.logging.Logger;
@@ -98,6 +98,16 @@ public final class CleanCommand implements BlazeCommand {
return ExitCode.COMMAND_LINE_ERROR;
}
+ // TODO(dmarting): Deactivate expunge_async on non-Linux platform until we completely fix it
+ // for non-Linux platforms (https://github.com/bazelbuild/bazel/issues/1906).
+ if (cleanOptions.expunge_async && OS.getCurrent() != OS.LINUX) {
+ env.getReporter().handle(Event.info(null /*location*/,
+ "--expunge_async cannot be used on non-Linux platforms, falling back to --expunge"));
+ cleanOptions.expunge_async = false;
+ cleanOptions.expunge = true;
+ cleanOptions.cleanStyle = "expunge";
+ }
+
String cleanBanner = cleanOptions.expunge_async ?
"Starting clean." :
"Starting clean (this may take a while). " +