diff options
author | 2016-12-05 19:44:53 +0000 | |
---|---|---|
committer | 2016-12-06 12:04:57 +0000 | |
commit | 3f008a0bec454a9f83415b5f23ddd7c710e25b7c (patch) | |
tree | 26f8a986327e58976f1879b6464a8f6c06ca04e1 /src/main/java/com | |
parent | c645a45204b5ee4698387b0487b8a5136ba6d06f (diff) |
Mount TreeArtifact directories as inputs to Spawns.
Fixes https://github.com/bazelbuild/bazel/issues/1928.
--
PiperOrigin-RevId: 141077737
MOS_MIGRATED_REVID=141077737
Diffstat (limited to 'src/main/java/com')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/sandbox/SpawnHelpers.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/sandbox/SpawnHelpers.java b/src/main/java/com/google/devtools/build/lib/sandbox/SpawnHelpers.java index 34ddd9e782..1bfa16b197 100644 --- a/src/main/java/com/google/devtools/build/lib/sandbox/SpawnHelpers.java +++ b/src/main/java/com/google/devtools/build/lib/sandbox/SpawnHelpers.java @@ -187,6 +187,17 @@ public final class SpawnHelpers { } } + // ActionInputHelper#expandArtifacts above expands empty TreeArtifacts into an empty list. + // However, actions that accept TreeArtifacts as inputs generally expect that the empty + // directory is created. So here we explicitly mount the directories of the TreeArtifacts as + // inputs. + for (ActionInput input : spawn.getInputFiles()) { + if (input instanceof Artifact && ((Artifact) input).isTreeArtifact()) { + PathFragment mount = new PathFragment(input.getExecPathString()); + mounts.put(mount, execRoot.getRelative(mount)); + } + } + for (ActionInput input : inputs) { if (input.getExecPathString().contains("internal/_middlemen/")) { continue; |