aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime
diff options
context:
space:
mode:
authorGravatar Yun Peng <pcloudy@google.com>2016-07-19 15:41:19 +0000
committerGravatar Dmitry Lomov <dslomov@google.com>2016-07-19 18:12:26 +0000
commit5206a67ff28f8479d4ce63ecf684f7e24404ac06 (patch)
tree0316d24643955171e4d982c2ec01d2a78b0be253 /src/main/java/com/google/devtools/build/lib/runtime
parentca5a6743d2a58a86c6c70a9577959ad5c756cde3 (diff)
Fixed bazel run command
Now we can use 'bazel run' to run cpp and java binary! -- Change-Id: I84b597765dc77127f3fb701d7bd4a81f6dc44660 Reviewed-on: https://bazel-review.googlesource.com/#/c/4054 MOS_MIGRATED_REVID=127834930
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/RunCommand.java12
1 files changed, 8 insertions, 4 deletions
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 729bace0ef..7cdfc0d2d9 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
@@ -52,6 +52,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.OptionsUtils;
+import com.google.devtools.build.lib.util.OsUtils;
import com.google.devtools.build.lib.util.Preconditions;
import com.google.devtools.build.lib.util.ShellEscaper;
import com.google.devtools.build.lib.util.io.OutErr;
@@ -103,7 +104,7 @@ public class RunCommand implements BlazeCommand {
@VisibleForTesting
public static final String NO_TARGET_MESSAGE = "No targets found to run";
- private static final String PROCESS_WRAPPER = "process-wrapper";
+ private static final String PROCESS_WRAPPER = "process-wrapper" + OsUtils.executableExtension();
// Value of --run_under as of the most recent command invocation.
private RunUnder currentRunUnder;
@@ -357,9 +358,12 @@ public class RunCommand implements BlazeCommand {
Artifact manifest = runfilesSupport.getRunfilesManifest();
PathFragment runfilesDir = runfilesSupport.getRunfilesDirectoryExecPath();
- Path workingDir = env.getExecRoot()
- .getRelative(runfilesDir)
- .getRelative(runfilesSupport.getRunfiles().getSuffix());
+ Path workingDir = env.getExecRoot().getRelative(runfilesDir);
+ // On Windows, runfiles tree is disabled.
+ // Workspace name directory doesn't exist, so don't add it.
+ if (target.getConfiguration().runfilesEnabled()) {
+ workingDir = workingDir.getRelative(runfilesSupport.getRunfiles().getSuffix());
+ }
// When runfiles are not generated, getManifest() returns the
// .runfiles_manifest file, otherwise it returns the MANIFEST file. This is