Damien Martin-guillerez has uploaded a new change for review. (
https://bazel-review.googlesource.com/6694
Change subject: Failing back to --expunge when using --expunge_async on
non-Linux machine
......................................................................
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
---
M
src/main/java/com/google/devtools/build/lib/runtime/commands/CleanCommand.java
1 file changed, 11 insertions(+), 0 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 923f894..748c4c8 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.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;
@@ -98,6 +99,16 @@
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). " +
--
To view, visit
https://bazel-review.googlesource.com/6694
To unsubscribe, visit
https://bazel-review.googlesource.com/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia932613f687149a85f766de9faa7ce49aaa20b38
Gerrit-PatchSet: 1
Gerrit-Project: bazel
Gerrit-Branch: master
Gerrit-Owner: Damien Martin-guillerez <
dmar...@google.com>