aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib
diff options
context:
space:
mode:
authorGravatar ulfjack <ulfjack@google.com>2018-03-06 00:49:37 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-03-06 00:51:47 -0800
commitd3dd6a1318a4019747f49abf451a35f6a8f2b243 (patch)
treef60613e8fce6346315bdc4039b1d19a1b522de22 /src/main/java/com/google/devtools/build/lib
parentb5a575afd7534c9d963273c3789bbba80f2994fa (diff)
Also get build-runfiles as an ActionInput for the symlink tree spawn
This isn't strictly necessary since we disable caching and require local execution. PiperOrigin-RevId: 187985476
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib')
-rw-r--r--src/main/java/com/google/devtools/build/lib/exec/SymlinkTreeHelper.java16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/exec/SymlinkTreeHelper.java b/src/main/java/com/google/devtools/build/lib/exec/SymlinkTreeHelper.java
index 2b473202b1..143fc971e2 100644
--- a/src/main/java/com/google/devtools/build/lib/exec/SymlinkTreeHelper.java
+++ b/src/main/java/com/google/devtools/build/lib/exec/SymlinkTreeHelper.java
@@ -89,7 +89,7 @@ public final class SymlinkTreeHelper {
public void createSymlinksUsingCommand(
Path execRoot, BuildConfiguration config, BinTools binTools)
throws CommandException {
- List<String> argv = getSpawnArgumentList(execRoot, binTools);
+ List<String> argv = getSpawnArgumentList(execRoot, binTools.getExecPath(BUILD_RUNFILES));
CommandBuilder builder = new CommandBuilder();
builder.addArgs(argv);
builder.setWorkingDir(execRoot);
@@ -128,7 +128,7 @@ public final class SymlinkTreeHelper {
} else {
// Pretend we created the runfiles tree by copying the manifest
try {
- FileSystemUtils.createDirectoryAndParents(symlinkTreeRoot);
+ symlinkTreeRoot.createDirectoryAndParents();
FileSystemUtils.copyFile(inputManifest, symlinkTreeRoot.getChild("MANIFEST"));
} catch (IOException e) {
throw new UserExecException(e.getMessage(), e);
@@ -144,15 +144,16 @@ public final class SymlinkTreeHelper {
BinTools binTools,
ImmutableMap<String, String> environment,
ActionInput inputManifestArtifact) {
+ ActionInput buildRunfiles = binTools.getActionInput(BUILD_RUNFILES);
return new SimpleSpawn(
owner,
- getSpawnArgumentList(execRoot, binTools),
+ getSpawnArgumentList(execRoot, buildRunfiles.getExecPath()),
environment,
ImmutableMap.of(
ExecutionRequirements.LOCAL, "",
ExecutionRequirements.NO_CACHE, "",
ExecutionRequirements.NO_SANDBOX, ""),
- ImmutableList.of(inputManifestArtifact),
+ ImmutableList.of(inputManifestArtifact, buildRunfiles),
/*outputs=*/ ImmutableList.of(),
RESOURCE_SET);
}
@@ -160,12 +161,9 @@ public final class SymlinkTreeHelper {
/**
* Returns the complete argument list build-runfiles has to be called with.
*/
- private ImmutableList<String> getSpawnArgumentList(Path execRoot, BinTools binTools) {
- PathFragment path = binTools.getExecPath(BUILD_RUNFILES);
- Preconditions.checkNotNull(path, BUILD_RUNFILES + " not found in embedded tools");
-
+ private ImmutableList<String> getSpawnArgumentList(Path execRoot, PathFragment buildRunfiles) {
List<String> args = Lists.newArrayList();
- args.add(path.getPathString());
+ args.add(buildRunfiles.getPathString());
if (filesetTree) {
args.add("--allow_relative");