diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java b/src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java index c24f659b31..c711787225 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java @@ -21,7 +21,7 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; import com.google.common.collect.Sets; import com.google.devtools.build.lib.actions.Artifact; -import com.google.devtools.build.lib.actions.BaseSpawn; +import com.google.devtools.build.lib.actions.RunfilesSupplier; import com.google.devtools.build.lib.analysis.actions.FileWriteAction; import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder; @@ -65,11 +65,8 @@ public final class CommandHelper { @VisibleForTesting public static int maxCommandLength = OS.getCurrent() == OS.WINDOWS ? 8000 : 64000; - /** - * A map of remote path prefixes and corresponding runfiles manifests for tools - * used by this rule. - */ - private final SkylarkDict<PathFragment, Artifact> remoteRunfileManifestMap; + /** {@link RunfilesSupplier}s for tools used by this rule. */ + private final SkylarkList<RunfilesSupplier> toolsRunfilesSuppliers; /** * Use labelMap for heuristically expanding labels (does not include "outs") @@ -103,8 +100,7 @@ public final class CommandHelper { this.ruleContext = ruleContext; ImmutableList.Builder<Artifact> resolvedToolsBuilder = ImmutableList.builder(); - ImmutableMap.Builder<PathFragment, Artifact> remoteRunfileManifestBuilder = - ImmutableMap.builder(); + ImmutableList.Builder<RunfilesSupplier> toolsRunfilesBuilder = ImmutableList.builder(); Map<Label, Collection<Artifact>> tempLabelMap = new HashMap<>(); for (Map.Entry<Label, ? extends Iterable<Artifact>> entry : labelMap.entrySet()) { @@ -125,11 +121,7 @@ public final class CommandHelper { if (executableArtifact != null) { mapGet(tempLabelMap, label).add(executableArtifact); // Also send the runfiles when running remotely. - Artifact runfilesManifest = tool.getRunfilesManifest(); - if (runfilesManifest != null) { - remoteRunfileManifestBuilder.put( - BaseSpawn.runfilesForFragment(executableArtifact.getExecPath()), runfilesManifest); - } + toolsRunfilesBuilder.add(tool.getRunfilesSupplier()); } else { // Map all depArtifacts to the respective label using the multimaps. mapGet(tempLabelMap, label).addAll(files); @@ -137,7 +129,7 @@ public final class CommandHelper { } this.resolvedTools = SkylarkList.createImmutable(resolvedToolsBuilder.build()); - this.remoteRunfileManifestMap = SkylarkDict.copyOf(null, remoteRunfileManifestBuilder.build()); + this.toolsRunfilesSuppliers = SkylarkList.createImmutable(toolsRunfilesBuilder.build()); ImmutableMap.Builder<Label, ImmutableCollection<Artifact>> labelMapBuilder = ImmutableMap.builder(); for (Entry<Label, Collection<Artifact>> entry : tempLabelMap.entrySet()) { @@ -150,8 +142,8 @@ public final class CommandHelper { return resolvedTools; } - public SkylarkDict<PathFragment, Artifact> getRemoteRunfileManifestMap() { - return remoteRunfileManifestMap; + public SkylarkList<RunfilesSupplier> getToolsRunfilesSuppliers() { + return toolsRunfilesSuppliers; } // Returns the value in the specified corresponding to 'key', creating and |