From 7eefb7c3e55da737b58342bf3e9bf074387a02c0 Mon Sep 17 00:00:00 2001 From: Philipp Wollermann Date: Mon, 17 Jul 2017 16:30:28 +0200 Subject: [PATCH] Do not use process-wrapper in RunCommand on Windows. Fixes #1852. RELNOTES: None. Closes #3370. PiperOrigin-RevId: 162209884 --- .../devtools/build/lib/runtime/commands/RunCommand.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java index 8d146945f3281a..1490a17aca23d1 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java @@ -53,6 +53,7 @@ import com.google.devtools.build.lib.util.CommandFailureUtils; import com.google.devtools.build.lib.util.ExitCode; import com.google.devtools.build.lib.util.FileType; +import com.google.devtools.build.lib.util.OS; import com.google.devtools.build.lib.util.OptionsUtils; import com.google.devtools.build.lib.util.OsUtils; import com.google.devtools.build.lib.util.Preconditions; @@ -253,7 +254,10 @@ public ExitCode exec(CommandEnvironment env, OptionsProvider options) { options.getOptions(BuildRequestOptions.class).getSymlinkPrefix(productName), productName); List cmdLine = new ArrayList<>(); - if (runOptions.scriptPath == null) { + // process-wrapper does not work on Windows (nor is it necessary), so don't use it + // on that platform. Also we skip it when writing the command-line to a file instead + // of executing it directly. + if (OS.getCurrent() != OS.WINDOWS && runOptions.scriptPath == null) { PathFragment processWrapperPath = env.getBlazeWorkspace().getBinTools().getExecPath(PROCESS_WRAPPER); Preconditions.checkNotNull(